interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / crates / aienos-artifact-tool / fixtures / p2_7 / pack.sh

30 lines · 1413 bytes Raw Blame History
1#!/usr/bin/env bash
2# Pack and sign the PI5-7 cut 3 probes with the TEST ONLY SEED-0B identity (RFC 8032 TEST 1 key, public) into
3# OUT_DIR as P27KREAD.AIEN, P27KWRITE.AIEN and P27PRIV.AIEN, and append "NAME ARTIFACT_ID" to OUT_DIR/ids.txt.
4# CODE_DIR (optional) holds <probe>/code.bin variants from assemble.sh; default: the committed Pi code.bin.
5#
6# TOOL is the in-tree ck_artifact_tool (make -C native/kernel tool) or a debug aienos-artifact-tool built with
7# --features seed0b-test-signing (release builds refuse that feature).
8set -euo pipefail
9
10here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11tool="${1:?usage: pack.sh TOOL OUT_DIR [CODE_DIR]}"
12out="${2:?usage: pack.sh TOOL OUT_DIR [CODE_DIR]}"
13codes="${3:-}"
14mkdir -p "${out}"
15touch "${out}/ids.txt"
16
17pack_one() { # probe, output name
18 local probe="$1" name="$2" code="${here}/${1}/code.bin"
19 if [[ -n "${codes}" ]]; then code="${codes}/${probe}/code.bin"; fi
20 "${tool}" pack "${here}/${probe}/manifest.json" "${code}" \
21 "${here}/${probe}/data.bin" "${out}/${probe}.unsigned.aien" >/dev/null
22 "${tool}" sign "${out}/${probe}.unsigned.aien" "${out}/${name}" >/dev/null
23 rm -f "${out}/${probe}.unsigned.aien"
24 "${tool}" verify "${out}/${name}" >/dev/null
25 echo "${name} $("${tool}" id "${out}/${name}")" >>"${out}/ids.txt"
26}
27
28pack_one p27kread P27KREAD.AIEN
29pack_one p27kwrite P27KWRITE.AIEN
30pack_one p27priv P27PRIV.AIEN