summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/rc.firmware6
1 files changed, 5 insertions, 1 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index 59c3182..5d46a7f 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -143,6 +143,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."
+ rm -f $IMG
/etc/rc.conf_mount_ro
exit 1
fi
@@ -200,6 +201,7 @@ pfSenseNanoBSDupgrade)
SIZE=`expr $SIZE + 1`
if [ "$SIZE" -lt "$NEW_IMG_SIZE" ]; then
file_notice "UpgradeFailure" "Upgrade failed due to the upgrade image being larger than the partition that is configured on disk. Halting. Size on disk: $SIZE < Size of new image: $NEW_IMG_SIZE"
+ rm -f $IMG
rm -f /var/run/firmwarelock.dirty
rm -f /var/run/firmware.lock
/etc/rc.conf_mount_ro
@@ -260,8 +262,9 @@ pfSenseNanoBSDupgrade)
/sbin/fsck_ufs -y /dev/$COMPLETE_PATH >> /conf/upgrade_log.txt 2>&1
if [ $? != 0 ]; then
file_notice "UpgradeFailure" "{\$g['product_name']} upgrade has failed. Your system has been left in a usable state."
+ rm -f $IMG
rm -f /var/run/firmwarelock.dirty
- rm -f /var/run/firmware.lock
+ rm -f /var/run/firmware.lock
/etc/rc.conf_mount_ro
exit 1
fi
@@ -296,6 +299,7 @@ pfSenseNanoBSDupgrade)
if [ $? != 0 ]; then
echo "Something went wrong when trying to update the fstab entry. Aborting upgrade."
file_notice "UpgradeFailure" "Something went wrong when trying to update the fstab entry. Aborting upgrade."
+ rm -f $IMG
rm -f /var/run/firmwarelock.dirty
rm -f /var/run/firmware.lock
umount /tmp/$GLABEL_SLICE
OpenPOWER on IntegriCloud