3 # Copyright (c) 2005 Poul-Henning Kamp.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 nanobsd_sh=`realpath $0`
33 topdir=`dirname ${nanobsd_sh}`
34 . "${topdir}/defaults.sh"
36 #######################################################################
44 do_copyout_partition=true
45 do_native_xtools=false
48 args=`getopt KXbc:fhiknqvw $*`
49 if [ $? -ne 0 ] ; then
61 do_installkernel=false
74 # Make config file path available to the config file
75 # itself so that it can access additional files relative
76 # to its own location.
83 do_copyout_partition=false
102 PPLEVEL=$(($PPLEVEL - 1))
106 PPLEVEL=$(($PPLEVEL + 1))
119 if [ $# -gt 0 ] ; then
120 echo "$0: Extraneous arguments supplied"
124 if [ ! -d "${NANO_TOOLS}" ]; then
125 echo "NANO_TOOLS directory does not exist" 1>&2
130 NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN"
133 #######################################################################
134 # And then it is as simple as that...
136 # File descriptor 3 is used for logging output, see pprint
138 set_defaults_and_export
140 pprint 1 "NanoBSD image ${NANO_NAME} build starting"
146 pprint 2 "Using existing build tree (as instructed)"
151 pprint 2 "Skipping buildworld (as instructed)"
155 if ! $do_world ; then
160 pprint 2 "Skipping buildkernel (as instructed)"
167 if $do_native_xtools ; then
171 if $do_installkernel ; then
174 pprint 2 "Skipping installkernel (as instructed)"
184 pprint 2 "Skipping image build (as instructed)"
188 pprint 1 "NanoBSD image ${NANO_NAME} completed"