liminix-fork/tests/kernel/run.sh
Daniel Barlow 77922c875b add per-device overlay
presently this is used to reference the appropriate kernel and (if
needed) openwrt source trees, but I would not be surprised if we find
other uses
2022-10-15 18:55:33 +01:00

13 lines
453 B
Bash
Executable file

set -e
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build '<liminix>' -I liminix-config=../smoke/configuration.nix --arg device "import <liminix/devices/$DEVICE>" -A outputs.kernel.vmlinux -o vmlinux $*
TESTS=$(cat <<"EOF"
trap 'echo "command $(eval echo $BASH_COMMAND) failed with exit code $?"; exit 1' ERR
test -f vmlinux
file -L vmlinux | grep ' ELF 32-bit MSB executable, MIPS'
EOF
)
nix-shell -p s6-rc -p squashfsTools --run "$TESTS" || exit 1