summaryrefslogtreecommitdiffstats
path: root/src/usr/local/share/pfSense
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-10-19 07:23:43 -0200
committerRenato Botelho <renato@netgate.com>2015-10-20 08:26:42 -0200
commit9ace8a736a7bcb833ae829c6748d5a3c47d1de01 (patch)
treef8b393b47e13b10315445060908f0eb661e136c7 /src/usr/local/share/pfSense
parent376ba07b54b95259495ba16e90ed17e407c9e76d (diff)
downloadpfsense-9ace8a736a7bcb833ae829c6748d5a3c47d1de01.zip
pfsense-9ace8a736a7bcb833ae829c6748d5a3c47d1de01.tar.gz
Remove all PBIs before upgrade to 2.3, it fixes #5221
Diffstat (limited to 'src/usr/local/share/pfSense')
-rw-r--r--src/usr/local/share/pfSense/pre_upgrade_command30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/usr/local/share/pfSense/pre_upgrade_command b/src/usr/local/share/pfSense/pre_upgrade_command
index 2ad365f..66fbbbe 100644
--- a/src/usr/local/share/pfSense/pre_upgrade_command
+++ b/src/usr/local/share/pfSense/pre_upgrade_command
@@ -12,6 +12,36 @@ echo $PRIOR_VERSION > /tmp/pre_upgrade_version
# De-activate sync on the root slice only. This will not match NanoBSD since it already has sync,noatime
/usr/bin/sed -i '' 's/^\(\/.*[[:space:]]*\/[[:space:]]*ufs[[:space:]]*\)rw,sync\([[:space:]]*[[:digit:]][[:space:]]*[[:digit:]]\)$/\1rw\2/' /etc/fstab
+# Cleanup PBIs
+if which pbi_info >/dev/null 2>&1; then
+ for pbi in $(pbi_info); do
+ pbi_prefix=$(pbi_info ${pbi} | awk '$1 == "Prefix:" { print $2 }')
+ if [ ! -d "${pbi_prefix}" ]; then
+ continue
+ fi
+
+ for subdir in bin sbin; do
+ if [ ! -d "${pbi_prefix}/${subdir}" ]; then
+ continue
+ fi
+
+ for pbiopt in ${pbi_prefix}/${subdir}/*.pbiopt; do
+ link_name=$(awk '$1 == "TARGET:" { print $2 }' ${pbiopt})
+
+ if [ -z "${link_name}" ]; then
+ continue
+ fi
+
+ if [ -L /usr/local/${link_name} ]; then
+ rm -f /usr/local/${link_name}
+ fi
+ done
+ done
+
+ pbi_delete ${pbi}
+ done
+fi
+
# Hack to workaround ticket #3749
if [ ${PRIOR_VERSION} -le 8 ] && grep -q 'sh /etc/rc.reboot' /etc/rc.firmware; then
PROC=$(ps axwww | grep '/etc/rc.firmware *pfSenseupgrade')
OpenPOWER on IntegriCloud