Modern Apps git

← MAOS.git

maos: hardcode tree+bucket, build number tracks tag, device/tag/channel as CLI flags

Commit
550b494934c9215de5f0d62bf0ac73f8f9310b4f
Author
Vayun Mathur <[email protected]>
When
2026-08-09 17:34 UTC (3 months ago)
Parents
c0e9854

Diff

build-maos.sh
diff --git a/build-maos.sh b/build-maos.shindex 03a0685..8693a7e 100755--- a/build-maos.sh+++ b/build-maos.sh@@ -8,9 +8,15 @@ # # It is phase-based and resumable — rerun a phase or the whole thing safely. #-#   ./build-maos.sh all              # deps → sync → vendor → overlay → keys → build → release → publish-#   ./build-maos.sh sync             # just one phase-#   ./build-maos.sh build release    # a few phases in order+#   ./build-maos.sh all                         # full pipeline+#   ./build-maos.sh sync                         # just one phase+#   ./build-maos.sh -d panther -t 2026080500 all # override device/tag via flags+#+# Usage: ./build-maos.sh [-d DEVICE] [-t TAG] [-c CHANNEL] <phase...>+#   -d DEVICE    Pixel codename / build target   (default: cheetah)+#   -t TAG       GrapheneOS base tag             (default: 2026080500)+#   -c CHANNEL   OTA channel to publish          (default: stable; stable|beta|testing)+#   phases: deps sync vendor overlay keys build release publish all # # ── Signing keys ──────────────────────────────────────────────────────────────────────── # Keys live in ONE encrypted file ($MAOS_KEYS_FILE), unlocked with a passphrase you pass in@@ -24,34 +30,46 @@ # For publishing: #   R2_ACCOUNT_ID, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY   Cloudflare R2 creds #-# ── Optional environment (with defaults) ────────────────────────────────────────────────-#   DEVICE=cheetah                 Pixel codename / build target-#   TAG=2026080500                 GrapheneOS base tag-#   BUILD=<YYYYMMDD00>             build number for this release-#   TREE=$HOME/maos                AOSP checkout dir (must be ext4, NOT /mnt/c)+# ── Optional environment ──────────────────────────────────────────────────────────────── #   MAOS_KEYS_FILE=$HOME/maos-keys/$DEVICE.keys.tar.gz.enc   encrypted key blob (outside the tree) #   MODERN_APPS_SRC=<path>         Modern-Apps checkout/dir with release APKs; if unset, the 9 #                                  APKs are downloaded from the Modern-Apps GitHub release-#   R2_BUCKET=maos-ota             R2 bucket name-#   OTA_CHANNEL=stable             channel metadata to publish (stable|beta|testing)-#   MANIFEST_URL=https://github.com/GrapheneOS/platform_manifest.git+#+# ── Hardcoded ─────────────────────────────────────────────────────────────────────────────+#   TREE=$HOME/maos (ext4 checkout)   R2_BUCKET=maos   BUILD=<tag> (matches the GrapheneOS tag) # set -euo pipefail -# ---- Config -----DEVICE="${DEVICE:-cheetah}"-TAG="${TAG:-2026080500}"-BUILD="${BUILD:-$(date +%Y%m%d)00}"-TREE="${TREE:-$HOME/maos}"-MAOS_KEYS_FILE="${MAOS_KEYS_FILE:-$HOME/maos-keys/$DEVICE.keys.tar.gz.enc}"-MODERN_APPS_SRC="${MODERN_APPS_SRC:-}"-R2_BUCKET="${R2_BUCKET:-maos-ota}"-OTA_CHANNEL="${OTA_CHANNEL:-stable}"-MANIFEST_URL="${MANIFEST_URL:-https://github.com/GrapheneOS/platform_manifest.git}"+# ---- Parameters (flags) ----+DEVICE="cheetah"+TAG="2026080500"+OTA_CHANNEL="stable"+while getopts "d:t:c:h" _opt; do+    case "$_opt" in+        d) DEVICE="$OPTARG" ;;+        t) TAG="$OPTARG" ;;+        c) OTA_CHANNEL="$OPTARG" ;;+        h) sed -n '2,15p' "$0"; exit 0 ;;+        *) echo "usage: $0 [-d DEVICE] [-t TAG] [-c CHANNEL] <phase...>" >&2; exit 2 ;;+    esac+done+shift $((OPTIND - 1))++# ---- Hardcoded config ----+TREE="$HOME/maos"                              # AOSP checkout (ext4; never /mnt/c)+R2_BUCKET="maos"                               # R2 bucket / ota.ma.vayunmathur.com+# The release build number always matches the GrapheneOS base tag (their tags are the build+# numbers), so OTA/version identity lines up with the upstream release.+BUILD="$TAG"+MANIFEST_URL="https://github.com/GrapheneOS/platform_manifest.git" MAOS_GH="https://github.com/vayun-mathur/"     # overlay repo remote (for the local manifest) MODERN_APPS_GH="vayun-mathur/Modern-Apps"      # source of the prebuilt APKs APPS=(web camera pdf contacts calculator clock files photos appstore) +# ---- Derived / optional-env config ----+MAOS_KEYS_FILE="${MAOS_KEYS_FILE:-$HOME/maos-keys/$DEVICE.keys.tar.gz.enc}"+MODERN_APPS_SRC="${MODERN_APPS_SRC:-}"+ # Plaintext keys are only ever materialized here (RAM-backed), and shredded on exit. KEYS_PLAIN="/dev/shm/maos-keys-$DEVICE" @@ -279,7 +297,7 @@ run_phase() {     esac } -[[ $# -gt 0 ]] || { echo "usage: $0 <phase...>   (phases: deps sync vendor overlay keys build release publish all)"; exit 2; }-log "MAOS build — device=$DEVICE tag=$TAG build=$BUILD tree=$TREE"+[[ $# -gt 0 ]] || { echo "usage: $0 [-d DEVICE] [-t TAG] [-c CHANNEL] <phase...>   (phases: deps sync vendor overlay keys build release publish all)"; exit 2; }+log "MAOS build — device=$DEVICE tag=$TAG build=$BUILD channel=$OTA_CHANNEL tree=$TREE bucket=$R2_BUCKET" for p in "$@"; do run_phase "$p"; done log "All requested phases complete."
docs/BUILD_RUNBOOK.md
diff --git a/docs/BUILD_RUNBOOK.md b/docs/BUILD_RUNBOOK.mdindex 9ab9b20..d9f29a1 100644--- a/docs/BUILD_RUNBOOK.md+++ b/docs/BUILD_RUNBOOK.md@@ -95,21 +95,19 @@ export R2_ACCESS_KEY_ID='<r2 token key id>' export R2_SECRET_ACCESS_KEY='<r2 token secret>' ``` -Optional overrides (sensible defaults shown):+Optional:  ```bash-export DEVICE=cheetah                 # build target-export TAG=2026080500                 # GrapheneOS base tag-export BUILD=$(date +%Y%m%d)00        # this release's build number-export TREE=$HOME/maos                # AOSP checkout (ext4)-export R2_BUCKET=maos-ota-export OTA_CHANNEL=stable # export MODERN_APPS_SRC=/path/to/Modern-Apps   # else the 9 APKs are downloaded from GitHub ``` -The keystore itself is written to `~/maos-keys/cheetah.keys.tar.gz.enc` (encrypted with-your passphrase). **Back that file up and keep the passphrase safe** — losing either-permanently breaks OTA/verified boot for every installed device.+Device, tag, and OTA channel are **command-line flags** on the script (not env vars),+defaulting to `cheetah` / `2026080500` / `stable`. The AOSP checkout (`~/maos`), the R2+bucket (`maos`), and the release build number (always the GrapheneOS tag) are fixed.++The keystore is written to `~/maos-keys/<device>.keys.tar.gz.enc` (encrypted with your+passphrase). **Back that file up and keep the passphrase safe** — losing either permanently+breaks OTA/verified boot for every installed device.  --- @@ -119,7 +117,9 @@ Run the pipeline. The first run generates the signing keys and encrypts them int keystore automatically (the `keys` phase), then builds, signs, and publishes:  ```bash-~/MAOS/build-maos.sh all+~/MAOS/build-maos.sh all                       # Pixel 7 Pro (cheetah), tag 2026080500+# other devices/tags/channels via flags:+# ~/MAOS/build-maos.sh -d panther -t 2026080500 -c beta all ```  Phases run in order: `deps → sync → vendor → overlay → keys → build → release → publish`.
installer/prepare-factory.sh
diff --git a/installer/prepare-factory.sh b/installer/prepare-factory.shindex 2f53018..3e656ae 100755--- a/installer/prepare-factory.sh+++ b/installer/prepare-factory.sh@@ -27,7 +27,7 @@ set -euo pipefail  HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" DEVICE="" ; BUILD="" ; FACTORY="" ; PLAN="" ; MAXB=$((100 * 1024 * 1024))-OUTDIR="out/maos-factory" ; BUCKET="${R2_BUCKET:-maos-ota}" ; UPLOAD=1+OUTDIR="out/maos-factory" ; BUCKET="${R2_BUCKET:-maos}" ; UPLOAD=1  usage() { sed -n '2,30p' "$0" >&2; exit 2; } 
ota/publish-ota.sh
diff --git a/ota/publish-ota.sh b/ota/publish-ota.shindex 21d24a0..8af7efd 100755--- a/ota/publish-ota.sh+++ b/ota/publish-ota.sh@@ -18,19 +18,19 @@ #   R2_SECRET_ACCESS_KEY   R2 API token secret #   R2_ACCOUNT_ID          Cloudflare account id (used to build the endpoint), OR #   R2_ENDPOINT            full endpoint URL (overrides R2_ACCOUNT_ID)-#   R2_BUCKET              bucket name (default: maos-ota, or pass -b)+#   R2_BUCKET              bucket name (default: maos, or pass -b) # # Requires: awscli v2. # set -euo pipefail -BUCKET="${R2_BUCKET:-maos-ota}"+BUCKET="${R2_BUCKET:-maos}" OUTDIR="out/maos-ota"  usage() {     cat >&2 <<EOF usage: publish-ota.sh [-b BUCKET] [-O OUTDIR]-  -b BUCKET   R2 bucket name (default: \$R2_BUCKET or maos-ota)+  -b BUCKET   R2 bucket name (default: $R2_BUCKET or maos)   -O OUTDIR   dir containing the artifacts from build-ota.sh (default: out/maos-ota)  Required env: R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, and either R2_ACCOUNT_ID or