Blame 0008-fips-set-boot-as-symlink-to-sysroot-boot-if-no-boot-.patch

Harald Hoyer 7e00d9
From c9a9968dfc7f8fb644909cbb52e27fe7312156a7 Mon Sep 17 00:00:00 2001
Harald Hoyer 7e00d9
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 7e00d9
Date: Tue, 21 Aug 2012 15:01:08 +0200
Harald Hoyer 7e00d9
Subject: [PATCH] fips: set /boot as symlink to /sysroot/boot if no boot=
Harald Hoyer 7e00d9
 parameter
Harald Hoyer 7e00d9
Harald Hoyer 7e00d9
otherwise sha512hmac will error out with:
Harald Hoyer 7e00d9
Harald Hoyer 7e00d9
sha512hmac -c /sysroot/boot/.vmlinuz-2.6.32-220.el6.x86_64.hmac
Harald Hoyer 7e00d9
Error opening "/boot/vmlinuz-2.6.32-220.el6.x86_64": No such file or directory.
Harald Hoyer 7e00d9
---
Harald Hoyer 7e00d9
 modules.d/01fips/fips.sh | 12 ++++++------
Harald Hoyer 7e00d9
 1 file changed, 6 insertions(+), 6 deletions(-)
Harald Hoyer 7e00d9
Harald Hoyer 7e00d9
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
Harald Hoyer 7e00d9
index 67eefb8..324e062 100755
Harald Hoyer 7e00d9
--- a/modules.d/01fips/fips.sh
Harald Hoyer 7e00d9
+++ b/modules.d/01fips/fips.sh
Harald Hoyer 7e00d9
@@ -45,23 +45,23 @@ mount_boot()
Harald Hoyer 7e00d9
         mkdir /boot
Harald Hoyer 7e00d9
         info "Mounting $boot as /boot"
Harald Hoyer 7e00d9
         mount -oro "$boot" /boot || return 1
Harald Hoyer 7e00d9
+    elif [ -d "$NEWROOT/boot" ]; then
Harald Hoyer 7e00d9
+        rm -fr /boot
Harald Hoyer 7e00d9
+        ln -sf "$NEWROOT/boot" /boot
Harald Hoyer 7e00d9
     fi
Harald Hoyer 7e00d9
 }
Harald Hoyer 7e00d9
 
Harald Hoyer 7e00d9
 do_fips()
Harald Hoyer 7e00d9
 {
Harald Hoyer 7e00d9
     info "Checking integrity of kernel"
Harald Hoyer 7e00d9
-    newroot=$NEWROOT
Harald Hoyer 7e00d9
     KERNEL=$(uname -r)
Harald Hoyer 7e00d9
 
Harald Hoyer 7e00d9
-    [ -e "$newroot/boot/.vmlinuz-${KERNEL}.hmac" ] || unset newroot
Harald Hoyer 7e00d9
-
Harald Hoyer 7e00d9
-    if ! [ -e "$newroot/boot/.vmlinuz-${KERNEL}.hmac" ]; then
Harald Hoyer 7e00d9
-        warn "$newroot/boot/.vmlinuz-${KERNEL}.hmac does not exist"
Harald Hoyer 7e00d9
+    if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
Harald Hoyer 7e00d9
+        warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
Harald Hoyer 7e00d9
         return 1
Harald Hoyer 7e00d9
     fi
Harald Hoyer 7e00d9
 
Harald Hoyer 7e00d9
-    sha512hmac -c "$newroot/boot/.vmlinuz-${KERNEL}.hmac" || return 1
Harald Hoyer 7e00d9
+    sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
Harald Hoyer 7e00d9
 
Harald Hoyer 7e00d9
     FIPSMODULES=$(cat /etc/fipsmodules)
Harald Hoyer 7e00d9