diff options
author | Renato Botelho <renato@netgate.com> | 2016-08-03 10:33:59 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-08-03 10:33:59 -0300 |
commit | f41f9c0c6f6c6f1d43a107d45a197e49ea429308 (patch) | |
tree | 3e6c2ed62072cad8d4f5b62cd56b1ba3a52cd08e | |
parent | f6dcb7f5edac5fb398cfde73947268806d0b907a (diff) | |
download | pfsense-f41f9c0c6f6c6f1d43a107d45a197e49ea429308.zip pfsense-f41f9c0c6f6c6f1d43a107d45a197e49ea429308.tar.gz |
Remove unnecessary code and select default kernel for installation media
-rwxr-xr-x | build.sh | 2 | ||||
-rw-r--r-- | tools/builder_common.sh | 32 |
2 files changed, 15 insertions, 19 deletions
@@ -347,7 +347,7 @@ if [ -z "${_SKIP_REBUILD_PRESTAGE}" ]; then build_all_kernels # Install kernel on installer - installkernel ${INSTALLER_CHROOT_DIR} + installkernel ${INSTALLER_CHROOT_DIR} ${PRODUCT_NAME} # Prepare pre-final staging area clone_to_staging_area diff --git a/tools/builder_common.sh b/tools/builder_common.sh index 994c923..1daf7a4 100644 --- a/tools/builder_common.sh +++ b/tools/builder_common.sh @@ -145,21 +145,14 @@ build_all_kernels() { for BUILD_KERNEL in $BUILD_KERNELS; do unset KERNCONF unset KERNEL_DESTDIR - unset KERNELCONF unset KERNEL_NAME export KERNCONF=$BUILD_KERNEL export KERNEL_DESTDIR="$KERNEL_BUILD_PATH/$BUILD_KERNEL" - export KERNELCONF="${FREEBSD_SRC_DIR}/sys/${TARGET}/conf/$BUILD_KERNEL" export KERNEL_NAME=${BUILD_KERNEL} LOGFILE="${BUILDER_LOGS}/kernel.${KERNCONF}.${TARGET}.log" echo ">>> Building $BUILD_KERNEL kernel." | tee -a ${LOGFILE} - if [ ! -e "${KERNELCONF}" ]; then - echo ">>> ERROR: Could not find $KERNELCONF" - print_error_pfS - fi - if [ -n "${NO_BUILDKERNEL}" -a -f "${CORE_PKG_ALL_PATH}/$(get_pkg_name kernel-${KERNEL_NAME}).txz" ]; then echo ">>> NO_BUILDKERNEL set, skipping build" | tee -a ${LOGFILE} continue @@ -1505,47 +1498,50 @@ staginareas_clean_each_run() { # Imported from FreeSBIE buildkernel() { + local _kernconf=${1:-${KERNCONF}} + if [ -n "${NO_BUILDKERNEL}" ]; then echo ">>> NO_BUILDKERNEL set, skipping build" | tee -a ${LOGFILE} return fi - if [ -z "${KERNCONF}" ]; then + if [ -z "${_kernconf}" ]; then echo ">>> ERROR: No kernel configuration defined probably this is not what you want! STOPPING!" | tee -a ${LOGFILE} print_error_pfS fi - if [ -n "${KERNELCONF}" ]; then - export KERNCONFDIR=$(dirname ${KERNELCONF}) - export KERNCONF=$(basename ${KERNELCONF}) - fi + local _old_kernconf=${KERNCONF} + export KERNCONF=${_kernconf} echo ">>> $(LC_ALL=C date) - Starting build kernel for ${TARGET} architecture..." | tee -a ${LOGFILE} script -aq $LOGFILE ${BUILDER_SCRIPTS}/build_freebsd.sh -W -s ${FREEBSD_SRC_DIR} \ || print_error_pfS echo ">>> $(LC_ALL=C date) - Finished build kernel for ${TARGET} architecture..." | tee -a ${LOGFILE} + + export KERNCONF=${_old_kernconf} } # Imported from FreeSBIE installkernel() { local _destdir=${1:-${KERNEL_DESTDIR}} + local _kernconf=${2:-${KERNCONF}} - if [ -z "${KERNCONF}" ]; then + if [ -z "${_kernconf}" ]; then echo ">>> ERROR: No kernel configuration defined probably this is not what you want! STOPPING!" | tee -a ${LOGFILE} print_error_pfS fi - if [ -n "${KERNELCONF}" ]; then - export KERNCONFDIR=$(dirname ${KERNELCONF}) - export KERNCONF=$(basename ${KERNELCONF}) - fi + local _old_kernconf=${KERNCONF} + export KERNCONF=${_kernconf} mkdir -p ${STAGE_CHROOT_DIR}/boot - echo ">>> Installing kernel (${KERNCONF}) for ${TARGET} architecture..." | tee -a ${LOGFILE} + echo ">>> Installing kernel (${_kernconf}) for ${TARGET} architecture..." | tee -a ${LOGFILE} script -aq $LOGFILE ${BUILDER_SCRIPTS}/install_freebsd.sh -W -D -z \ -s ${FREEBSD_SRC_DIR} \ -d ${_destdir} \ || print_error_pfS + + export KERNCONF=${_old_kernconf} } # Launch is ran first to setup a few variables that we need |