Revision dd40d664
Added by Jim Pingle about 14 years ago
etc/rc.firmware | ||
---|---|---|
206 | 206 |
# slice that we are going to be operating on. |
207 | 207 |
NEW_IMG_SIZE=`echo $((\`gzip -l ${IMG} | grep -v compressed | awk '{ print $2}'\` / 1024 / 1024))` |
208 | 208 |
SIZE=`/sbin/fdisk ${COMPLETE_PATH} | /usr/bin/grep Meg | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d"(" -f2` |
209 |
SIZE=`expr $SIZE + 1` |
|
209 |
# USB slices are under-reported even more than CF slices when viewed |
|
210 |
# directly, instead of when looking at the entire disk. Compensate |
|
211 |
# by adding a few MB. |
|
212 |
SIZE=`expr $SIZE + 4` |
|
210 | 213 |
if [ "$SIZE" -lt "$NEW_IMG_SIZE" ]; then |
211 | 214 |
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" |
212 | 215 |
echo "Upgrade failed. Please check the system log file for more information" | wall |
Also available in: Unified diff
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.)