Go to file
Dustin 05577b5c91 Initial commit 2024-01-25 07:47:14 -06:00
.gitignore Initial commit 2024-01-25 07:47:14 -06:00
README.md Initial commit 2024-01-25 07:47:14 -06:00
chrony-wait.service Initial commit 2024-01-25 07:47:14 -06:00
customize.guestfish Initial commit 2024-01-25 07:47:14 -06:00
dch-firstboot.service Initial commit 2024-01-25 07:47:14 -06:00
dch-firstboot.sh Initial commit 2024-01-25 07:47:14 -06:00
dch.repo Initial commit 2024-01-25 07:47:14 -06:00
serialpi.preset Initial commit 2024-01-25 07:47:14 -06:00
ssh-host-certificate.conf Initial commit 2024-01-25 07:47:14 -06:00

README.md

Serial Pi

Download and extract Fedora Minimal image:

curl -fLO 'https://dl.fedoraproject.org/pub/fedora-secondary/releases/39/Spins/aarch64/images/Fedora-Minimal-39-1.5.aarch64.raw.xz'
unxz Fedora-Minimal-39-1.5.aarch64.raw.xz

Resize the disk to match the SD card:

truncate -s $((31291392 * 512)) serialpi.img
virt-resize --expand /dev/sda3 --no-expand-content Fedora-Minimal-39-1.5.aarch64.raw serialpi.img

The --no-expand-content argument is necessary because otherwise, virt-resize fails with an error, as the ext4 filesystem in the image uses features it does not support.

Populate authorized_keys:

cp ~/.ssh/id_ed25519_sk.pub authorized_keys

Customize with guestfish:

guestfish -a serialpi.img -f customize.guestfish

Write image to SD card:

pv serialpi.img | dd of=/dev/disk/by-id/usb-Generic_STORAGE_DEVICE_000000001206-0:0 bs=1M oflag=sync conv=sparse