diff --git a/Makefile b/Makefile index 64b7327..5edce42 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ raspi_4_buster.yaml: raspi_base_buster.yaml cat raspi_base_buster.yaml | sed "s/__ARCH__/arm64/" | \ sed "s#raspi3-firmware#raspi-firmware/buster-backports#" | \ sed "s#apt-get update#echo 'APT::Default-Release \"buster\";' > /etc/apt/apt.conf\n apt-get update#" | \ - sed "s#\(RASPIROOT.*cmdline.txt\)#\1\n sed -i 's/cma=64M //' /boot/firmware/cmdline.txt\n sed -i 's/cma=\\\$$CMA //' /etc/kernel/postinst.d/z50-raspi-firmware#" | \ + sed "s#\(RASPIROOT.*cmdline.txt\)#\1\n sed -i 's/cma=64M //' /boot/firmware/cmdline.txt#" | \ sed "s/__LINUX_IMAGE__/linux-image-arm64\/buster-backports/" | \ sed "s/__EXTRA_PKGS__/- firmware-brcm80211\/buster-backports/" | \ sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-arm64\\/broadcom\\/bcm*rpi*.dtb/" |\ @@ -113,7 +113,7 @@ raspi_3_bullseye.yaml: raspi_base_bullseye.yaml raspi_4_bullseye.yaml: raspi_base_bullseye.yaml cat raspi_base_bullseye.yaml | sed "s/__ARCH__/arm64/" | \ - sed "s#\(RASPIROOT.*cmdline.txt\)#\1\n sed -i 's/cma=64M //' /boot/firmware/cmdline.txt\n sed -i 's/cma=\\\$$CMA //' /etc/kernel/postinst.d/z50-raspi-firmware#" | \ + sed "s#\(RASPIROOT.*cmdline.txt\)#\1\n sed -i 's/cma=64M //' /boot/firmware/cmdline.txt#" | \ sed "s/__LINUX_IMAGE__/linux-image-arm64/" | \ sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \ sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-arm64\\/broadcom\\/bcm*rpi*.dtb/" |\ diff --git a/raspi_master.yaml b/raspi_master.yaml index 9a8cb3f..5289525 100644 --- a/raspi_master.yaml +++ b/raspi_master.yaml @@ -137,14 +137,17 @@ steps: rm -rf /var/lib/apt/lists # Modify the kernel commandline we take from the firmware to boot from - # the partition labeled raspiroot instead of forcing it to mmcblk0p2 + # the partition labeled raspiroot instead of forcing it to mmcblk0p2. + # Also insert the serial console right before the root= parameter. # # 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/.dev.mmcblk0p2/LABEL=RASPIROOT/' /boot/firmware/cmdline.txt + sed -i 's/root=/console=__SERIAL_CONSOLE__ root=/' /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.