]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/boot/lua-test.sh
Add two missing eventhandler.h headers
[FreeBSD/FreeBSD.git] / tools / boot / lua-test.sh
1 #!/bin/sh
2 # $FreeBSD$
3
4 # Will image the test directory (default /tmp/loadertest) if it doesn't exist
5
6 die() {
7     echo $*
8     exit 1
9 }
10
11 dir=$1
12 scriptdir=$(dirname $(realpath $0))
13 cd $(make -V SRCTOP)/stand
14 obj=$(make -V .OBJDIR)
15 t=$obj/userboot/test/test
16
17 [ -n "$dir" ] || dir=/tmp/loadertest
18 [ -d "$dir" ] || ${scriptdir}/lua-img.sh ${dir}
19 # We'll try userboot.so from the test directory before plucking it straight out
20 # of .OBJDIR.
21 u=$dir/boot/userboot.so
22 [ -f "$u" ] || u=$obj/userboot/userboot_lua/userboot_lua.so
23 [ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found"
24 [ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load"
25 [ -x "$t" ] || die "no userboot test jig found ($t)"
26 [ -f "$u" ] || die "no userboot.so ($u) found"
27
28 $t -h $dir -b $u