Compare commits

...

2 Commits

3 changed files with 33 additions and 10 deletions

View File

@ -41,6 +41,23 @@ RUN echo "deb https://ppa.l9o.dev/raspbian ./" | sudo tee /etc/apt/sources.list.
RUN apt-get update
RUN apt-get install -y mariner3d
# Quality of Life in the terminal
RUN apt-get install -y tmux
# Convert keymap to us
RUN sed -i 's/gb/us/' /etc/default/keyboard
# Set up wifi by getting raspberry pi os to do the shim work
# @see https://core-electronics.com.au/tutorials/raspberry-pi-zerow-headless-wifi-setup.html
RUN if [ -n "$RPI_WIFI_NETWORK" ] ; then \
cp /etc/wpasupplicant/wpa_supplicant.conf /boot/ ; \
wpa_passphrase "$RPI_WIFI_NETWORK" "$RPI_WIFI_PASSPHRASE" > /boot/wpa_supplicant.conf ; \
touch /boot/ssh ; \
fi
# Change pi user's password
RUN if [ -n "$RPI_PASSWORD" ] ; then echo "pi:${RPI_PASSWORD}" | chpasswd ; fi
# Clean-up
RUN apt-get clean

View File

@ -14,12 +14,19 @@ This particular image is principally aimed at the Raspberry Pi (512M original Re
```
# Creates root.tar.gz and boot.tar.gz
sudo ./scripts/extract_root.sh
# Export any settings (optional)
export RPI_WIFI_NETWORK=mywifi
export RPI_WIFI_PASSPHRASE=mywifi
export RPI_PASSWORD=raspberry
# Run the build
podman build --rm=false --platform linux/armv/v7 -t localhost/pileogoo .
CONTAINERID=$(podman create localhost/pileogoo /bin/bash)
podman export -o build/root.tar.gz "${CONTAINERID}"
podman export -o build/all.tar "${CONTAINERID}"
# Creates a new image from the exported copy
sudo ./scripts/extra_build.sh
sudo ./scripts/extract_build.sh
rm ./build/all.tar
```
@ -44,4 +51,3 @@ raspi1ap Raspberry Pi A+ (revision 1.1)
raspi2 Raspberry Pi 2B (revision 1.1) (alias of raspi2b)
raspi2b Raspberry Pi 2B (revision 1.1)
```

View File

@ -2,17 +2,17 @@
dd if=/dev/zero of=build/rpi.img bs=1M count=4096
# Copy the first 8k from the original rpi.img, which seems to have
# non-zeroed content
#dd if=rpi.img of=build/rpi.img bs=8192 count=1 conv=notrunc
# non-zeroed content. Without this, the Pi doesn't seem to boot.
# It could be that there is the binary boot blob for the GPU
# in that section?
dd if=rpi.img of=build/rpi.img bs=8192 count=1 conv=notrunc
sudo losetup -Pf build/rpi.img
# Partition:
# start: 8192, size 256M typ W95 FAT32
DEVICE=$(losetup -j build/rpi.img | cut -d ':' -f 1)
mkfs.msdos "${DEVICE}"
sfdisk "${DEVICE}" <<EOF
8192,256M,c
,3.5G,83
EOF
parted --script "${DEVICE}" \
rm 2 \
mkpart primary ext4 272629760B 4022337536B
mkfs.vfat "${DEVICE}p1"
mkfs.ext4 "${DEVICE}p2"
TMP=$(mktemp -d)