From 4b2c8c74c4ada1181da7887011bad7cdbe0f177e Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 3 Nov 2026 20:23:43 +0100 Subject: [PATCH 1/3] Rebuild the initramfs when installing Ubuntu images to disk The installed system kept the initramfs of the image. Ubuntu 26.04 builds it with dracut in host-only mode, so a captured image's initramfs waits for the source's volume group and filesystem UUIDs and the installed node ends in emergency mode. Rebuild it in post.sh, as EL does through kernel-install. --- .../ubuntu20.04-diskless/profiles/default/scripts/post.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/post.sh index 67af89ba..ca6702f1 100644 --- a/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/post.sh @@ -16,6 +16,14 @@ exec 2>> /var/log/confluent/confluent-post.log chmod 600 /var/log/confluent/confluent-post.log tail -f /var/log/confluent/confluent-post.log > /dev/console & logshowpid=$! +# The image's initramfs can be specific to the system it was captured from: +# dracut in host-only mode (Ubuntu 26.04) waits for that system's volume +# group and filesystem UUIDs. Rebuild it for this disk. +if command -v update-initramfs > /dev/null 2>&1; then + update-initramfs -u -k all +elif command -v dracut > /dev/null 2>&1; then + dracut -f --regenerate-all +fi curl -f https://$confluent_mgr/confluent-public/os/$confluent_profile/scripts/firstboot.service > /etc/systemd/system/firstboot.service mkdir -p /opt/confluent/bin curl -f https://$confluent_mgr/confluent-public/os/$confluent_profile/scripts/firstboot.sh > /opt/confluent/bin/firstboot.sh From ed49d131ad1542a0f7714a0f5a5905c9401beb34 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 3 Nov 2026 20:23:43 +0100 Subject: [PATCH 2/3] Strip the key from installedargs in Ubuntu installs post.sh took the whole installedargs line from profile.yaml, key included, so every Ubuntu install from these profiles got a literal 'installedargs:' in GRUB_CMDLINE_LINUX. --- confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh | 2 +- confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh index 38f0b40d..89cd3fd0 100755 --- a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh @@ -46,7 +46,7 @@ if [ "$textcons" = "true" ] && ! grep console= /proc/cmdline > /dev/null; then updategrub=1 fi fi -kargs=$(curl https://$confluent_mgr/confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/#.*//') +kargs=$(curl https://$confluent_mgr/confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/^installedargs:[[:space:]]*//' -e 's/#.*//') if [ ! -z "$kargs" ]; then sed -i 's/GRUB_CMDLINE_LINUX="\([^"]*\)"/GRUB_CMDLINE_LINUX="\1 '"${kargs}"'"/' /target/etc/default/grub fi diff --git a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh index 0dab9f93..126dc4da 100755 --- a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh @@ -46,7 +46,7 @@ if [ "$textcons" = "true" ] && ! grep console= /proc/cmdline > /dev/null; then updategrub=1 fi fi -kargs=$(curl https://$confluent_mgr/confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/#.*//') +kargs=$(curl https://$confluent_mgr/confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/^installedargs:[[:space:]]*//' -e 's/#.*//') if [ ! -z "$kargs" ]; then sed -i 's/GRUB_CMDLINE_LINUX="\([^"]*\)"/GRUB_CMDLINE_LINUX="\1 '"${kargs}"'"/' /target/etc/default/grub fi From 98305181313d2e3569bf420100fc0fd7dc5032ee Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 3 Nov 2026 21:16:53 +0100 Subject: [PATCH 3/3] Apply installedargs to the grub configuration of Ubuntu installs post.sh wrote installedargs into /etc/default/grub but only ran update-grub when it had also added a console, so grub.cfg kept the old command line until some later grub update. --- confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh | 1 + confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh index 89cd3fd0..7f234737 100755 --- a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh @@ -49,6 +49,7 @@ fi kargs=$(curl https://$confluent_mgr/confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/^installedargs:[[:space:]]*//' -e 's/#.*//') if [ ! -z "$kargs" ]; then sed -i 's/GRUB_CMDLINE_LINUX="\([^"]*\)"/GRUB_CMDLINE_LINUX="\1 '"${kargs}"'"/' /target/etc/default/grub + updategrub=1 fi mkdir -p /opt/confluent/bin mkdir -p /etc/confluent diff --git a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh index 126dc4da..9c07cd14 100755 --- a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh @@ -49,6 +49,7 @@ fi kargs=$(curl https://$confluent_mgr/confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/^installedargs:[[:space:]]*//' -e 's/#.*//') if [ ! -z "$kargs" ]; then sed -i 's/GRUB_CMDLINE_LINUX="\([^"]*\)"/GRUB_CMDLINE_LINUX="\1 '"${kargs}"'"/' /target/etc/default/grub + updategrub=1 fi mkdir -p /opt/confluent/bin mkdir -p /etc/confluent