summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyril Brulebois <cyril@debamax.com>2021-11-20 13:43:53 +0100
committerCyril Brulebois <cyril@debamax.com>2021-11-20 13:43:53 +0100
commitcba96ddb169eab19713495f15c0fd6a9b75adc6d (patch)
tree42ebc33aec55641e171fc2f19eba67f8da08eb16
parent68ebe5c3858d02b5b7b0de60ad56b29481484ca7 (diff)
parent6251ebfbe0808d5c792f12891f7d4f961cd6da8e (diff)
Merge branch 'boot-consistency'
-rw-r--r--Makefile4
-rw-r--r--raspi_master.yaml11
2 files changed, 9 insertions, 6 deletions
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.