Changeset 10548 in hybrid for branches/releng-9.0/nanobsd/tools/image.sh
- Timestamp:
- Apr 22, 2012, 12:54:37 PM (13 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/releng-9.0/nanobsd/tools/image.sh
r10532 r10548 1 1 #!/bin/sh 2 # Wrapper around nanobsd.sh with autodetection of already processed steps 3 # to provide some failsafe net 4 2 # 5 3 BASEDIR=`dirname $0` 6 4 . ${BASEDIR}/package-build.inc.sh … … 8 6 NANOBSD="$NANO_SRC/tools/tools/nanobsd/nanobsd.sh" 9 7 10 FORCE_KERNEL=0 11 FORCE_WORLD=0 12 #XXX: Proper object handling 13 if [ "$1" = "-bk" ]; then 14 p_warn Forcefully building kernel 15 FORCE_KERNEL=1 16 elif [ "$1" = "-bw" ]; then 17 p_warn Forcefully building world 18 FORCE_WORLD=1 19 elif [ "$1" = "-f" ]; then 20 p_warn Forcefully building world and kernel 21 FORCE_KERNEL=1 22 FORCE_WORLD=1 8 usage() { 9 cat <<EOF 10 # Usage $0 <arguments>" 11 # 12 # Wrapper around nanobsd.sh with autodetection of already processed steps to 13 # provide some failsafe net, which avoids building world and/or kernel by 14 # default. 15 # 16 # Rick van der Zwet <rick@wirelessleiden.nl> 17 # 18 # Arguments: 19 # build - Build NanoBSD parts which are not build yet 20 # build force kernel - Build NanoBSD and force rebuilding the kernel 21 # build force world - Build NanoBSD and force rebuilding world 22 # rebuild - Rebuild NanoBSD (aka force rebuilding all) 23 EOF 24 } 25 26 FORCE_KERNEL=${FORCE_KERNEL:-"no"} 27 FORCE_WORLD=${FORCE_WORLD:-"no"} 28 29 if [ -z "$1" ]; then 30 usage; exit 1 31 elif [ "$1" = "build" ]; then 32 if [ -z "$2" ]; then 33 elif [ "$2" = "force" ]; then 34 if [ "$3" = "kernel" ]; then 35 FORCE_KERNEL="yes" 36 elif [ "$3" = "world" ]; then 37 FORCE_WORLD="yes" 38 else 39 echo "Argument Error - '$3'"; exit 128 40 fi 41 else 42 echo "Argument Error - '$2'"; exit 128 43 fi 44 elif [ "$1" = "rebuild" ]; then 45 FORCE_KERNEL="yes" 46 FORCE_WORLD="yes" 47 else 48 echo "Argument Error - '$1'"; exit 128 23 49 fi 24 shift 25 NANOBSD_EXTRA=$* 50 51 p_info Forcefully building kernel: $FORCE_KERNEL 52 p_info Forcefully building world : $FORCE_WORLD 53 54 NANOBSD_EXTRA=${NANOBSD_EXTRA:-''} 26 55 27 56 if [ ! -r "${NANOBSD}" ]; then … … 42 71 # Detect succesfull buildworld 43 72 tail -10 ${OBJDIR}/_.bw | grep 'World build completed' 44 if [ $? -eq 0 -a ${FORCE_WORLD} -eq 0]; then45 p_info NO building of world , use $0 -f to force73 if [ $? -eq 0 -a ${FORCE_WORLD} = "no" ]; then 74 p_info NO building of world 46 75 NANOBSD_FLAGS="${NANOBSD_FLAGS} -w" 47 76 fi … … 49 78 # Detect succesfull buildkernel 50 79 tail -10 ${OBJDIR}/_.bk | grep 'Kernel build for .* completed' 51 if [ $? -eq 0 -a ${FORCE_KERNEL} -eq 0]; then52 p_info NO building of kernel , use $0 -f to force80 if [ $? -eq 0 -a ${FORCE_KERNEL} = "no" ]; then 81 p_info NO building of kernel 53 82 NANOBSD_FLAGS="${NANOBSD_FLAGS} -k" 54 83 fi
Note:
See TracChangeset
for help on using the changeset viewer.