summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-25 10:29:45 -0300
committerRenato Botelho <renato@netgate.com>2015-08-25 14:49:56 -0300
commitf546e6ca5769c2c28fcc6f26a580d79a96efa04e (patch)
tree75cd6449823c1fde56f51ec0c25fa828fc0fcb1d /tools
parent934e3e0420d549a3c5594645480f196f98a735ad (diff)
downloadpfsense-f546e6ca5769c2c28fcc6f26a580d79a96efa04e.zip
pfsense-f546e6ca5769c2c28fcc6f26a580d79a96efa04e.tar.gz
Do not remove CHROOT directories, they can be mounted on MFS filesystems. Create them if they don't exist and just delete their content
Diffstat (limited to 'tools')
-rw-r--r--tools/builder_common.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/builder_common.sh b/tools/builder_common.sh
index e43151d..9c85cbc 100644
--- a/tools/builder_common.sh
+++ b/tools/builder_common.sh
@@ -147,6 +147,11 @@ print_error_pfS() {
}
prestage_on_ram_setup() {
+ [ -d "${STAGE_CHROOT_DIR}" ] \
+ || mkdir -p ${STAGE_CHROOT_DIR}
+ [ -d "${FINAL_CHROOT_DIR}" ] \
+ || mkdir -p ${FINAL_CHROOT_DIR}
+
_AVAIL_MEM=$(($(sysctl -n hw.usermem) / 1024 / 1024))
if [ $_AVAIL_MEM -lt 2000 ]; then
echo ">>> Builder has less than 2GiB RAM skipping memory disks"
@@ -164,7 +169,6 @@ prestage_on_ram_setup() {
echo ">>> Detected preexisting memory disk enabled for ${STAGE_CHROOT_DIR}."
else
mdconfig -a -t swap -u 10001 -s ${MEMORYDISK_SIZE}
- mkdir -p ${STAGE_CHROOT_DIR}
newfs -L prestagebacking -U /dev/md10001
mount /dev/ufs/prestagebacking ${STAGE_CHROOT_DIR}
fi
@@ -173,7 +177,6 @@ prestage_on_ram_setup() {
echo ">>> Detected preexisting memory disk enabled for ${FINAL_CHROOT_DIR}."
else
mdconfig -a -t swap -u 10002 -s ${MEMORYDISK_SIZE}
- mkdir -p ${FINAL_CHROOT_DIR}
newfs -L finalstagebacking -U /dev/md10002
mount /dev/ufs/finalstagebacking ${FINAL_CHROOT_DIR}
fi
@@ -429,7 +432,6 @@ make_world() {
LOGFILE=${BUILDER_LOGS}/installworld.${TARGET}
echo ">>> LOGFILE set to $LOGFILE." | tee -a ${LOGFILE}
# Create if cleaned up
- mkdir -p ${STAGE_CHROOT_DIR}
makeargs="${MAKE_ARGS} DESTDIR=${STAGE_CHROOT_DIR} WITHOUT_TOOLCHAIN=1"
echo ">>> Installing world for ${TARGET} architecture... (Starting - $(LC_ALL=C date))" | tee -a ${LOGFILE}
echo ">>> Builder is running the command: env LOCAL_ITOOLS=\"${EXTRA_TOOLS}\" script -aq $LOGFILE make -C ${FREEBSD_SRC_DIR} ${makeargs:-} installworld" | tee -a ${LOGFILE}
@@ -1013,10 +1015,9 @@ clean_obj_dir() {
BASENAME=$(basename ${STAGE_CHROOT_DIR})
echo -n ">>> Cleaning ${STAGE_CHROOT_DIR} ..."
chflags -R noschg ${STAGE_CHROOT_DIR} 2>&1 >/dev/null
- rm -rf ${STAGE_CHROOT_DIR} 2>/dev/null
+ rm -rf ${STAGE_CHROOT_DIR}/* 2>/dev/null
echo "Done."
fi
- mkdir -p ${STAGE_CHROOT_DIR}
if [ -z "${NO_CLEANFREEBSDOBJDIR}" -a -d "${FREEBSD_SRC_DIR}" ]; then
OBJTREE=$(env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} make -C ${FREEBSD_SRC_DIR} -V OBJTREE)
@@ -1164,7 +1165,6 @@ create_final_staging_area() {
rm -rf ${FINAL_CHROOT_DIR}/* 2>&1 1>/dev/null
echo "Done." | tee -a ${LOGFILE}
fi
- mkdir -p ${FINAL_CHROOT_DIR}
echo ">>> Preparing Final image staging area: $(LC_ALL=C date)" 2>&1 | tee -a ${LOGFILE}
echo ">>> Cloning ${STAGE_CHROOT_DIR} to ${FINAL_CHROOT_DIR}" 2>&1 | tee -a ${LOGFILE}
@@ -1593,7 +1593,7 @@ staginareas_clean_each_run() {
BASENAME=$(basename ${FINAL_CHROOT_DIR})
echo -n "$BASENAME "
chflags -R noschg ${FINAL_CHROOT_DIR} 2>&1 >/dev/null
- rm -rf ${FINAL_CHROOT_DIR} 2>/dev/null
+ rm -rf ${FINAL_CHROOT_DIR}/* 2>/dev/null
fi
echo "Done!"
}
OpenPOWER on IntegriCloud