From df4e62a4e2a2a37a275673744133f3d9fa4de54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= Date: Fri, 22 Oct 2021 17:38:27 +0200 Subject: [PATCH] Fixed nasty bug in ramdisk generator The ramdisk unit generator reads the config.bootoptions file and extracts the root_uuid from it. This is done with a very simple shell read using a space as separator. However the last element is never read by that code. As long as there was yet another kernel cmdline option after the root= option this bug was not an issue. But as soon as the root= option is last in the list it will not be read and the generator exits prior creating the sysroot.mount target. This commit fixes it in a way that it makes sure there is always a space at the end of the config.bootoptions file --- .../90kiwi-dump/kiwi-ramdisk-deployment-generator.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dracut/modules.d/90kiwi-dump/kiwi-ramdisk-deployment-generator.sh b/dracut/modules.d/90kiwi-dump/kiwi-ramdisk-deployment-generator.sh index 6cb01174..d0eadcc6 100755 --- a/dracut/modules.d/90kiwi-dump/kiwi-ramdisk-deployment-generator.sh +++ b/dracut/modules.d/90kiwi-dump/kiwi-ramdisk-deployment-generator.sh @@ -26,6 +26,10 @@ GENERATOR_DIR="$1" [ -e /config.bootoptions ] || exit 1 +# Add a space to /config.bootoptions to make sure the +# following token based read captures all entries +echo -n ' ' >> /config.bootoptions + root_uuid=$( while read -r -d ' ' opt; do echo "${opt}";done < /config.bootoptions |\ grep root= | cut -f2- -d=