xref: /freebsd/tools/boot/lua-img.sh (revision b51f459a2098622c31ed54f5c1bf0e03efce403b)
1#!/bin/sh
2# $FreeBSD$
3
4# Quick script to build a suitable /boot dir somewhere in the tree for testing.
5# dir may be passed in, will default to /tmp/loadertest if not specified
6
7die() {
8    echo $*
9    exit 1
10}
11
12dir=$1
13cd $(make -V SRCTOP)
14
15[ -n "$dir" ] || dir=/tmp/loadertest
16
17set -e
18
19rm -rf ${dir}
20mkdir -p ${dir}
21mtree -deUW -f etc/mtree/BSD.root.dist -p ${dir}
22mtree -deUW -f etc/mtree/BSD.usr.dist -p ${dir}/usr
23cd stand
24make -j4 all install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes
25mkdir -p ${dir}/boot/kernel
26cp /boot/kernel/kernel ${dir}/boot/kernel
27