From d9fb46386ffc57ade5e431f7741901634f4f949e Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Sat, 20 Jul 2024 14:08:20 +0200 Subject: [PATCH] Boostrap a Pi 5 recipe. For the time being, let's keep both Pi 3/Pi 4 and Pi 5 recipes separate, making it easy to modify the latter freely. Later on, it will probably make sense to have a common section. --- raspberrypi/recipes/pi5.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 raspberrypi/recipes/pi5.sh diff --git a/raspberrypi/recipes/pi5.sh b/raspberrypi/recipes/pi5.sh new file mode 100644 index 0000000..2d4d65e --- /dev/null +++ b/raspberrypi/recipes/pi5.sh @@ -0,0 +1,36 @@ +# This recipe is sourced by the toaster, don't try to run it! + +# shellcheck disable=SC2086 +toast_me() { + echo "nameserver 1.1.1.1" > $MNT/etc/resolv.conf + + # Install minimal tools + chroot $MNT apt-get update + chroot $MNT apt-get install -y wget sudo avahi-daemon + chroot $MNT apt-get clean + + # Ensure we have the pi user + chroot $MNT adduser --disabled-password --gecos '' pi + chroot $MNT adduser pi sudo + chroot $MNT adduser pi plugdev + echo "pi:raspberry" | chroot $MNT chpasswd + + # Let's make sure we don't ship any SSH host keys. Also work around upstream + # bug leading ssh.service to try and start before SSH host keys have been + # generated (https://salsa.debian.org/raspi-team/image-specs/-/issues/72): + # disable ssh.service here, and let the rpi-generate-ssh-host-keys.service + # enable+start it when everything is ready. + rm -f $MNT/etc/ssh/ssh_host_* + chroot $MNT systemctl disable ssh.service + sed '/^ExecStart=/a ExecStart=/usr/bin/systemctl enable --now ssh.service' \ + -i $MNT/etc/systemd/system/rpi-generate-ssh-host-keys.service + + # Change the hostname + echo "127.0.1.1 pirogue.local pirogue" >> $MNT/etc/hosts + echo "::1 pirogue.local pirogue" >> $MNT/etc/hosts + echo "pirogue" > $MNT/etc/hostname + + # Add PTS PPA + chroot $MNT wget -O /etc/apt/sources.list.d/pirogue.list https://pts-project.org/debian-12/pirogue.list + chroot $MNT wget -O /etc/apt/trusted.gpg.d/pirogue.asc https://pts-project.org/debian-12/Key.gpg +}