#!/bin/bash set -euo pipefail source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" # omarchy-hw-platform answers with the image-target manifest while a root is # being built, and with the hardware once it boots. Each world below is what one # detector run sees: image/ is the root, proc/ its /proc (the host's device tree # and PID 1), bin/ a uname for the CPU it runs on. detector="$ROOT/bin/omarchy-hw-platform" umask 022 test_tmp=$(mktemp -d) trap 'rm -rf "$test_tmp"' EXIT apple_manifest=$'format=1\nplatform=aarch64-apple\n' # $1 world, $2 CPU, then the host's device-tree tokens (none: no device tree). world() { local dir="$test_tmp/worlds/$1" cpu=$2 shift 2 rm -rf "$dir" mkdir -p "$dir/image" "$dir/proc" "$dir/bin" "$dir/host" if (( $# )); then mkdir -p "$dir/proc/device-tree" printf '%s\0' "$@" >"$dir/proc/device-tree/compatible" fi cat >"$dir/bin/uname" <