2024-07-20 07:52:53 +02:00
|
|
|
# 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
|
2024-07-20 14:35:44 +02:00
|
|
|
|
2024-07-20 07:52:53 +02:00
|
|
|
# Install minimal tools
|
|
|
|
chroot $MNT apt-get update
|
|
|
|
chroot $MNT apt-get install -y wget sudo avahi-daemon
|
|
|
|
chroot $MNT apt-get clean
|
2024-07-20 14:35:44 +02:00
|
|
|
|
2024-07-20 07:52:53 +02:00
|
|
|
# Ensure we have the pi user
|
2024-07-20 08:15:19 +02:00
|
|
|
chroot $MNT adduser --disabled-password --gecos '' pi
|
|
|
|
chroot $MNT adduser pi sudo
|
|
|
|
chroot $MNT adduser pi plugdev
|
2024-07-20 07:52:53 +02:00
|
|
|
echo "pi:raspberry" | chroot $MNT chpasswd
|
2024-07-20 14:35:44 +02:00
|
|
|
|
2024-07-20 13:36:46 +02:00
|
|
|
# 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.
|
2024-07-20 07:52:53 +02:00
|
|
|
rm -f $MNT/etc/ssh/ssh_host_*
|
2024-07-20 13:36:46 +02:00
|
|
|
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
|
2024-07-20 14:35:44 +02:00
|
|
|
|
2024-07-20 07:52:53 +02:00
|
|
|
# Change the hostname
|
2024-07-20 08:08:40 +02:00
|
|
|
echo "127.0.1.1 pirogue.local pirogue" >> $MNT/etc/hosts
|
|
|
|
echo "::1 pirogue.local pirogue" >> $MNT/etc/hosts
|
2024-07-20 07:52:53 +02:00
|
|
|
echo "pirogue" > $MNT/etc/hostname
|
2024-07-20 14:35:44 +02:00
|
|
|
|
2024-07-20 07:52:53 +02:00
|
|
|
# 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
|
|
|
|
}
|