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