diff options
author | Renato Botelho <renato@netgate.com> | 2016-10-11 15:57:17 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-10-11 15:57:17 -0300 |
commit | 2ac4be3a6b52a266a571fda10456fd350c1d20d0 (patch) | |
tree | 57a76d84b1eeaa803587fa8d539e6ba73dcd570a /tools | |
parent | bd4e01942dec4788eff97b744907f8c93fdbdcaf (diff) | |
download | pfsense-2ac4be3a6b52a266a571fda10456fd350c1d20d0.zip pfsense-2ac4be3a6b52a266a571fda10456fd350c1d20d0.tar.gz |
Remove nanobsd related code from build scripts
Diffstat (limited to 'tools')
-rw-r--r-- | tools/builder_common.sh | 375 | ||||
-rw-r--r-- | tools/builder_defaults.sh | 29 | ||||
-rw-r--r-- | tools/templates/core_pkg/base-nanobsd/exclude_files | 31 | ||||
-rw-r--r-- | tools/templates/core_pkg/base-nanobsd/metadir/+DEINSTALL | 21 | ||||
-rw-r--r-- | tools/templates/core_pkg/base-nanobsd/metadir/+DESC | 3 | ||||
-rw-r--r-- | tools/templates/core_pkg/base-nanobsd/metadir/+INSTALL | 59 | ||||
-rw-r--r-- | tools/templates/core_pkg/base-nanobsd/metadir/+MANIFEST | 15 | ||||
-rw-r--r-- | tools/templates/core_pkg/base-nanobsd/pkg-plist | 2 |
8 files changed, 3 insertions, 532 deletions
diff --git a/tools/builder_common.sh b/tools/builder_common.sh index 1534cbc..18b0773 100644 --- a/tools/builder_common.sh +++ b/tools/builder_common.sh @@ -6,11 +6,6 @@ # Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate) # All rights reserved. # -# NanoBSD portions of the code -# Copyright (c) 2005 Poul-Henning Kamp. -# and copied from nanobsd.sh -# All rights reserved. -# # FreeSBIE portions of the code # Copyright (c) 2005 Dario Freni # and copied from FreeSBIE project @@ -266,341 +261,6 @@ make_world() { unset makeargs } -nanobsd_image_filename() { - local _size="$1" - local _type="$2" - - echo "$NANOBSD_IMG_TEMPLATE" | sed \ - -e "s,%%SIZE%%,${_size},g" \ - -e "s,%%TYPE%%,${_type},g" - - return 0 -} - -# This routine originated in nanobsd.sh -nanobsd_set_flash_details () { - a1=$(echo $1 | tr '[:upper:]' '[:lower:]') - - # Source: - # SanDisk CompactFlash Memory Card - # Product Manual - # Version 10.9 - # Document No. 20-10-00038 - # April 2005 - # Table 2-7 - # NB: notice math error in SDCFJ-4096-388 line. - # - case "${a1}" in - 2048|2048m|2048mb|2g) - NANO_MEDIASIZE=$((1989999616/512)) - ;; - 4096|4096m|4096mb|4g) - NANO_MEDIASIZE=$((3989999616/512)) - ;; - 8192|8192m|8192mb|8g) - NANO_MEDIASIZE=$((7989999616/512)) - ;; - 16384|16384m|16384mb|16g) - NANO_MEDIASIZE=$((15989999616/512)) - ;; - *) - echo "Unknown Flash capacity" - exit 2 - ;; - esac - - NANO_HEADS=16 - NANO_SECTS=63 - - echo ">>> [nanoo] $1" - echo ">>> [nanoo] NANO_MEDIASIZE: $NANO_MEDIASIZE" - echo ">>> [nanoo] NANO_HEADS: $NANO_HEADS" - echo ">>> [nanoo] NANO_SECTS: $NANO_SECTS" - echo ">>> [nanoo] NANO_BOOT0CFG: $NANO_BOOT0CFG" -} - -# This routine originated in nanobsd.sh -create_nanobsd_diskimage () { - if [ -z "${1}" ]; then - echo ">>> ERROR: Type of image has not been specified" - print_error_pfS - fi - if [ -z "${2}" ]; then - echo ">>> ERROR: Size of image has not been specified" - print_error_pfS - fi - - if [ "${1}" = "nanobsd" ]; then - # It's serial - export NANO_BOOTLOADER="boot/boot0sio" - elif [ "${1}" = "nanobsd-vga" ]; then - # It's vga - export NANO_BOOTLOADER="boot/boot0" - else - echo ">>> ERROR: Type of image to create unknown" - print_error_pfS - fi - - if [ -z "${2}" ]; then - echo ">>> ERROR: Media size(s) not specified." - print_error_pfS - fi - - if [ -z "${2}" ]; then - echo ">>> ERROR: FLASH_SIZE is not set." - print_error_pfS - fi - - LOGFILE=${BUILDER_LOGS}/${1}.${TARGET} - # Prepare folder to be put in image - customize_stagearea_for_image "${1}" - install_default_kernel ${DEFAULT_KERNEL} "no" - - echo ">>> Fixing up NanoBSD Specific items..." | tee -a ${LOGFILE} - - local BOOTCONF=${FINAL_CHROOT_DIR}/boot.config - local LOADERCONF=${FINAL_CHROOT_DIR}/boot/loader.conf - - if [ "${1}" = "nanobsd" ]; then - # Tell loader to use serial console early. - echo "-S115200 -h" >> ${BOOTCONF} - - # Remove old console options if present. - [ -f "${LOADERCONF}" ] \ - && sed -i "" -Ee "/(console|boot_multicons|boot_serial|hint.uart)/d" ${LOADERCONF} - # Activate serial console+video console in loader.conf - echo 'loader_color="NO"' >> ${LOADERCONF} - echo 'beastie_disable="YES"' >> ${LOADERCONF} - echo 'boot_serial="YES"' >> ${LOADERCONF} - echo 'console="comconsole"' >> ${LOADERCONF} - echo 'comconsole_speed="115200"' >> ${LOADERCONF} - fi - echo 'autoboot_delay="5"' >> ${LOADERCONF} - - # Old systems will run (pre|post)_upgrade_command from /tmp - if [ -f ${FINAL_CHROOT_DIR}${PRODUCT_SHARE_DIR}/pre_upgrade_command ]; then - cp -p \ - ${FINAL_CHROOT_DIR}${PRODUCT_SHARE_DIR}/pre_upgrade_command \ - ${FINAL_CHROOT_DIR}/tmp - fi - if [ -f ${FINAL_CHROOT_DIR}${PRODUCT_SHARE_DIR}/post_upgrade_command ]; then - cp -p \ - ${FINAL_CHROOT_DIR}${PRODUCT_SHARE_DIR}/post_upgrade_command \ - ${FINAL_CHROOT_DIR}/tmp - fi - - mkdir -p ${IMAGES_FINAL_DIR}/nanobsd - - for _NANO_MEDIASIZE in ${2}; do - if [ -z "${_NANO_MEDIASIZE}" ]; then - continue; - fi - - echo ">>> building NanoBSD(${1}) disk image with size ${_NANO_MEDIASIZE} for platform (${TARGET})..." | tee -a ${LOGFILE} - echo "" > $BUILDER_LOGS/nanobsd_cmds.sh - - IMG="${IMAGES_FINAL_DIR}/nanobsd/$(nanobsd_image_filename ${_NANO_MEDIASIZE} ${1})" - - nanobsd_set_flash_details ${_NANO_MEDIASIZE} - - # These are defined in FlashDevice and on builder_default.sh - echo $NANO_MEDIASIZE \ - $NANO_IMAGES \ - $NANO_SECTS \ - $NANO_HEADS \ - $NANO_CODESIZE \ - $NANO_CONFSIZE \ - $NANO_DATASIZE | -awk ' -{ - printf "# %s\n", $0 - - # size of cylinder in sectors - cs = $3 * $4 - - # number of full cylinders on media - cyl = int ($1 / cs) - - # output fdisk geometry spec, truncate cyls to 1023 - if (cyl <= 1023) - print "g c" cyl " h" $4 " s" $3 - else - print "g c" 1023 " h" $4 " s" $3 - - if ($7 > 0) { - # size of data partition in full cylinders - dsl = int (($7 + cs - 1) / cs) - } else { - dsl = 0; - } - - # size of config partition in full cylinders - csl = int (($6 + cs - 1) / cs) - - if ($5 == 0) { - # size of image partition(s) in full cylinders - isl = int ((cyl - dsl - csl) / $2) - } else { - isl = int (($5 + cs - 1) / cs) - } - - # First image partition start at second track - print "p 1 165 " $3, isl * cs - $3 - c = isl * cs; - - # Second image partition (if any) also starts offset one - # track to keep them identical. - if ($2 > 1) { - print "p 2 165 " $3 + c, isl * cs - $3 - c += isl * cs; - } - - # Config partition starts at cylinder boundary. - print "p 3 165 " c, csl * cs - c += csl * cs - - # Data partition (if any) starts at cylinder boundary. - if ($7 > 0) { - print "p 4 165 " c, dsl * cs - } else if ($7 < 0 && $1 > c) { - print "p 4 165 " c, $1 - c - } else if ($1 < c) { - print "Disk space overcommitted by", \ - c - $1, "sectors" > "/dev/stderr" - exit 2 - } - - # Force slice 1 to be marked active. This is necessary - # for booting the image from a USB device to work. - print "a 1" -} - ' > ${SCRATCHDIR}/_.fdisk - - MNT=${SCRATCHDIR}/_.mnt - mkdir -p ${MNT} - - dd if=/dev/zero of=${IMG} bs=${NANO_SECTS}b \ - count=0 seek=$((${NANO_MEDIASIZE}/${NANO_SECTS})) 2>&1 >> ${LOGFILE} - - MD=$(mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} -y ${NANO_HEADS}) - trap "mdconfig -d -u ${MD}; return" 1 2 15 EXIT - - fdisk -i -f ${SCRATCHDIR}/_.fdisk ${MD} 2>&1 >> ${LOGFILE} - fdisk ${MD} 2>&1 >> ${LOGFILE} - - boot0cfg -t 100 -B -b ${FINAL_CHROOT_DIR}/${NANO_BOOTLOADER} ${NANO_BOOT0CFG} ${MD} 2>&1 >> ${LOGFILE} - - # Create first image - bsdlabel -m i386 -w -B -b ${FINAL_CHROOT_DIR}/boot/boot ${MD}s1 2>&1 >> ${LOGFILE} - bsdlabel -m i386 ${MD}s1 2>&1 >> ${LOGFILE} - local _label=$(lc ${PRODUCT_NAME}) - newfs -L ${_label}0 ${NANO_NEWFS} /dev/${MD}s1a 2>&1 >> ${LOGFILE} - mount /dev/ufs/${_label}0 ${MNT} - if [ $? -ne 0 ]; then - echo ">>> ERROR: Something wrong happened during mount of first slice image creation. STOPPING!" | tee -a ${LOGFILE} - print_error_pfS - fi - # Consider the unmounting as well - trap "umount /dev/ufs/${_label}0; mdconfig -d -u ${MD}; return" 1 2 15 EXIT - - clone_directory_contents ${FINAL_CHROOT_DIR} ${MNT} - - # Set NanoBSD image size - echo "${_NANO_MEDIASIZE}" > ${MNT}/etc/nanosize.txt - - echo "/dev/ufs/${_label}0 / ufs ro,sync,noatime 1 1" > ${MNT}/etc/fstab - if [ $NANO_CONFSIZE -gt 0 ] ; then - echo "/dev/ufs/cf /cf ufs ro,sync,noatime 1 1" >> ${MNT}/etc/fstab - fi - - umount ${MNT} - # Restore the original trap - trap "mdconfig -d -u ${MD}; return" 1 2 15 EXIT - - # Setting NANO_IMAGES to 1 and NANO_INIT_IMG2 will tell - # NanoBSD to only create one partition. We default to 2 - # partitions in case anything happens to the first the - # operator can boot from the 2nd and should be OK. - - # Before just going to use dd for duplicate think! - # The images are created as sparse so lets take advantage - # of that by just exec some commands. - if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then - # Duplicate to second image (if present) - echo ">>> Creating NanoBSD second slice by duplicating first slice." | tee -a ${LOGFILE} - # Create second image - dd if=/dev/${MD}s1 of=/dev/${MD}s2 conv=sparse bs=64k 2>&1 >> ${LOGFILE} - tunefs -L ${_label}1 /dev/${MD}s2a 2>&1 >> ${LOGFILE} - mount /dev/ufs/${_label}1 ${MNT} - if [ $? -ne 0 ]; then - echo ">>> ERROR: Something wrong happened during mount of second slice image creation. STOPPING!" | tee -a ${LOGFILE} - print_error_pfS - fi - # Consider the unmounting as well - trap "umount /dev/ufs/${_label}1; mdconfig -d -u ${MD}; return" 1 2 15 EXIT - - echo "/dev/ufs/${_label}1 / ufs ro,sync,noatime 1 1" > ${MNT}/etc/fstab - if [ $NANO_CONFSIZE -gt 0 ] ; then - echo "/dev/ufs/cf /cf ufs ro,sync,noatime 1 1" >> ${MNT}/etc/fstab - fi - - umount ${MNT} - # Restore the trap back - trap "mdconfig -d -u ${MD}; return" 1 2 15 EXIT - fi - - # Create Data slice, if any. - # Note the changing of the variable to NANO_CONFSIZE - # from NANO_DATASIZE. We also added glabel support - # and populate the Product configuration from the /cf - # directory located in FINAL_CHROOT_DIR - if [ $NANO_CONFSIZE -gt 0 ] ; then - echo ">>> Creating /cf area to hold config.xml" - newfs -L cf ${NANO_NEWFS} /dev/${MD}s3 2>&1 >> ${LOGFILE} - # Mount data partition and copy contents of /cf - # Can be used later to create custom default config.xml while building - mount /dev/ufs/cf ${MNT} - if [ $? -ne 0 ]; then - echo ">>> ERROR: Something wrong happened during mount of cf slice image creation. STOPPING!" | tee -a ${LOGFILE} - print_error_pfS - fi - # Consider the unmounting as well - trap "umount /dev/ufs/cf; mdconfig -d -u ${MD}; return" 1 2 15 EXIT - - clone_directory_contents ${FINAL_CHROOT_DIR}/cf ${MNT} - - umount ${MNT} - # Restore the trap back - trap "mdconfig -d -u ${MD}; return" 1 2 15 EXIT - else - ">>> [nanoo] NANO_CONFSIZE is not set. Not adding a /conf partition.. You sure about this??" | tee -a ${LOGFILE} - fi - - mdconfig -d -u $MD - # Restore default action - trap "-" 1 2 15 EXIT - - # Check each image and ensure that they are over - # 3 megabytes. If either image is under 20 megabytes - # in size then error out. - IMGSIZE=$(stat -f "%z" ${IMG}) - CHECKSIZE="20040710" - if [ "$IMGSIZE" -lt "$CHECKSIZE" ]; then - echo ">>> ERROR: Something went wrong when building NanoBSD. The image size is under 20 megabytes!" | tee -a ${LOGFILE} - print_error_pfS - fi - - # Wrap up the show, Johnny - echo ">>> NanoBSD Image completed for size: $_NANO_MEDIASIZE." | tee -a ${LOGFILE} - - gzip -qf $IMG & - _bg_pids="${_bg_pids}${_bg_pids:+ }$!" - done - - unset IMG - unset IMGSIZE -} - # This routine creates a ova image that contains # a ovf and vmdk file. These files can be imported # right into vmware or virtual box. @@ -912,7 +572,6 @@ clone_to_staging_area() { core_pkg_create rc "" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR} core_pkg_create base "" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR} - core_pkg_create base-nanobsd "" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR} core_pkg_create default-config "" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR} local DEFAULTCONF=${STAGE_CHROOT_DIR}/conf.default/config.xml @@ -980,8 +639,7 @@ customize_stagearea_for_image() { if [ -n "$2" ]; then _default_config="$2" - elif [ "${_image_type}" = "nanobsd" -o \ - "${_image_type}" = "memstickserial" -o \ + elif [ "${_image_type}" = "memstickserial" -o \ "${_image_type}" = "memstickadi" ]; then _default_config="default-config-serial" elif [ "${_image_type}" = "ova" ]; then @@ -994,23 +652,7 @@ customize_stagearea_for_image() { create_final_staging_area pkg_chroot_add ${FINAL_CHROOT_DIR} rc - - if [ "${_image_type}" = "nanobsd" -o \ - "${_image_type}" = "nanobsd-vga" ]; then - - mkdir -p ${FINAL_CHROOT_DIR}/root/var/db \ - ${FINAL_CHROOT_DIR}/root/var/cache \ - ${FINAL_CHROOT_DIR}/var/db/pkg \ - ${FINAL_CHROOT_DIR}/var/cache/pkg - mv -f ${FINAL_CHROOT_DIR}/var/db/pkg ${FINAL_CHROOT_DIR}/root/var/db - mv -f ${FINAL_CHROOT_DIR}/var/cache/pkg ${FINAL_CHROOT_DIR}/root/var/cache - ln -sf ../../root/var/db/pkg ${FINAL_CHROOT_DIR}/var/db/pkg - ln -sf ../../root/var/cache/pkg ${FINAL_CHROOT_DIR}/var/cache/pkg - - pkg_chroot_add ${FINAL_CHROOT_DIR} base-nanobsd - else - pkg_chroot_add ${FINAL_CHROOT_DIR} base - fi + pkg_chroot_add ${FINAL_CHROOT_DIR} base if [ "${_image_type}" = "iso" -o \ "${_image_type}" = "memstick" -o \ @@ -2111,16 +1753,6 @@ snapshots_create_sha256() { create_sha256 ${_img} snapshots_create_latest_symlink ${_img} done - - for NANOTYPE in nanobsd nanobsd-vga; do - for FILESIZE in ${FLASH_SIZE}; do - FILENAMEFULL="$(nanobsd_image_filename ${FILESIZE} ${NANOTYPE}).gz" - - if [ -f $IMAGES_FINAL_DIR/nanobsd/$FILENAMEFULL ]; then - create_sha256 $IMAGES_FINAL_DIR/nanobsd/$FILENAMEFULL - fi - done - done } snapshots_scp_files() { @@ -2137,7 +1769,6 @@ snapshots_scp_files() { # Ensure directory(s) are available ssh ${RSYNCUSER}@${_rsyncip} "mkdir -p ${RSYNCPATH}/installer" - ssh ${RSYNCUSER}@${_rsyncip} "mkdir -p ${RSYNCPATH}/nanobsd" if [ -d $IMAGES_FINAL_DIR/virtualization ]; then ssh ${RSYNCUSER}@${_rsyncip} "mkdir -p ${RSYNCPATH}/virtualization" fi @@ -2145,8 +1776,6 @@ snapshots_scp_files() { ssh ${RSYNCUSER}@${_rsyncip} "chmod -R ug+rw ${RSYNCPATH}/." rsync $RSYNC_COPY_ARGUMENTS $IMAGES_FINAL_DIR/installer/* \ ${RSYNCUSER}@${_rsyncip}:${RSYNCPATH}/installer/ - rsync $RSYNC_COPY_ARGUMENTS $IMAGES_FINAL_DIR/nanobsd/* \ - ${RSYNCUSER}@${_rsyncip}:${RSYNCPATH}/nanobsd/ if [ -d $IMAGES_FINAL_DIR/virtualization ]; then rsync $RSYNC_COPY_ARGUMENTS $IMAGES_FINAL_DIR/virtualization/* \ ${RSYNCUSER}@${_rsyncip}:${RSYNCPATH}/virtualization/ diff --git a/tools/builder_defaults.sh b/tools/builder_defaults.sh index eeec00d..501b5b1 100644 --- a/tools/builder_defaults.sh +++ b/tools/builder_defaults.sh @@ -54,12 +54,7 @@ fi # Make sure pkg will not be interactive export ASSUME_ALWAYS_YES=true -# Architecture, supported ARCH values are: -# Tier 1: i386, AMD64, and PC98 -# Tier 2: ARM, PowerPC, ia64, Sparc64 and sun4v -# Tier 3: MIPS and S/390 -# Tier 4: None at the moment -# Source: http://www.freebsd.org/doc/en/articles/committers-guide/archs.html +# Architecture export TARGET=${TARGET:-"`uname -m`"} export TARGET_ARCH=${TARGET_ARCH:-${TARGET}} # Set TARGET_ARCH_CONF_DIR @@ -180,25 +175,6 @@ export OVA_SWAP_PART_SIZE_IN_GB=${OVA_SWAP_PART_SIZE_IN_GB:-"0"} export OVA_TMP=${OVA_TMP:-"${SCRATCHDIR}/ova_tmp"} # end of OVF -# Number of code images on media (1 or 2) -export NANO_IMAGES=2 -# 0 -> Leave second image all zeroes so it compresses better. -# 1 -> Initialize second image with a copy of the first -export NANO_INIT_IMG2=1 -export NANO_NEWFS="-b 4096 -f 512 -i 8192 -O1" -export FLASH_SIZE=${FLASH_SIZE:-"2g"} -# Size of code file system in 512 bytes sectors -# If zero, size will be as large as possible. -export NANO_CODESIZE=0 -# Size of data file system in 512 bytes sectors -# If zero: no partition configured. -# If negative: max size possible -export NANO_DATASIZE=0 -# Size of Product /conf partition # 102400 = 50 megabytes. -export NANO_CONFSIZE=102400 -# packet is OK for 90% of embedded -export NANO_BOOT0CFG="-o packet -s 1 -m 3" - # NOTE: Date string is used for creating file names of images # The file is used for sharing the same value with build_snapshots.sh export DATESTRINGFILE=${DATESTRINGFILE:-"$SCRATCHDIR/version.snapshots"} @@ -343,9 +319,6 @@ export MEMSTICK_VARIANTS=${MEMSTICK_VARIANTS:-} export VARIANTIMAGES="" export VARIANTUPDATES="" -# nanobsd templates -export NANOBSD_IMG_TEMPLATE=${NANOBSD_IMG_TEMPLATE:-"${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-${PRODUCT_VERSION}${PRODUCT_REVISION:+-p}${PRODUCT_REVISION}-%%SIZE%%-${TARGET}-%%TYPE%%${TIMESTAMP_SUFFIX}.img"} - # Rsync data to send snapshots export RSYNCUSER=${RSYNCUSER:-"snapshots"} export RSYNCPATH=${RSYNCPATH:-"/usr/local/www/snapshots/${TARGET}/${PRODUCT_NAME}_${GIT_REPO_BRANCH_OR_TAG}"} diff --git a/tools/templates/core_pkg/base-nanobsd/exclude_files b/tools/templates/core_pkg/base-nanobsd/exclude_files deleted file mode 100644 index 0cd0f41..0000000 --- a/tools/templates/core_pkg/base-nanobsd/exclude_files +++ /dev/null @@ -1,31 +0,0 @@ -./boot.config -./boot/loader.conf -./boot/loader.conf.local -./boot/modules/bwi_v3_ucode.ko -./cf/conf/config.xml -./cf/conf/enableserial_force -./cf/conf/trigger_initial_wizard -./conf.default/config.xml -./etc/bogons -./etc/bogonsv6 -./etc/dh-parameters.1024 -./etc/dh-parameters.2048 -./etc/dh-parameters.4096 -./etc/fstab -./etc/group -./etc/hosts -./etc/master.passwd -./etc/passwd -./etc/platform -./etc/pwd.db -./etc/rc.conf -./etc/spwd.db -./etc/syslog.conf -./media -./mnt -./proc -./sys -./tmp -./usr/local/share/%%PRODUCT_NAME%%/base.mtree -./usr/local/share/%%PRODUCT_NAME%%/base.txz -./usr/local/etc/pkg/repos/%%PRODUCT_NAME%%.conf diff --git a/tools/templates/core_pkg/base-nanobsd/metadir/+DEINSTALL b/tools/templates/core_pkg/base-nanobsd/metadir/+DEINSTALL deleted file mode 100644 index 715125f..0000000 --- a/tools/templates/core_pkg/base-nanobsd/metadir/+DEINSTALL +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -if [ "${2}" != "DEINSTALL" ]; then - exit 0 -fi - -echo "===> Keeping a copy of current version mtree" - -# Check if there is a current mtree to be saved -if [ ! -f /usr/local/share/%%PRODUCT_NAME%%/base.mtree ]; then - echo "===> Current mtree file not found" - exit 1 -fi - -[ -f /usr/local/share/%%PRODUCT_NAME%%/base.mtree.previous ] \ - && rm -f /usr/local/share/%%PRODUCT_NAME%%/base.mtree.previous - -cp -f /usr/local/share/%%PRODUCT_NAME%%/base.mtree \ - /usr/local/share/%%PRODUCT_NAME%%/base.mtree.previous - -exit $? diff --git a/tools/templates/core_pkg/base-nanobsd/metadir/+DESC b/tools/templates/core_pkg/base-nanobsd/metadir/+DESC deleted file mode 100644 index 34b9159..0000000 --- a/tools/templates/core_pkg/base-nanobsd/metadir/+DESC +++ /dev/null @@ -1,3 +0,0 @@ -%%PRODUCT_NAME%% core files - -WWW: %%PRODUCT_URL%% diff --git a/tools/templates/core_pkg/base-nanobsd/metadir/+INSTALL b/tools/templates/core_pkg/base-nanobsd/metadir/+INSTALL deleted file mode 100644 index a2d9d82..0000000 --- a/tools/templates/core_pkg/base-nanobsd/metadir/+INSTALL +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -if [ "${2}" != "POST-INSTALL" ]; then - exit 0 -fi - -if [ ! -f /usr/local/share/%%PRODUCT_NAME%%/base.txz ]; then - echo "===> ERROR: base tarball not found!" - exit 1 -fi - -echo nanobsd > /etc/platform - -echo "===> Removing schg flag from base files" - -# Cleanup schg flags -chflags -R noschg \ - /boot \ - /bin \ - /sbin \ - /usr/bin \ - /usr/sbin \ - /libexec \ - /lib \ - /usr/lib >/dev/null 2>&1 - -echo "===> Extracting new base tarball" - -# Install new base files -tar -C / -xJPUf /usr/local/share/%%PRODUCT_NAME%%/base.txz - -echo "===> Removing static obsoleted files" - -# Set IFS to \n to deal with filenames containing spaces -oIFS=${IFS} -IFS=" -" - -PLATFORM=$(cat /etc/platform) - -# Process obsolete files -if [ -f /etc/%%PRODUCT_NAME%%.obsoletedfiles ]; then - for f in $(cat /etc/%%PRODUCT_NAME%%.obsoletedfiles); do - if [ -n "${f}" -a -d "${f}" ]; then - chflags -R noschg "${f}" - rm -rf "${f}" - elif [ -n "${f}" -a -f "${f}" ]; then - chflags noschg "${f}" - rm -f "${f}" - elif [ -n "${f}" -a -L "${f}" ]; then - rm -f "${f}" - fi - done -fi - -# Restore IFS -IFS=${oIFS} - -exit 0 diff --git a/tools/templates/core_pkg/base-nanobsd/metadir/+MANIFEST b/tools/templates/core_pkg/base-nanobsd/metadir/+MANIFEST deleted file mode 100644 index 3ec1089..0000000 --- a/tools/templates/core_pkg/base-nanobsd/metadir/+MANIFEST +++ /dev/null @@ -1,15 +0,0 @@ -name: "%%PRODUCT_NAME%%-base-nanobsd" -version: "%%VERSION%%" -origin: "security/%%PRODUCT_NAME%%-base-nanobsd" -comment: <<EOD -%%PRODUCT_NAME%% core files -EOD -maintainer: development@pfsense.org -prefix: /usr/local -deps: { -"%%PRODUCT_NAME%%-rc": {origin: "security/%%PRODUCT_NAME%%-rc", version: "%%VERSION%%"}, -} -categories [ security, ] -licenselogic: single -licenses: [ APACHE20, ] -options: { } diff --git a/tools/templates/core_pkg/base-nanobsd/pkg-plist b/tools/templates/core_pkg/base-nanobsd/pkg-plist deleted file mode 100644 index f531fae..0000000 --- a/tools/templates/core_pkg/base-nanobsd/pkg-plist +++ /dev/null @@ -1,2 +0,0 @@ -share/%%PRODUCT_NAME%%/base.txz -share/%%PRODUCT_NAME%%/base.mtree |