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