summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-08-23 18:23:41 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-08-23 18:23:41 -0400
commita35b52b310b81c907c4d552311983ef14a8bc88d (patch)
treeb518875861ee69d827273d0ee2da0c99416ce931 /usr/local
parenta8868e1a57df33855edc76e994603b9e74bcc4f8 (diff)
downloadpfsense-a35b52b310b81c907c4d552311983ef14a8bc88d.zip
pfsense-a35b52b310b81c907c4d552311983ef14a8bc88d.tar.gz
Resurvey slice info after changes. Resolves #52
Diffstat (limited to 'usr/local')
-rw-r--r--usr/local/www/diag_nanobsd.php54
1 files changed, 33 insertions, 21 deletions
diff --git a/usr/local/www/diag_nanobsd.php b/usr/local/www/diag_nanobsd.php
index a2d5676..83676be 100644
--- a/usr/local/www/diag_nanobsd.php
+++ b/usr/local/www/diag_nanobsd.php
@@ -47,29 +47,37 @@ $BOOT_DEVICE=trim(`/sbin/mount | /usr/bin/grep pfsense | /usr/bin/cut -d'/' -f4
$REAL_BOOT_DEVICE=trim(`/sbin/glabel list | /usr/bin/grep -B2 ufs/{$BOOT_DEVICE} | /usr/bin/head -n 1 | /usr/bin/cut -f3 -d' '`);
$BOOT_DRIVE=trim(`/sbin/glabel list | /usr/bin/grep -B2 ufs/pfsense | /usr/bin/head -n 1 | /usr/bin/cut -f3 -d' ' | /usr/bin/cut -d's' -f1`);
-// Detect which slice is active and set information.
-if(strstr($REAL_BOOT_DEVICE, "s1")) {
- $SLICE="2";
- $OLDSLICE="1";
- $TOFLASH="{$BOOT_DRIVE}s{$SLICE}";
- $COMPLETE_PATH="{$BOOT_DRIVE}s{$SLICE}a";
- $COMPLETE_BOOT_PATH="{$BOOT_DRIVE}s{$OLDSLICE}";
- $GLABEL_SLICE="pfsense1";
- $UFS_ID="1";
- $OLD_UFS_ID="0";
- $BOOTFLASH="{$BOOT_DRIVE}s{$OLDSLICE}";
-} else {
- $SLICE="1";
- $OLDSLICE="2";
- $TOFLASH="{$BOOT_DRIVE}s{$SLICE}";
- $COMPLETE_PATH="{$BOOT_DRIVE}s{$SLICE}a";
- $COMPLETE_BOOT_PATH="{$BOOT_DRIVE}s{$OLDSLICE}";
- $GLABEL_SLICE="pfsense0";
- $UFS_ID="0";
- $OLD_UFS_ID="1";
- $BOOTFLASH="{$BOOT_DRIVE}s{$OLDSLICE}";
+function detect_slice_info() {
+ global $SLICE, $OLDSLICE, $TOFLASH, $COMPLETE_PATH, $COMPLETE_BOOT_PATH;
+ global $GLABEL_SLIZE, $UFS_ID, $OLD_UFS_ID, $BOOTFLASH;
+ // Detect which slice is active and set information.
+ if(strstr($REAL_BOOT_DEVICE, "s1")) {
+ $SLICE="2";
+ $OLDSLICE="1";
+ $TOFLASH="{$BOOT_DRIVE}s{$SLICE}";
+ $COMPLETE_PATH="{$BOOT_DRIVE}s{$SLICE}a";
+ $COMPLETE_BOOT_PATH="{$BOOT_DRIVE}s{$OLDSLICE}";
+ $GLABEL_SLICE="pfsense1";
+ $UFS_ID="1";
+ $OLD_UFS_ID="0";
+ $BOOTFLASH="{$BOOT_DRIVE}s{$OLDSLICE}";
+
+ } else {
+ $SLICE="1";
+ $OLDSLICE="2";
+ $TOFLASH="{$BOOT_DRIVE}s{$SLICE}";
+ $COMPLETE_PATH="{$BOOT_DRIVE}s{$SLICE}a";
+ $COMPLETE_BOOT_PATH="{$BOOT_DRIVE}s{$OLDSLICE}";
+ $GLABEL_SLICE="pfsense0";
+ $UFS_ID="0";
+ $OLD_UFS_ID="1";
+ $BOOTFLASH="{$BOOT_DRIVE}s{$OLDSLICE}";
+ }
}
+// Survey slice info
+detect_slice_info();
+
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?=$jsevents["body"]["onload"];?>">
@@ -124,6 +132,8 @@ EOF;
exec("sysctl kern.geom.debugflags=0");
conf_mount_ro();
$savemsg = "The boot slice has been set to {$ABOOT_DRIVE} {$AGLABEL_SLICE}";
+ // Survey slice info
+ detect_slice_info();
}
if($_POST['destslice']) {
@@ -154,6 +164,8 @@ EOF;
$savemsg = "The slice has been duplicated.<p/>If you would like to boot from this newly duplicated slice please set it using the bootup information area.";
exec("/sbin/umount /tmp/{$GLABEL_SLICE}");
}
+ // Survey slice info
+ detect_slice_info();
}
if ($savemsg)
OpenPOWER on IntegriCloud