Make label-based booting persistent (see: #996915).

Without this, the block device holding the root filesystem would be
resolved at the first boot when reconfiguring raspi-firmware (e.g.
/dev/mmcblk1p2) which would then make the system fail to boot if it
ever shows up under a different name (e.g. /dev/mmcblk0p2).

Set ROOTPART parameter explicitly to stick to label-based booting.
This commit is contained in:
Cyril Brulebois 2021-10-21 16:35:40 +02:00
parent 46ead8a58d
commit f89f71560d
1 changed files with 3 additions and 1 deletions

View File

@ -140,11 +140,13 @@ steps:
# the partition labeled raspiroot instead of forcing it to mmcblk0p2 # the partition labeled raspiroot instead of forcing it to mmcblk0p2
# #
# These changes will be overwritten after the hardware is probed # These changes will be overwritten after the hardware is probed
# after dpkg reconfigures raspi-firmware (upon first boot). # after dpkg reconfigures raspi-firmware (upon first boot), so make
# sure we don't lose label-based booting.
- chroot: / - chroot: /
shell: | shell: |
sed -i 's/^/console=__SERIAL_CONSOLE__ /' /boot/firmware/cmdline.txt sed -i 's/^/console=__SERIAL_CONSOLE__ /' /boot/firmware/cmdline.txt
sed -i 's#root=/dev/mmcblk0p2#root=LABEL=RASPIROOT#' /boot/firmware/cmdline.txt sed -i 's#root=/dev/mmcblk0p2#root=LABEL=RASPIROOT#' /boot/firmware/cmdline.txt
sed -i 's/^#ROOTPART=.*/ROOTPART=LABEL=RASPIROOT/' /etc/default/raspi-firmware
# TODO(https://github.com/larswirzenius/vmdb2/issues/24): remove once vmdb # TODO(https://github.com/larswirzenius/vmdb2/issues/24): remove once vmdb
# clears /etc/resolv.conf on its own. # clears /etc/resolv.conf on its own.