]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
01fips: fix HMAC file path resolution
authorJonathan Lebon <jonathan@jlebon.com>
Tue, 29 Oct 2019 13:35:41 +0000 (09:35 -0400)
committerLukáš Nykrýn <lnykryn@redhat.com>
Thu, 31 Oct 2019 10:12:36 +0000 (11:12 +0100)
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).

modules.d/01fips/fips.sh

index c6de3083930b391a6533ece358022ab2b4e6ef08..b256b11bf5fea7913c8b1c19c8bf4cee8e94e5f7 100755 (executable)
@@ -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