serialpi/README.md

931 B

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