diff options
| author | Hibby <hibby@Hibbys-MacBook-Air.local> | 2026-04-26 10:46:56 -0500 |
|---|---|---|
| committer | Hibby <hibby@Hibbys-MacBook-Air.local> | 2026-04-26 10:46:56 -0500 |
| commit | 32906c9ad15c5e60e413deff1a5d5892c735871b (patch) | |
| tree | 76b0d8da787d00f75899a63c11400d5c6b686848 | |
| parent | eec33b38dd978522a5b87945f1d09100dbaa2061 (diff) | |
Add readme so I don't forget how to use it
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | README.md | 23 | ||||
| -rwxr-xr-x | build-arm64.sh | 22 |
3 files changed, 47 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3463d13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +pi-gen/ +*.log +output/ +work/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb8fc2d --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# Hibbian Builder + +Build automation for Hibbian weekly downloads. + +This repository handles: + +- `build.sh`: builds the amd64 live ISO from `hibbian-livedisk`, updates release metadata, regenerates the download HTML, and syncs output to `download.hibbian.org`. +- `build-arm64.sh`: builds the arm64 Raspberry Pi image with `pi-gen`, transfers it to the main build host, and triggers remote packaging plus HTML/stat regeneration. +- `build-helpers.sh`: shared helper functions for release notes, checksums, package diffs, build stats, and `index.html` generation. + +Generated build output is published under `/opt/livebuild/output`, with separate `amd64/` and `arm64/` directories plus the generated `index.html` used by `download.hibbian.org`. + +## Cron + +Install with `crontab -e` on the relevant build hosts. + +```cron +# Build arm64 at midnight every Monday +0 0 * * 1 /opt/livebuild/build-arm64.sh + +# Build amd64 at 00:15 every Monday +15 0 * * 1 /opt/livebuild/build.sh +``` diff --git a/build-arm64.sh b/build-arm64.sh index 7aa93c7..c437b3f 100755 --- a/build-arm64.sh +++ b/build-arm64.sh @@ -4,7 +4,10 @@ set -euo pipefail # ----------------------------- # Config # ----------------------------- -BUILD_DIR="$PWD/pi-gen/deploy" +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +PI_GEN_REPO="https://git.hibbian.org/Hibbian/pi-gen.git" +PI_GEN_DIR="$SCRIPT_DIR/pi-gen" +BUILD_DIR="$PI_GEN_DIR/deploy" REMOTE="live-build@builder.hibbian.org" REMOTE_DIR="/opt/livebuild/output/arm64" @@ -15,6 +18,20 @@ ZIP_NAME="${TODAY}-Hibbian-arm64.img.zip" # ----------------------------- # Helpers # ----------------------------- +ensure_pi_gen() { + if [[ -d "$PI_GEN_DIR/.git" ]]; then + return 0 + fi + + if [[ -e "$PI_GEN_DIR" ]]; then + echo "ERROR: $PI_GEN_DIR exists but is not a git repository" + exit 1 + fi + + echo "pi-gen not found — cloning $PI_GEN_REPO..." + git clone "$PI_GEN_REPO" "$PI_GEN_DIR" +} + has_today_local() { for f in "$BUILD_DIR"/"$IMG_NAME"; do [[ -e "$f" && -s "$f" ]] && return 0 @@ -56,11 +73,12 @@ if has_today_local; then IMG_FILE="$(get_local_img)" else echo "No local image — running pi-gen..." + ensure_pi_gen # ---- RUN YOUR PI-GEN BUILD HERE ---- # Adjust this to your actual invocation - pushd "$PWD/pi-gen" >/dev/null + pushd "$PI_GEN_DIR" >/dev/null sudo CLEAN=1 ./build.sh popd >/dev/null sudo chown -R "$USER:$USER" "$BUILD_DIR" |
