File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments