diff --git a/rpi/README.md b/rpi/README.md new file mode 100644 index 00000000..bd1e22af --- /dev/null +++ b/rpi/README.md @@ -0,0 +1,11 @@ +# Raspberry Pi Image + +This directory contains the files required to build a coatrack raspberry pi image. + +The `rpi-gen-config` directory contains the configuration that can be merged with the pi-gen directory structure to build the raspberry pi image. + +The `build.sh` script does the following: + +- start an arm64 debian image +- install dependencies for [pi-gen](https://github.com/RPI-Distro/pi-gen.git) +- use the build configuration to produce an image in the `build` directory diff --git a/rpi/build-image.sh b/rpi/build-image.sh new file mode 100755 index 00000000..b5034cf4 --- /dev/null +++ b/rpi/build-image.sh @@ -0,0 +1,11 @@ +apt-get update +apt-get install -y coreutils quilt parted qemu-user-static debootstrap zerofree zip \ + dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc \ + gpg pigz xxd arch-test kmod + +mkdir -p /build/rpi +cd /build/rpi +git clone --branch arm64 https://github.com/RPI-Distro/pi-gen.git --depth 1 +cp -r /src/rpi-gen-config/* /build/rpi/pi-gen/ +cd /build/rpi/pi-gen +./build.sh \ No newline at end of file diff --git a/rpi/build.sh b/rpi/build.sh new file mode 100755 index 00000000..87c224ab --- /dev/null +++ b/rpi/build.sh @@ -0,0 +1 @@ +docker run --privileged -v .:/src -v ./build:/out arm64v8/debian /bin/bash -c /src/build-image.sh \ No newline at end of file diff --git a/rpi/rpi-gen-config/config b/rpi/rpi-gen-config/config new file mode 100644 index 00000000..960fa35d --- /dev/null +++ b/rpi/rpi-gen-config/config @@ -0,0 +1,7 @@ +IMG_NAME="coatrack-$RELEASE-$ARCH" +PI_GEN_RELEASE="we should set this" +RELEASE="bookworm" # debian 12 +USE_QEMU=1 +TARGET_HOSTNAME="coatrack" +FIRST_USER_NAME="user" +DEPLOY_DIR=/out \ No newline at end of file diff --git a/rpi/rpi-gen-config/stage3/SKIP b/rpi/rpi-gen-config/stage3/SKIP new file mode 100644 index 00000000..e69de29b diff --git a/rpi/rpi-gen-config/stage4/SKIP b/rpi/rpi-gen-config/stage4/SKIP new file mode 100644 index 00000000..e69de29b diff --git a/rpi/rpi-gen-config/stage4/SKIP_IMAGES b/rpi/rpi-gen-config/stage4/SKIP_IMAGES new file mode 100644 index 00000000..e69de29b diff --git a/rpi/rpi-gen-config/stage5/SKIP b/rpi/rpi-gen-config/stage5/SKIP new file mode 100644 index 00000000..e69de29b diff --git a/rpi/rpi-gen-config/stage5/SKIP_IMAGES b/rpi/rpi-gen-config/stage5/SKIP_IMAGES new file mode 100644 index 00000000..e69de29b