summaryrefslogtreecommitdiffstats
path: root/etc/rc.firmware
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-08-03 09:51:46 -0400
committerjim-p <jimp@pfsense.org>2011-08-19 18:45:48 -0400
commit3de1a999cee99f5199772239b385d4b16121c603 (patch)
tree4911b1843321c1de97584e536b699a83d25e6614 /etc/rc.firmware
parentb881a921e3e68976a80b074052c87b8662125e3e (diff)
downloadpfsense-3de1a999cee99f5199772239b385d4b16121c603.zip
pfsense-3de1a999cee99f5199772239b385d4b16121c603.tar.gz
USB slices are under-reported even more than CF slices when viewed directly, instead of when looking at the entire disk. Compensate by adding a few MB. Fixes NanoBSD upgrades when installed on USB thumbdrives. (Imaged after this fix, someone can apply this fix locally and then upgrade as well.)
Diffstat (limited to 'etc/rc.firmware')
-rwxr-xr-xetc/rc.firmware5
1 files changed, 4 insertions, 1 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index 063e9a3..698db67 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -206,7 +206,10 @@ pfSenseNanoBSDupgrade)
# slice that we are going to be operating on.
NEW_IMG_SIZE=`echo $((\`gzip -l ${IMG} | grep -v compressed | awk '{ print $2}'\` / 1024 / 1024))`
SIZE=`/sbin/fdisk ${COMPLETE_PATH} | /usr/bin/grep Meg | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d"(" -f2`
- SIZE=`expr $SIZE + 1`
+ # USB slices are under-reported even more than CF slices when viewed
+ # directly, instead of when looking at the entire disk. Compensate
+ # by adding a few MB.
+ SIZE=`expr $SIZE + 4`
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"
echo "Upgrade failed. Please check the system log file for more information" | wall
OpenPOWER on IntegriCloud