omega-mission
Omega Mission: seeded-Omega mission orchestrator (hash-chained journal, tiered command checks). Host-tested; live dispatch not yet run.
Brought by drakestapleton
omega-mission / build.sh
| 1 | #!/bin/sh |
| 2 | set -eu |
| 3 | cd "$(dirname "$0")" |
| 4 | OMEGA_MV=${OMEGA_MV:-../omega-mv} |
| 5 | OMC_PIN=cfd96b48b0460ab5557853d6856f9c741b96ac8d0d624e06198defb4cbfa0d8a |
| 6 | SOURCE_PIN=6fbc6cbe4bfa4092608e2b5f06d2e8f537893992 |
| 7 | [ "$(git -C "$OMEGA_MV" rev-parse HEAD)" = "$SOURCE_PIN" ] || { echo 'wrong omega-mv source pin' >&2; exit 2; } |
| 8 | [ "$(sha256sum "$OMEGA_MV/seed/out/omc" | cut -d' ' -f1)" = "$OMC_PIN" ] || { echo 'wrong compiler pin' >&2; exit 2; } |
| 9 | mkdir -p build |
| 10 | # A failed compile must not leave an older binary or stamp behind. |
| 11 | rm -f build/mission build/mission.head |
| 12 | { printf 'om2\n'; cat sha.om mission.om journal.om; } > build/composed.om |
| 13 | "$OMEGA_MV/seed/out/omc" < build/composed.om > build/mission.new |
| 14 | chmod +x build/mission.new |
| 15 | mv build/mission.new build/mission |
| 16 | # Stamp binds the binary to a commit only when the compiled sources equal HEAD. |
| 17 | if git diff --quiet HEAD -- sha.om mission.om journal.om 2>/dev/null; then |
| 18 | git rev-parse HEAD > build/mission.head |
| 19 | else |
| 20 | echo dirty > build/mission.head |
| 21 | fi |