2018-02-14 18:51:51 +01:00
|
|
|
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
|
2018-02-16 21:26:18 +01:00
|
|
|
# Will image the test directory (default /tmp/loadertest) if it doesn't exist
|
|
|
|
|
2018-02-14 18:51:51 +01:00
|
|
|
die() {
|
|
|
|
echo $*
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
dir=$1
|
2018-02-16 21:26:18 +01:00
|
|
|
scriptdir=$(dirname $(realpath $0))
|
2018-02-14 18:51:51 +01:00
|
|
|
cd $(make -V SRCTOP)/stand
|
|
|
|
obj=$(make -V .OBJDIR)
|
|
|
|
t=$obj/userboot/test/test
|
|
|
|
u=$obj/userboot/userboot/userboot.so
|
|
|
|
|
2018-02-16 21:23:48 +01:00
|
|
|
[ -n "$dir" ] || dir=/tmp/loadertest
|
2018-02-16 21:26:18 +01:00
|
|
|
[ -d "$dir" ] || ${scriptdir}/lua-img.sh ${dir}
|
2018-02-14 18:51:51 +01:00
|
|
|
[ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found"
|
|
|
|
[ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load"
|
|
|
|
[ -x "$t" ] || die "no userboot test jig found ($t)"
|
|
|
|
[ -x "$u" ] || die "no userboot.so ($u) found"
|
|
|
|
|
|
|
|
$t -h $dir -b $u
|