diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2009-06-26 15:10:00 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2009-06-26 15:10:00 -0400 |
commit | 004675b68e6087c4bffc8484df8658697b4e3f14 (patch) | |
tree | a9b0bfc27b7dc2a3ed58ed7e6c25d2d1e0b0843a /etc/rc.firmware | |
parent | 498be2fc2e34ee2b4a9e7690079f3e514a55e7e9 (diff) | |
download | pfsense-004675b68e6087c4bffc8484df8658697b4e3f14.zip pfsense-004675b68e6087c4bffc8484df8658697b4e3f14.tar.gz |
Set slice as well
Diffstat (limited to 'etc/rc.firmware')
-rwxr-xr-x | etc/rc.firmware | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware index 9b7dd8a..58c4b91 100755 --- a/etc/rc.firmware +++ b/etc/rc.firmware @@ -175,14 +175,16 @@ pfSenseNanoBSDupgrade) # resolve glabel label that we booted from BOOT_DEVICE=`/sbin/mount | /usr/bin/grep pfsense | /usr/bin/cut -d'/' -f4 | /usr/bin/cut -d' ' -f1` # resolve glabel to the real boot dev entry - REAL_BOOT_DEVICE=`/sbin/glabel list | grep -B2 ufs/${BOOT_DEVICE} | head -n 1 | cut -f3 -d' '` + REAL_BOOT_DEVICE=`/sbin/glabel list | /usr/bin/grep -B2 ufs/${BOOT_DEVICE} | /usr/bin/head -n 1 | /usr/bin/cut -f3 -d' '` # grab the boot device, example ad1, ad0 - BOOT_DRIVE=`/sbin/glabel list | grep -B2 ufs/pfsense1 | head -n 1 | cut -f3 -d' ' | cut -d's' -f1` + BOOT_DRIVE=`/sbin/glabel list | /usr/bin/grep -B2 ufs/pfsense1 | /usr/bin/head -n 1 | /usr/bin/cut -f3 -d' ' | /usr/bin/cut -d's' -f1` # test the slice. if we are on slice 1 we need to flash 2 and vica versa - if [ `echo $REAL_BOOT_DEVICE | grep "s1"` ]; then + if [ `echo $REAL_BOOT_DEVICE | /usr/bin/grep "s1"` ]; then TOFLASH="${BOOT_DRIVE}s2a" + SLICE="2" else TOFLASH="${BOOT_DRIVE}s1a" + SLICE="1" fi # Remove TOFLASH and get ready for new flash image @@ -207,7 +209,7 @@ ENDOFF exit 1 fi - /usr/sbin/boot0cfg -s 1 -v /dev/${TOFLASH} + /usr/sbin/boot0cfg -s ${SLICE} -v /dev/${TOFLASH} #>/dev/null 2>&1 # restore config |