Skip to content

Commit b15f67d

Browse files
committed
feat: publish Imager OS list and launchers
1 parent 607bbf5 commit b15f67d

8 files changed

Lines changed: 89 additions & 6 deletions

File tree

‎.github/workflows/build-image.yml‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,33 @@ jobs:
3535
- name: Build image
3636
run: sudo -E ./build-image.sh
3737

38-
- name: Publish latest Release
38+
- name: Publish image + Imager OS list
3939
env:
4040
GH_TOKEN: ${{ github.token }}
4141
run: |
42+
set -euo pipefail
43+
. .build/image-meta.env
4244
TAG="dpea-pi-$(date +%Y%m%d-%H%M)"
43-
gh release create "$TAG" .build/*.img.xz \
45+
IMG_URL="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG}/${IMG_FILE}"
46+
# os-list.json = a Raspberry Pi Imager repo with one entry. init_format
47+
# enables the Customisation panel; the constant asset name means
48+
# .../releases/latest/download/os-list.json is a stable URL for Imager.
49+
jq -n \
50+
--arg url "$IMG_URL" \
51+
--arg date "$(date +%Y-%m-%d)" \
52+
--arg sha "$EXTRACT_SHA256" \
53+
--argjson esize "$EXTRACT_SIZE" \
54+
--argjson dsize "$IMAGE_DOWNLOAD_SIZE" \
55+
'{os_list: [ {
56+
name: "DPEA Pi",
57+
description: "DPEA exhibit base image (Raspberry Pi OS Trixie 64-bit + DPEA config)",
58+
url: $url,
59+
release_date: $date,
60+
init_format: "systemd",
61+
extract_size: $esize,
62+
extract_sha256: $sha,
63+
image_download_size: $dsize
64+
} ] }' > .build/os-list.json
65+
gh release create "$TAG" ".build/${IMG_FILE}" .build/os-list.json \
4466
--repo "$GITHUB_REPOSITORY" --title "$TAG" \
4567
--notes "Auto-built DPEA Pi image from ${GITHUB_SHA::7}" --latest

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.build/
2+
.idea/

‎README.md‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,23 @@ demand, then publishes the result as this repo's latest Release. It runs
4242
`build-image.sh`, which customizes the stock Raspberry Pi OS image: download,
4343
grow, loop-mount, run `customize.sh` in a chroot (packages, avahi, uv, config),
4444
recompress. It runs on a native arm64 runner (free while this repo is public), so
45-
the chroot's arm64 binaries run natively. No default user is baked. Set user +
46-
hostname + wifi in the Imager at flash time. Pin `BASE_URL` in `build-image.sh` to
47-
a specific Raspberry Pi OS release for reproducibility.
45+
the chroot's arm64 binaries run natively. No default user is baked. Pin `BASE_URL`
46+
in `build-image.sh` to a specific Raspberry Pi OS release for reproducibility.
47+
48+
The same job also publishes `os-list.json` (a Raspberry Pi Imager OS list) to the
49+
release, so it is served at a stable URL:
50+
`https://github.com/dpengineering/DPEA-RaspberryPiImage/releases/latest/download/os-list.json`.
51+
52+
## Flashing
53+
54+
Launch Imager pointed at that OS list so "DPEA Pi" appears with the Customisation
55+
panel enabled (hostname, SSH, user, wifi):
56+
```
57+
rpi-imager --repo https://github.com/dpengineering/DPEA-RaspberryPiImage/releases/latest/download/os-list.json
58+
```
59+
`imager-launchers/` has double-click wrappers of that command for macOS / Windows
60+
/ Linux, meant to be handed to students (e.g. from the student setup repo). The
61+
repo is public, so no GitHub account is needed to download the image.
4862

4963
## Testing
5064

@@ -78,7 +92,8 @@ you can reach `172.17.21.2`.
7892
| `provision.sh` | apply the same config to an already-running Pi (no reflash) |
7993
| `lib/common.sh` | shared shell helpers for `provision.sh` |
8094
| `hardware-smoke-test.sh` | on-Pi smoke test of the baked config |
81-
| `.github/workflows/build-image.yml` | build + publish the image |
95+
| `imager-launchers/` | double-click launchers that open Imager with the DPEA OS list |
96+
| `.github/workflows/build-image.yml` | build + publish the image + `os-list.json` |
8297
| `.github/workflows/validate.yml` | PR checks (shellcheck + container validation) |
8398

8499
The patched avahi `.deb` lives in the `avahi_0.8` repo, not here.

‎build-image.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,18 @@ rm -f "$MNT/tmp/customize.sh"
6363

6464
# --- unmount (via trap) + compress ---
6565
cleanup; trap - EXIT
66+
67+
# Record metadata for the Raspberry Pi Imager OS list (os-list.json, built by CI):
68+
# the sha256 + size are of the UNCOMPRESSED image, which Imager verifies.
69+
EXTRACT_SIZE="$(stat -c%s "$OUT_IMG")"
70+
EXTRACT_SHA256="$(sha256sum "$OUT_IMG" | awk '{print $1}')"
6671
xz -T0 -f "$OUT_IMG"
72+
{
73+
echo "IMG_FILE=$(basename "${OUT_IMG}.xz")"
74+
echo "EXTRACT_SIZE=${EXTRACT_SIZE}"
75+
echo "EXTRACT_SHA256=${EXTRACT_SHA256}"
76+
echo "IMAGE_DOWNLOAD_SIZE=$(stat -c%s "${OUT_IMG}.xz")"
77+
} > "$WORK/image-meta.env"
78+
6779
echo "Image: ${OUT_IMG}.xz"
80+
echo "Meta: $WORK/image-meta.env"

‎imager-launchers/README.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Imager launchers
2+
3+
Each launcher opens Raspberry Pi Imager preloaded with the DPEA OS list
4+
(`--repo https://github.com/dpengineering/DPEA-RaspberryPiImage/releases/latest/download/os-list.json`),
5+
so "DPEA Pi" appears in the OS list with the **Customisation** panel enabled
6+
(hostname, SSH, user, wifi). Plain "Use custom" on a local file cannot do that.
7+
8+
- `dpea-pi-imager.command` - macOS (double-click; may need `chmod +x` once, and
9+
right-click -> Open the first time to clear Gatekeeper).
10+
- `dpea-pi-imager.bat` - Windows (double-click).
11+
- `dpea-pi-imager.desktop` - Linux (mark executable / "Allow launching").
12+
13+
Requires Raspberry Pi Imager installed and internet access. No GitHub account
14+
needed (public repo). These are meant to be handed to students, e.g. from the
15+
student setup repo.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
rem Windows: double-click to launch Raspberry Pi Imager preloaded with the DPEA
3+
rem image list, so "DPEA Pi" appears with the Customisation panel enabled.
4+
start "" "%ProgramFiles%\Raspberry Pi Imager\rpi-imager.exe" --repo https://github.com/dpengineering/DPEA-RaspberryPiImage/releases/latest/download/os-list.json
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# macOS: double-click to launch Raspberry Pi Imager preloaded with the DPEA image
3+
# list, so "DPEA Pi" appears in the OS list with the Customisation panel enabled.
4+
exec "/Applications/Raspberry Pi Imager.app/Contents/MacOS/rpi-imager" \
5+
--repo https://github.com/dpengineering/DPEA-RaspberryPiImage/releases/latest/download/os-list.json
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=DPEA Pi Imager
4+
Comment=Raspberry Pi Imager preloaded with the DPEA image list
5+
Exec=rpi-imager --repo https://github.com/dpengineering/DPEA-RaspberryPiImage/releases/latest/download/os-list.json
6+
Icon=rpi-imager
7+
Terminal=false
8+
Categories=Utility;

0 commit comments

Comments
 (0)