From: Jonathan Lebon Date: Tue, 29 Oct 2019 13:35:41 +0000 (-0400) Subject: 01fips: fix HMAC file path resolution X-Git-Tag: 050~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e759aa9696704809df6a147cb091ea052dd208d;p=thirdparty%2Fdracut.git 01fips: fix HMAC file path resolution There is a small regression in #343: when handling the 'separate boot partition' case, we're checking for the kernel image in the wrong location: `BOOT_IMAGE` is the `/boot`-relative path to the kernel image, so `/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}` expands to e.g. `/boot/mysubdir1/mysubdir2/mysubdir1/mysubdir2/vmlinuz...`. We should be using `BOOT_IMAGE_NAME` here instead (and in fact, the next if-statement does this correctly, so it might've just been accidentally left out of #343). --- diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh index c6de30839..b256b11bf 100755 --- a/modules.d/01fips/fips.sh +++ b/modules.d/01fips/fips.sh @@ -118,7 +118,7 @@ do_fips() if [ -z "$BOOT_IMAGE_NAME" ]; then BOOT_IMAGE_NAME="vmlinuz-${KERNEL}" - elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}" ]; then + elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then #if /boot is not a separate partition BOOT_IMAGE might start with /boot BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"} #on some achitectures BOOT_IMAGE does not contain path to kernel