Stop using memory disks for staging and final dir

This commit is contained in:
Renato Botelho 2016-06-02 08:23:15 -03:00
parent bf19eec78a
commit b034785d30
3 changed files with 0 additions and 76 deletions

View File

@ -68,8 +68,6 @@ usage() {
echo " --install-extra-kernels argument - Put extra kernel(s) under /kernel image directory. Example --install-extra-kernels KERNEL_NAME_WRAP"
echo " --snapshots - Build snapshots and upload them to RSYNCIP"
echo " --poudriere-snapshots - Update poudriere packages and send them to PKG_RSYNC_HOSTNAME"
echo " --enable-memorydisks - This will put stage_dir and iso_dir as MFS filesystems"
echo " --disable-memorydisks - Will just teardown these filesystems created by --enable-memorydisks"
echo " --setup-poudriere - Install poudriere and create necessary jails and ports tree"
echo " --create-unified-patch - Create a big patch with all changes done on FreeBSD"
echo " --update-poudriere-jails [-a ARCH_LIST] - Update poudriere jails using current patch versions"
@ -161,12 +159,6 @@ while test "$1" != ""; do
--clean-builder)
BUILDACTION="cleanbuilder"
;;
--enable-memorydisks)
BUILDACTION="enablememorydisk"
;;
--disable-memorydisks)
BUILDACTION="disablememorydisk"
;;
--setup-poudriere)
BUILDACTION="setup_poudriere"
;;
@ -262,12 +254,6 @@ case $BUILDACTION in
updatesources)
update_freebsd_sources
;;
enablememorydisk)
prestage_on_ram_setup
;;
disablememorydisk)
prestage_on_ram_cleanup
;;
setup_poudriere)
poudriere_init
;;
@ -387,9 +373,6 @@ if [ -z "${_SKIP_REBUILD_PRESTAGE}" ]; then
# Ensure binaries are present that builder system requires
builder_setup
# Check to see if pre-staging will be hosted on ram
prestage_on_ram_setup
# Build world, kernel and install
echo ">>> Building world for ISO... $FREEBSD_BRANCH ..."
make_world

View File

@ -197,62 +197,6 @@ print_error_pfS() {
exit 1
}
prestage_on_ram_setup() {
# Do not use memory disks for release build
if [ -n "${_IS_RELEASE}" ]; then
return
fi
[ -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"
return
else
echo "######################################################################################"
echo
echo ">>> Builder has more than 2GiB RAM enabling memory disks"
echo ">>> WARNING: Remember to remove these memory disks by running $0 --disable-memorydisks"
echo
echo "######################################################################################"
fi
if df /dev/ufs/prestagebacking >/dev/null 2>&1; then
echo ">>> Detected preexisting memory disk enabled for ${STAGE_CHROOT_DIR}."
else
mdconfig -a -t swap -u 10001 -s ${MEMORYDISK_SIZE}
newfs -L prestagebacking -U /dev/md10001
mount /dev/ufs/prestagebacking ${STAGE_CHROOT_DIR}
fi
if df /dev/ufs/finalstagebacking >/dev/null 2>&1; then
echo ">>> Detected preexisting memory disk enabled for ${FINAL_CHROOT_DIR}."
else
mdconfig -a -t swap -u 10002 -s ${MEMORYDISK_SIZE}
newfs -L finalstagebacking -U /dev/md10002
mount /dev/ufs/finalstagebacking ${FINAL_CHROOT_DIR}
fi
}
prestage_on_ram_cleanup() {
if [ -c /dev/md10001 ]; then
if [ -d ${STAGE_CHROOT_DIR} ]; then
umount ${STAGE_CHROOT_DIR}
fi
mdconfig -d -u 10001
fi
if [ -c /dev/md10002 ]; then
if [ -d ${FINAL_CHROOT_DIR} ]; then
umount ${FINAL_CHROOT_DIR}
fi
mdconfig -d -u 10002
fi
}
# This routine will verify that the kernel has been
# installed OK to the staging area.
ensure_kernel_exists() {

View File

@ -200,9 +200,6 @@ export STAGE_CHROOT_DIR=${STAGE_CHROOT_DIR:-"${SCRATCHDIR}/stage-dir"}
# iso staging area.
export FINAL_CHROOT_DIR=${FINAL_CHROOT_DIR:-"${SCRATCHDIR}/final-dir"}
# 400M is not enough for amd64
export MEMORYDISK_SIZE=${MEMORYDISK_SIZE:-"1024M"}
# OVF/vmdk parms
# Name of ovf file included inside OVA archive
export OVFTEMPLATE=${OVFTEMPLATE:-"${BUILDER_TOOLS}/templates/ovf/${PRODUCT_NAME}.ovf"}