xref: /freebsd/tools/boot/lua-test.sh (revision ff8409871e8947ef61275f6024d0dc92cd485e23)
1#!/bin/sh
2# $FreeBSD$
3
4die() {
5    echo $*
6    exit 1
7}
8
9dir=$1
10cd $(make -V SRCTOP)/stand
11obj=$(make -V .OBJDIR)
12t=$obj/userboot/test/test
13u=$obj/userboot/userboot/userboot.so
14
15[ -n "$dir" ] || dir=/tmp/loadertest
16[ -d "$dir" ] || die "Directory $dir doesn't exist"
17[ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found"
18[ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load"
19[ -x "$t" ] || die "no userboot test jig found ($t)"
20[ -x "$u" ] || die "no userboot.so ($u) found"
21
22$t -h $dir -b $u
23