Skip to content

Commit 4dd10eb

Browse files
committed
Update files
1 parent f9456ff commit 4dd10eb

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

images_yaml/almalinux.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,14 @@ actions:
458458
grub2-mkconfig -o "${target}"
459459
sed -i "s#root=[^ ]*#root=${DISTROBUILDER_ROOT_UUID}#g" "${target}"
460460
461+
# Update the default kernel command line, loop0p2 is still present there,
462+
# which will be added by postinst scriptlets when installing or reinstalling
463+
# a kernel. This fixes the rootfs mount on subsequent boots after upgrading
464+
# the kernel.
465+
if [ -f /etc/kernel/cmdline ]; then
466+
sed -i "s#root=[^ ]*#root=${DISTROBUILDER_ROOT_UUID}#g" /etc/kernel/cmdline
467+
fi
468+
461469
# Update files in /boot/loader/entries/. `grubby` needs to be run after
462470
# `grub2-mkconfig` as the latter overwrites files in /boot/loader/entries/.
463471
grubby --update-kernel=/boot/vmlinuz-${kver} --args="root=${DISTROBUILDER_ROOT_UUID} ro"

images_yaml/centos.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,14 @@ actions:
908908
grub2-mkconfig -o "${target}"
909909
sed -i "s#root=[^ ]*#root=${DISTROBUILDER_ROOT_UUID}#g" "${target}"
910910
911+
# Update the default kernel command line, loop0p2 is still present there,
912+
# which will be added by postinst scriptlets when installing or reinstalling
913+
# a kernel. This fixes the rootfs mount on subsequent boots after upgrading
914+
# the kernel.
915+
if [ -f /etc/kernel/cmdline ]; then
916+
sed -i "s#root=[^ ]*#root=${DISTROBUILDER_ROOT_UUID}#g" /etc/kernel/cmdline
917+
fi
918+
911919
# Update files in /boot/loader/entries/. `grubby` needs to be run after
912920
# `grub2-mkconfig` as the latter overwrites files in /boot/loader/entries/.
913921
grubby --update-kernel=/boot/vmlinuz-${kver} --args="root=${DISTROBUILDER_ROOT_UUID} ro"

images_yaml/rockylinux.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,14 @@ actions:
446446
grub2-mkconfig -o "${target}"
447447
sed -i "s#root=[^ ]*#root=${DISTROBUILDER_ROOT_UUID}#g" "${target}"
448448
449+
# Update the default kernel command line, loop0p2 is still present there,
450+
# which will be added by postinst scriptlets when installing or reinstalling
451+
# a kernel. This fixes the rootfs mount on subsequent boots after upgrading
452+
# the kernel.
453+
if [ -f /etc/kernel/cmdline ]; then
454+
sed -i "s#root=[^ ]*#root=${DISTROBUILDER_ROOT_UUID}#g" /etc/kernel/cmdline
455+
fi
456+
449457
# Update files in /boot/loader/entries/. `grubby` needs to be run after
450458
# `grub2-mkconfig` as the latter overwrites files in /boot/loader/entries/.
451459
grubby --update-kernel=/boot/vmlinuz-${kver} --args="root=${DISTROBUILDER_ROOT_UUID} ro"

0 commit comments

Comments
 (0)