summaryrefslogtreecommitdiffstats
path: root/etc/rc.firmware
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-06-29 16:45:24 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-06-29 16:45:24 -0400
commitbc43f0eead2220fe04f6891795d7fb481f3331be (patch)
treedaa1e73cf17fb07c75687cf4f019fcaf60c50988 /etc/rc.firmware
parent507960cb938bd9f5eb74b425d57f38556a1c4073 (diff)
downloadpfsense-bc43f0eead2220fe04f6891795d7fb481f3331be.zip
pfsense-bc43f0eead2220fe04f6891795d7fb481f3331be.tar.gz
Mount RW so we can write to logs. Duh. Mount RO if we exit out of an upgrade.
Diffstat (limited to 'etc/rc.firmware')
-rwxr-xr-xetc/rc.firmware10
1 files changed, 7 insertions, 3 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index cf9457d..98c4573 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -122,9 +122,13 @@ auto)
;;
pfSenseNanoBSDupgrade)
+ # mount /cf
+ /etc/rc.conf_mount_rw
+
# Sanity check - bail early if there's no firmware file!
if [ ! -r $IMG ]; then
echo "2nd parameter has not been passed or file does not exist. Exiting." >> /cf/upgrade_log.txt 2>&1
+ /etc/rc.conf_mount_ro
exit 1
fi
@@ -132,6 +136,7 @@ pfSenseNanoBSDupgrade)
if [ `echo $IMG | grep "full"` ]; then
echo "You cannot use a full file for upgrade. Please use a file labeled upgrade."
file_notice "NanoBSDUpgradeFailure" "You have attemped to use a full NanoBSD installation file as an upgrade. Please use a NanoBSD file labeled 'upgrade' instead."
+ /etc/rc.conf_mount_ro
exit 1
fi
@@ -140,9 +145,6 @@ pfSenseNanoBSDupgrade)
echo "Firmware upgrade in progress..." >> /cf/upgrade_log.txt 2>&1
echo "Firmware upgrade in progress..." | wall
- # mount /cf
- /etc/rc.conf_mount_rw
-
# backup config
/bin/mkdir -p /tmp/configbak
cp -p /conf/* /tmp/configbak 2>/dev/null
@@ -215,6 +217,7 @@ pfSenseNanoBSDupgrade)
if [ $? != 0 ]; then
file_notice "UpgradeFailure" "{\$g['product_name']} upgrade has failed. Your system has been left in a usable state."
rm /var/run/firmware.lock
+ /etc/rc.conf_mount_ro
exit 1
fi
@@ -247,6 +250,7 @@ pfSenseNanoBSDupgrade)
file_notice "UpgradeFailure" "Something went wrong when trying to update the fstab entry. Aborting upgrade."
rm /var/run/firmware.lock
umount /tmp/$GLABEL_SLICE
+ /etc/rc.conf_mount_ro
exit 1
fi
echo "" >> /cf/upgrade_log.txt
OpenPOWER on IntegriCloud