bootstrap.sh (1264B)
1 #!/bin/sh 2 ## bootstrap.sh — bring up M0/hex2-0/catm from a 400-byte hex0-seed. 3 ## 4 ## Runs inside a target-arch busybox container. All produced binaries are 5 ## target-arch Linux ELF and land in $OUT as: hex0 hex1 hex2-0 catm M0. 6 ## 7 ## Phase map (stage0-posix mescc-tools-{seed,mini}-kaem.kaem phases 0-3): 8 ## 0) hex0-seed + hex0.hex0 -> hex0 9 ## 1) hex0 + hex1.hex0 -> hex1 10 ## 2) hex1 + hex2.hex1 -> hex2-0 11 ## 2b) hex2-0 + catm.hex2 -> catm 12 ## 3a) catm : ELF.hex2 + M0.hex2 -> M0.combined.hex2 13 ## 3b) hex2-0 : M0.combined.hex2 -> M0 14 ## 15 ## Inputs are read from vendor/seed/<arch>/ (vendored upstream). 16 ## 17 ## Usage: bootstrap.sh <arch> <out-dir> 18 ## arch: aarch64 | amd64 | riscv64 19 ## out-dir: path (relative to /work) where tool binaries should land 20 21 set -eu 22 23 ARCH=$1 24 OUT=$2 25 26 case "$ARCH" in 27 aarch64|amd64|riscv64) ;; 28 *) echo "bootstrap.sh: unsupported arch '$ARCH'" >&2 ; exit 1 ;; 29 esac 30 31 S=vendor/seed/$ARCH 32 mkdir -p "$OUT" 33 34 "$S/hex0-seed" "$S/hex0.hex0" "$OUT/hex0" 35 "$OUT/hex0" "$S/hex1.hex0" "$OUT/hex1" 36 "$OUT/hex1" "$S/hex2.hex1" "$OUT/hex2-0" 37 "$OUT/hex2-0" "$S/catm.hex2" "$OUT/catm" 38 "$OUT/catm" "$OUT/M0.combined.hex2" "$S/ELF.hex2" "$S/M0.hex2" 39 "$OUT/hex2-0" "$OUT/M0.combined.hex2" "$OUT/M0"