Files

20 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
source "$(dirname -- "${BASH_SOURCE[0]}")/lib.sh"
[[ $# == 0 ]] || die 'Usage: tools/build-fds'
cd "$FDS_ROOT"
mkdir -p out/logs out/manifests
tools/cargo-build --locked --offline --release --target aarch64-unknown-linux-musl \
-p fds-cli -p fds-control -p fds-stage0 -p fds-boottrace -p fds-cartridged -p fds-burn -p fds-release
for binary in fds fds-control fds-program fds-stage0 fds-boottrace fds-cartridged fds-profile fds-burn fds-release; do
tools/verify-elf "target/aarch64-unknown-linux-musl/release/$binary" aarch64 static
cp "target/aarch64-unknown-linux-musl/release/$binary" "out/$binary"
done
cp out/fds out/fds-inspect
cp out/fds out/fds-eject
cp out/fds out/fds-power
sha256sum out/fds-control out/fds-program out/fds-release out/fds-burn out/fds-inspect out/fds-eject out/fds-power out/fds out/fds-stage0 out/fds-boottrace out/fds-cartridged out/fds-profile >out/manifests/fds-tools.sha256
find rust/fds-control rust/fds-software rust/fds-common rust/fds-cli rust/fds-stage0 rust/fds-boottrace rust/fds-cartridged rust/fds-burn rust/fds-release -type f -print0 | sort -z | \
xargs -0 sha256sum >out/manifests/fds-tools-inputs.sha256
sha256sum tools/version tools/fds_version.py tools/version-build.rs Cargo.toml Cargo.lock rust-toolchain.toml .cargo/config.toml tools/cargo-build tools/lib.sh tools/build-fds >>out/manifests/fds-tools-inputs.sha256
printf 'PASS: static ARM FDS CLI and stage0 tools built\n'