From d3481d9524bf32fbd59fc53b3d6a114885bb4eac Mon Sep 17 00:00:00 2001 From: Nathan Parsons Date: Thu, 9 Aug 2018 13:00:35 +0100 Subject: [PATCH] Add support for the kernel being within a btrfs subvolume (#226) - /boot may be within a named root subvolume (eg. "/@/boot") - /boot may be in its own subvolume (eg. "/@boot") --- spectre-meltdown-checker.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index e60418d..63ffabb 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -1309,6 +1309,9 @@ if [ "$opt_live" = 1 ]; then if [ -r /proc/cmdline ] && grep -q 'BOOT_IMAGE=' /proc/cmdline; then opt_kernel=$(grep -Eo 'BOOT_IMAGE=[^ ]+' /proc/cmdline | cut -d= -f2) _debug "found opt_kernel=$opt_kernel in /proc/cmdline" + # if the boot partition is within a btrfs subvolume, strip the subvolume name + # if /boot is a separate subvolume, the remainder of the code in this section should handle it + if echo "$opt_kernel" | grep -q "^/@"; then opt_kernel=$(echo "$opt_kernel" | sed "s:/@[^/]*::"); fi # if we have a dedicated /boot partition, our bootloader might have just called it / # so try to prepend /boot and see if we find anything [ -e "/boot/$opt_kernel" ] && opt_kernel="/boot/$opt_kernel"