Changeset View
Changeset View
Standalone View
Standalone View
tools/tools/nanobsd/nanobsd.sh
| Show All 30 Lines | |||||
| nanobsd_sh=`realpath $0` | nanobsd_sh=`realpath $0` | ||||
| topdir=`dirname ${nanobsd_sh}` | topdir=`dirname ${nanobsd_sh}` | ||||
| . "${topdir}/defaults.sh" | . "${topdir}/defaults.sh" | ||||
| ####################################################################### | ####################################################################### | ||||
| # Parse arguments | # Parse arguments | ||||
| do_clean=true | do_clean=true | ||||
| do_root=true | |||||
| do_kernel=true | do_kernel=true | ||||
| do_installkernel=true | do_installkernel=true | ||||
| do_world=true | do_world=true | ||||
| do_code=true | do_code=true | ||||
| do_installworld=true | do_installworld=true | ||||
| do_image=true | do_image=true | ||||
| do_native_xtools=false | do_native_xtools=false | ||||
| do_prep_image=true | do_prep_image=true | ||||
| # Pull in legacy stuff for now automatically | # Pull in legacy stuff for now automatically | ||||
| . "${topdir}/legacy.sh" | . "${topdir}/legacy.sh" | ||||
| set +e | set +e | ||||
| args=`getopt BKXWbc:fhiIknpqvw $*` | args=`getopt BKXWbc:fhiIknpqUvw $*` | ||||
| if [ $? -ne 0 ] ; then | if [ $? -ne 0 ] ; then | ||||
| usage | usage | ||||
| exit 2 | exit 2 | ||||
| fi | fi | ||||
| set -e | set -e | ||||
| set -- $args | set -- $args | ||||
| for i | for i | ||||
| ▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | do | ||||
| -q) | -q) | ||||
| PPLEVEL=$(($PPLEVEL - 1)) | PPLEVEL=$(($PPLEVEL - 1)) | ||||
| shift | shift | ||||
| ;; | ;; | ||||
| -v) | -v) | ||||
| PPLEVEL=$(($PPLEVEL + 1)) | PPLEVEL=$(($PPLEVEL + 1)) | ||||
| shift | shift | ||||
| ;; | ;; | ||||
| -U) | |||||
| do_root=false | |||||
| NANO_NOPRIV_BUILD=true | |||||
| shift | |||||
| ;; | |||||
| -w) | -w) | ||||
| do_world=false | do_world=false | ||||
| shift | shift | ||||
| ;; | ;; | ||||
| --) | --) | ||||
| shift | shift | ||||
| break | break | ||||
| esac | esac | ||||
| ▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | if $do_prep_image ; then | ||||
| prune_usr | prune_usr | ||||
| run_late_customize | run_late_customize | ||||
| fixup_before_diskimage | fixup_before_diskimage | ||||
| else | else | ||||
| pprint 2 "Skipping image prep (as instructed)" | pprint 2 "Skipping image prep (as instructed)" | ||||
| fi | fi | ||||
| if $do_code ; then | if $do_code ; then | ||||
| calculate_partitioning | calculate_partitioning | ||||
| if [ -z "${NANO_NOPRIV_BUILD}" ]; then | |||||
| create_code_slice | create_code_slice | ||||
| else | |||||
| _create_code_slice | |||||
| fi | |||||
| if $do_image ; then | if $do_image ; then | ||||
| if [ -z "${NANO_NOPRIV_BUILD}" ]; then | |||||
| create_diskimage | create_diskimage | ||||
| else | |||||
| _create_diskimage | |||||
| fi | |||||
| else | else | ||||
| pprint 2 "Skipping image build (as instructed)" | pprint 2 "Skipping image build (as instructed)" | ||||
| fi | fi | ||||
| else | else | ||||
| pprint 2 "Skipping code and image build (as instructed)" | pprint 2 "Skipping code and image build (as instructed)" | ||||
| fi | fi | ||||
| last_orders | last_orders | ||||
| pprint 1 "NanoBSD image ${NANO_NAME} completed" | pprint 1 "NanoBSD image ${NANO_NAME} completed" | ||||