Compare commits

...

3 Commits

Author SHA1 Message Date
U039b
48b736f8ad Switch to the workshop PPA and disable the build of the image for Pi5 2024-08-22 17:21:14 +02:00
Cyril Brulebois
919128f51a Add script to set hostname and SSID after preparing an SD card.
Example usage, after dd-ing to /dev/sdb:

    ./number /dev/sdb 42

WARNING: Make sure you get the right device: no checks, no prompts!
2024-08-22 17:21:14 +02:00
Cyril Brulebois
c748d2d399 Update and provision cache.
Also resize the image (and root filesystem) to ensure enough space is
available.
2024-08-22 17:18:21 +02:00
4 changed files with 48 additions and 9 deletions

View File

@ -13,8 +13,8 @@ RASPBERRYPI_SHA_URL="$RASPBERRYPI_IMG_URL.sha256"
RASPBERRYPI_IMG=raspi_4_bookworm.img
# Basename for the target images:
PIROGUE34_IMG="PiRogue-OS-12-Pi3_and_Pi4-$NOW.img"
PIROGUE5E_IMG="PiRogue-OS-12-Pi5-Experimental-$NOW.img"
PIROGUE34_IMG="PiRogue-OS-12-Pi3_and_Pi4-$NOW-workshop.img"
PIROGUE5E_IMG="PiRogue-OS-12-Pi5-Experimental-$NOW-workshop.img"
# List of things we produce:
MANIFEST=$(realpath MANIFEST.txt)
@ -79,9 +79,9 @@ rm -f "$MANIFEST"
# Modify, compress, and checksum:
sudo ./toaster $RASPBERRYPI_IMG.xz "$PIROGUE34_IMG" recipes/pi3-pi4.sh
sudo ./toaster $RASPBERRYPI_IMG.xz "$PIROGUE5E_IMG" recipes/pi5.sh
# sudo ./toaster $RASPBERRYPI_IMG.xz "$PIROGUE5E_IMG" recipes/pi5.sh
xz_compress "$PIROGUE34_IMG"
xz_compress "$PIROGUE5E_IMG"
# xz_compress "$PIROGUE5E_IMG"
checksum_and_publish "$PIROGUE34_IMG.xz"
checksum_and_publish "$PIROGUE5E_IMG.xz"
# checksum_and_publish "$PIROGUE5E_IMG.xz"
)

23
number Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
#
# Tweak hostname and SSID
set -e
DEV="$1"
N="$2"
if [ -z "$DEV" ] || [ -z "$N" ]; then
echo "E: $0 /dev/sd-card number"
exit 1
fi
MNT=/mnt
sudo mount ${DEV}2 $MNT
sudo sed "s/pirogue/pirogue-$N/" -i $MNT/etc/hostname
sudo sed "s/pirogue/pirogue-$N/g" -i $MNT/etc/hosts
sudo mkdir -p $MNT/var/lib/pirogue/config/
echo "WIFI_NETWORK_NAME=PiRogue$N" | sudo tee -a $MNT/var/lib/pirogue/config/pirogue.user.env
sudo umount $MNT

View File

@ -1,5 +1,9 @@
# This recipe is sourced by the toaster, don't try to run it!
resize_me() {
echo "2000"
}
# shellcheck disable=SC2086
toast_me() {
echo "nameserver 1.1.1.1" > $MNT/etc/resolv.conf
@ -31,10 +35,14 @@ toast_me() {
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.gpg https://pts-project.org/debian-12/pirogue.gpg
chroot $MNT wget -O /etc/apt/sources.list.d/pirogue.list https://pts-project.org/debian-12-workshop/pirogue.list
chroot $MNT wget -O /etc/apt/trusted.gpg.d/pirogue.asc https://pts-project.org/debian-12-workshop/Key.gpg
# Make initial installation easier on users:
install -m 755 -o root -g root files/avoid-debconf-prompts $MNT/root/avoid-debconf-prompts
chroot $MNT /root/avoid-debconf-prompts && rm -f $MNT/root/avoid-debconf-prompts
# Update and provision cache
chroot $MNT apt-get update
chroot $MNT apt-get install -y pirogue-base --download-only
}

View File

@ -1,5 +1,9 @@
# This recipe is sourced by the toaster, don't try to run it!
resize_me() {
echo "2000"
}
# shellcheck disable=SC2086
toast_me() {
echo "nameserver 1.1.1.1" > $MNT/etc/resolv.conf
@ -31,8 +35,8 @@ toast_me() {
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.gpg https://pts-project.org/debian-12/pirogue.gpg
chroot $MNT wget -O /etc/apt/sources.list.d/pirogue.list https://pts-project.org/debian-12-workshop/pirogue.list
chroot $MNT wget -O /etc/apt/trusted.gpg.d/pirogue.asc https://pts-project.org/debian-12-workshop/Key.gpg
# Make initial installation easier on users:
install -m 755 -o root -g root files/avoid-debconf-prompts $MNT/root/avoid-debconf-prompts
@ -70,4 +74,8 @@ toast_me() {
rm -f $MNT/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs
### END: Pi 5 section
# Update and provision cache
chroot $MNT apt-get update
chroot $MNT apt-get install -y pirogue-base --download-only
}