6b5521
From ce722c7307e48a991d8450360a1a0183dfdb4915 Mon Sep 17 00:00:00 2001
6b5521
From: Jonathan Lebon <jonathan@jlebon.com>
6b5521
Date: Tue, 29 Oct 2019 09:35:41 -0400
6b5521
Subject: [PATCH] 01fips: fix HMAC file path resolution
6b5521
6b5521
There is a small regression in #343: when handling the 'separate boot
6b5521
partition' case, we're checking for the kernel image in the wrong
6b5521
location: `BOOT_IMAGE` is the `/boot`-relative path to the kernel image,
6b5521
so `/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}` expands to e.g.
6b5521
`/boot/mysubdir1/mysubdir2/mysubdir1/mysubdir2/vmlinuz...`.
6b5521
6b5521
We should be using `BOOT_IMAGE_NAME` here instead (and in fact, the next
6b5521
if-statement does this correctly, so it might've just been accidentally
6b5521
left out of #343).
6b5521
---
6b5521
 modules.d/01fips/fips.sh | 2 +-
6b5521
 1 file changed, 1 insertion(+), 1 deletion(-)
6b5521
6b5521
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
6b5521
index beaa692b..c3dbcf74 100755
6b5521
--- a/modules.d/01fips/fips.sh
6b5521
+++ b/modules.d/01fips/fips.sh
6b5521
@@ -118,7 +118,7 @@ do_fips()
6b5521
 
6b5521
         if [ -z "$BOOT_IMAGE_NAME" ]; then
6b5521
             BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
6b5521
-        elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}" ]; then
6b5521
+        elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
6b5521
             #if /boot is not a separate partition BOOT_IMAGE might start with /boot
6b5521
             BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"}
6b5521
             #on some achitectures BOOT_IMAGE does not contain path to kernel
6b5521