From c2c06cfaa98766fff8fef02b1f4c74aa0fccf373 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 7 Feb 2016 16:44:06 +0000 Subject: [PATCH] Use NANO_LOG instead of NANO_OBJ for log file locations. Have it default to NANO_OBJ. --- tools/tools/nanobsd/defaults.sh | 46 +++++++++++++++++---------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index a0e6be580b9b..9a5c5cbe3608 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -356,7 +356,7 @@ clean_world ( ) ( rm -r ${NANO_OBJ}/ fi mkdir -p "${NANO_OBJ}" "${NANO_WORLDDIR}" - printenv > ${NANO_OBJ}/_.env + printenv > ${NANO_LOG}/_.env else pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" if ! rm -rf "${NANO_WORLDDIR}/" > /dev/null 2>&1 ; then @@ -385,7 +385,7 @@ make_conf_install ( ) ( install_world ( ) ( pprint 2 "installworld" - pprint 3 "log: ${NANO_OBJ}/_.iw" + pprint 3 "log: ${NANO_LOG}/_.iw" ( nano_make_install_env @@ -393,13 +393,13 @@ install_world ( ) ( cd "${NANO_SRC}" ${NANO_MAKE} installworld DESTDIR="${NANO_WORLDDIR}" chflags -R noschg "${NANO_WORLDDIR}" - ) > ${NANO_OBJ}/_.iw 2>&1 + ) > ${NANO_LOG}/_.iw 2>&1 ) install_etc ( ) ( pprint 2 "install /etc" - pprint 3 "log: ${NANO_OBJ}/_.etc" + pprint 3 "log: ${NANO_LOG}/_.etc" ( nano_make_install_env @@ -409,14 +409,14 @@ install_etc ( ) ( # make.conf doesn't get created by default, but some ports need it # so they can spam it. cp /dev/null "${NANO_WORLDDIR}"/etc/make.conf - ) > ${NANO_OBJ}/_.etc 2>&1 + ) > ${NANO_LOG}/_.etc 2>&1 ) install_kernel ( ) ( local extra pprint 2 "install kernel ($NANO_KERNEL)" - pprint 3 "log: ${NANO_OBJ}/_.ik" + pprint 3 "log: ${NANO_LOG}/_.ik" ( @@ -432,12 +432,12 @@ install_kernel ( ) ( cd "${NANO_SRC}" ${NANO_MAKE} installkernel DESTDIR="${NANO_WORLDDIR}" - ) > ${NANO_OBJ}/_.ik 2>&1 + ) > ${NANO_LOG}/_.ik 2>&1 ) native_xtools ( ) ( print 2 "Installing the optimized native build tools for cross env" - pprint 3 "log: ${NANO_OBJ}/_.native_xtools" + pprint 3 "log: ${NANO_LOG}/_.native_xtools" ( @@ -446,7 +446,7 @@ native_xtools ( ) ( cd "${NANO_SRC}" ${NANO_MAKE} native-xtools DESTDIR="${NANO_WORLDDIR}" - ) > ${NANO_OBJ}/_.native_xtools 2>&1 + ) > ${NANO_LOG}/_.native_xtools 2>&1 ) # @@ -460,9 +460,9 @@ run_customize ( ) ( for c in $NANO_CUSTOMIZE do pprint 2 "customize \"$c\"" - pprint 3 "log: ${NANO_OBJ}/_.cust.$c" + pprint 3 "log: ${NANO_LOG}/_.cust.$c" pprint 4 "`type $c`" - ( set -x ; $c ) > ${NANO_OBJ}/_.cust.$c 2>&1 + ( set -x ; $c ) > ${NANO_LOG}/_.cust.$c 2>&1 done ) @@ -476,9 +476,9 @@ run_late_customize ( ) ( for c in $NANO_LATE_CUSTOMIZE do pprint 2 "late customize \"$c\"" - pprint 3 "log: ${NANO_OBJ}/_.late_cust.$c" + pprint 3 "log: ${NANO_LOG}/_.late_cust.$c" pprint 4 "`type $c`" - ( set -x ; $c ) > ${NANO_OBJ}/_.late_cust.$c 2>&1 + ( set -x ; $c ) > ${NANO_LOG}/_.late_cust.$c 2>&1 done ) @@ -510,7 +510,7 @@ fixup_before_diskimage ( ) ( setup_nanobsd ( ) ( pprint 2 "configure nanobsd setup" - pprint 3 "log: ${NANO_OBJ}/_.dl" + pprint 3 "log: ${NANO_LOG}/_.dl" ( cd "${NANO_WORLDDIR}" @@ -547,7 +547,7 @@ setup_nanobsd ( ) ( # Put /tmp on the /var ramdisk (could be symlink already) tgt_dir2symlink tmp var/tmp - ) > ${NANO_OBJ}/_.dl 2>&1 + ) > ${NANO_LOG}/_.dl 2>&1 ) setup_nanobsd_etc ( ) ( @@ -630,7 +630,7 @@ populate_data_slice ( ) ( create_diskimage ( ) ( pprint 2 "build diskimage" - pprint 3 "log: ${NANO_OBJ}/_.di" + pprint 3 "log: ${NANO_LOG}/_.di" ( echo $NANO_MEDIASIZE $NANO_IMAGES \ @@ -699,7 +699,7 @@ create_diskimage ( ) ( # for booting the image from a USB device to work. print "a 1" } - ' > ${NANO_OBJ}/_.fdisk + ' > ${NANO_LOG}/_.fdisk IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME} MNT=${NANO_OBJ}/_.mnt @@ -718,7 +718,7 @@ create_diskimage ( ) ( trap "echo 'Running exit trap code' ; df -i ${MNT} ; nano_umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT - fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD} + fdisk -i -f ${NANO_LOG}/_.fdisk ${MD} fdisk ${MD} # XXX: params # XXX: pick up cached boot* files, they may not be in image anymore. @@ -736,8 +736,8 @@ create_diskimage ( ) ( populate_slice /dev/${MD}${NANO_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}" mount /dev/${MD}${NANO_ROOT} ${MNT} echo "Generating mtree..." - ( cd "${MNT}" && mtree -c ) > ${NANO_OBJ}/_.mtree - ( cd "${MNT}" && du -k ) > ${NANO_OBJ}/_.du + ( cd "${MNT}" && mtree -c ) > ${NANO_LOG}/_.mtree + ( cd "${MNT}" && du -k ) > ${NANO_LOG}/_.du nano_umount "${MNT}" if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then @@ -792,7 +792,7 @@ create_diskimage ( ) ( trap - 1 2 15 trap nano_cleanup EXIT - ) > ${NANO_OBJ}/_.di 2>&1 + ) > ${NANO_LOG}/_.di 2>&1 ) last_orders ( ) ( @@ -1026,7 +1026,8 @@ set_defaults_and_export ( ) { : ${NANO_OBJ:=/usr/obj/nanobsd.${NANO_NAME}} : ${MAKEOBJDIRPREFIX:=${NANO_OBJ}} : ${NANO_DISKIMGDIR:=${NANO_OBJ}} - NANO_WORLDDIR=${NANO_OBJ}/_.w + : ${NANO_WORLDDIR:=${NANO_OBJ}/_.w} + : ${NANO_LOG:=${NANO_OBJ}} NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install @@ -1070,6 +1071,7 @@ set_defaults_and_export ( ) { export_var NANO_MODULES export_var NANO_NOPRIV_BUILD export_var NANO_METALOG + export_var NANO_LOG export_var SRCCONF export_var SRC_ENV_CONF }