From b5e41f3e86fce30c9b78a939e89f5ef57e158634 Mon Sep 17 00:00:00 2001 From: Muhammad Adeel Date: Fri, 18 Jun 2021 09:14:21 +0200 Subject: [PATCH 1/2] overlay.d: fips: s390x: fix zipl parmfile Zipl expects only kernel command line options in the parmfile. If a whole bls file is provided as a parmfile, the system will not be able to boot and switch to rescue mode after reboot. --- .../usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/overlay.d/05rhcos/usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh b/overlay.d/05rhcos/usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh index f1071819c..dba8f3f20 100755 --- a/overlay.d/05rhcos/usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh +++ b/overlay.d/05rhcos/usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh @@ -70,16 +70,18 @@ firstboot() { # We need to call zipl with the kernel image and ramdisk as running it without these options would require a zipl.conf and chroot # into rootfs tmpfile=$(mktemp) + optfile=$(mktemp) for f in "${tmpsysroot}"/boot/loader/entries/*.conf; do for line in title version linux initrd options; do echo $(grep $line $f) >> $tmpfile done done + grep options $tmpfile | cut -c 9- > $optfile zipl --verbose \ --target "${tmpsysroot}/boot" \ --image $tmpsysroot/boot/"$(grep linux $tmpfile | cut -d' ' -f2)" \ --ramdisk $tmpsysroot/boot/"$(grep initrd $tmpfile | cut -d' ' -f2)" \ - --parmfile $tmpfile + --parmfile $optfile fi echo "Rebooting" From b8334575277fc74470b0d7c28d484562b4ec00f5 Mon Sep 17 00:00:00 2001 From: Muhammad Adeel Date: Fri, 18 Jun 2021 10:09:56 +0200 Subject: [PATCH 2/2] overlay.d: fips: s390x: add ignition.firstboot to finish ignition stages --- .../usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/overlay.d/05rhcos/usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh b/overlay.d/05rhcos/usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh index dba8f3f20..cb0f981c4 100755 --- a/overlay.d/05rhcos/usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh +++ b/overlay.d/05rhcos/usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh @@ -76,6 +76,10 @@ firstboot() { echo $(grep $line $f) >> $tmpfile done done + # This is needed to finish all ignition stages + echo "Appending 'ignition.firstboot' to ${tmpfile}" + sed -e "/^options / s/$/ ignition.firstboot/" -i "$tmpfile" + grep options $tmpfile | cut -c 9- > $optfile zipl --verbose \ --target "${tmpsysroot}/boot" \