From f89f71560d2ca1bd60d97dbb26b89782657d56ae Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Thu, 21 Oct 2021 16:35:40 +0200 Subject: [PATCH] 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. --- raspi_master.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/raspi_master.yaml b/raspi_master.yaml index 41b1a90..e4383a0 100644 --- a/raspi_master.yaml +++ b/raspi_master.yaml @@ -140,11 +140,13 @@ steps: # the partition labeled raspiroot instead of forcing it to mmcblk0p2 # # 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: / shell: | 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/^#ROOTPART=.*/ROOTPART=LABEL=RASPIROOT/' /etc/default/raspi-firmware # TODO(https://github.com/larswirzenius/vmdb2/issues/24): remove once vmdb # clears /etc/resolv.conf on its own.