summaryrefslogtreecommitdiffstats
path: root/tools/templates
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-09-18 14:04:54 -0300
committerRenato Botelho <renato@netgate.com>2015-09-18 14:04:54 -0300
commit1f5207bcd71ecf02e03420bd6eb5c0f23666693c (patch)
tree9b71346e823191beeee211ed39bfd17d4782ed3a /tools/templates
parent6ee167def43d5e795db90672d04cd6331d68a5ab (diff)
downloadpfsense-1f5207bcd71ecf02e03420bd6eb5c0f23666693c.zip
pfsense-1f5207bcd71ecf02e03420bd6eb5c0f23666693c.tar.gz
Introduce base-nanobsd package
Diffstat (limited to 'tools/templates')
-rw-r--r--tools/templates/core_pkg/base-nanobsd/exclude_files26
-rw-r--r--tools/templates/core_pkg/base-nanobsd/metadir/+DEINSTALL21
-rw-r--r--tools/templates/core_pkg/base-nanobsd/metadir/+DESC3
-rw-r--r--tools/templates/core_pkg/base-nanobsd/metadir/+INSTALL56
-rw-r--r--tools/templates/core_pkg/base-nanobsd/metadir/+MANIFEST15
-rw-r--r--tools/templates/core_pkg/base-nanobsd/pkg-plist2
6 files changed, 123 insertions, 0 deletions
diff --git a/tools/templates/core_pkg/base-nanobsd/exclude_files b/tools/templates/core_pkg/base-nanobsd/exclude_files
new file mode 100644
index 0000000..d21c093
--- /dev/null
+++ b/tools/templates/core_pkg/base-nanobsd/exclude_files
@@ -0,0 +1,26 @@
+./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/fstab
+./etc/group
+./etc/master.passwd
+./etc/master.passwd.db
+./etc/passwd
+./etc/platform
+./etc/pwd.db
+./etc/rc.conf
+./etc/spwd.db
+./media
+./mnt
+./proc
+./sys
+./tmp
+./usr/local/share/%%PRODUCT_NAME%%/base.mtree
+./usr/local/share/%%PRODUCT_NAME%%/base.txz
diff --git a/tools/templates/core_pkg/base-nanobsd/metadir/+DEINSTALL b/tools/templates/core_pkg/base-nanobsd/metadir/+DEINSTALL
new file mode 100644
index 0000000..715125f
--- /dev/null
+++ b/tools/templates/core_pkg/base-nanobsd/metadir/+DEINSTALL
@@ -0,0 +1,21 @@
+#!/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
new file mode 100644
index 0000000..34b9159
--- /dev/null
+++ b/tools/templates/core_pkg/base-nanobsd/metadir/+DESC
@@ -0,0 +1,3 @@
+%%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
new file mode 100644
index 0000000..82aeafc
--- /dev/null
+++ b/tools/templates/core_pkg/base-nanobsd/metadir/+INSTALL
@@ -0,0 +1,56 @@
+#!/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 "===> Removing schg flag from base files"
+
+# Cleanup schg flags
+chflags -R noschg \
+ /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 [ "${PLATFORM}" != "nanobsd" -a -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
new file mode 100644
index 0000000..f163b92
--- /dev/null
+++ b/tools/templates/core_pkg/base-nanobsd/metadir/+MANIFEST
@@ -0,0 +1,15 @@
+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: {
+
+}
+categories [ security, ]
+licenselogic: single
+licenses: [ BSD2CLAUSE, ]
+options: { }
diff --git a/tools/templates/core_pkg/base-nanobsd/pkg-plist b/tools/templates/core_pkg/base-nanobsd/pkg-plist
new file mode 100644
index 0000000..f531fae
--- /dev/null
+++ b/tools/templates/core_pkg/base-nanobsd/pkg-plist
@@ -0,0 +1,2 @@
+share/%%PRODUCT_NAME%%/base.txz
+share/%%PRODUCT_NAME%%/base.mtree
OpenPOWER on IntegriCloud