2022-09-20 16:22:37 +02:00
|
|
|
set -e
|
2022-09-23 18:21:43 +02:00
|
|
|
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build '<liminix>' -I liminix-config=./configuration.nix --arg device "import <liminix/devices/$DEVICE.nix>" -A outputs.squashfs -o smoke.img $*
|
2022-09-20 16:22:37 +02:00
|
|
|
|
|
|
|
TESTS=$(cat <<"EOF"
|
2022-09-24 22:13:15 +02:00
|
|
|
test -n "${TMPDIR}"
|
2022-09-20 16:22:37 +02:00
|
|
|
dest_path=${TMPDIR}/smoke.img-$$
|
|
|
|
echo $dest_path
|
2022-09-24 22:13:15 +02:00
|
|
|
cleanup(){ test -n ${dest_path} && test -d ${dest_path} && chmod -R +w ${dest_path} && rm -rf ${dest_path}; }
|
|
|
|
trap cleanup EXIT
|
|
|
|
trap 'echo "command $(eval echo $BASH_COMMAND) failed with exit code $?"; exit $?' ERR
|
2022-09-23 18:21:43 +02:00
|
|
|
unsquashfs -q -d $dest_path -excludes smoke.img /dev
|
2022-09-20 16:22:37 +02:00
|
|
|
cd $dest_path;
|
2022-09-23 18:21:43 +02:00
|
|
|
db=nix/store/*-s6-rc-db/compiled/
|
2022-09-20 16:22:37 +02:00
|
|
|
test -d $db
|
|
|
|
chmod -R +w $db
|
|
|
|
# check we have closure of config.services (lo.link.service exists only
|
|
|
|
# as a dependency)
|
|
|
|
test "$(s6-rc-db -c $db type lo.link.service)" = "oneshot"
|
2022-09-20 16:46:03 +02:00
|
|
|
test "$(s6-rc-db -c $db type ntp.service)" = "longrun"
|
2022-09-20 16:22:37 +02:00
|
|
|
echo OK
|
|
|
|
EOF
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
nix-shell -p s6-rc -p squashfsTools --run "$TESTS" || exit 1
|