interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / tools / capreg / gate.sh

18 lines · 760 bytes Raw Blame History
1#!/bin/sh
2# Bootstrap trust boundary, as in #319's tools/zero-legacy/gate.sh: authenticate AIEN_OMC against
3# ../zero-legacy/omega.pin before executing it. Judgments remain in gate.om; the compiler cannot
4# authenticate itself.
5set -eu
6cd "$(dirname "$0")"
7not_run() { echo "gate.sh: AIEN_OMC is unavailable or not independently pinned (NOT_RUN)" >&2; exit 3; }
8[ -n "${AIEN_OMC:-}" ] && [ -x "$AIEN_OMC" ] || not_run
9want=$(sed -n 's/^omc_sha256: //p' ../zero-legacy/omega.pin) || not_run
10[ "${#want}" -eq 64 ] || not_run
11case "$want" in *[!0-9a-f]*) not_run ;; esac
12have=$(sha256sum -- "$AIEN_OMC") || not_run
13have=${have%% *}
14[ "$have" = "$want" ] || not_run
15mkdir -p build
16"$AIEN_OMC" < gate.om > build/gate
17chmod +x build/gate
18exec build/gate "$AIEN_OMC"