From ae396e3010f9e724ee73f15066073343abfe2456 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 5 Jul 2009 21:24:34 -0400 Subject: Do not set bootup slice after duplication. Add some progress information. --- usr/local/www/diag_nanobsd.php | 51 +++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 11 deletions(-) (limited to 'usr') diff --git a/usr/local/www/diag_nanobsd.php b/usr/local/www/diag_nanobsd.php index 8808373..961f768 100755 --- a/usr/local/www/diag_nanobsd.php +++ b/usr/local/www/diag_nanobsd.php @@ -33,6 +33,9 @@ ##|*MATCH=diag_nanobsd.php* ##|-PRIV +ini_set('zlib.output_compression', 0); +ini_set('implicit_flush', 1); +ini_set('max_input_time', '9999'); require_once("guiconfig.inc"); @@ -63,7 +66,22 @@ if(strstr($REAL_BOOT_DEVICE, "s1")) { $BOOTFLASH="{$BOOT_DRIVE}s{$OLDSLICE}"; } +?> + +"> + + + + Setting slice, please wait... +

  + +EOF; + for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } + ob_implicit_flush(1); exec("gpart set -a active -i {$SLICE} {$BOOT_DRIVE}"); exec("/usr/sbin/boot0cfg -s {$SLICE} -v /dev/{$BOOT_DRIVE}"); exec("/bin/mkdir /tmp/{$GLABEL_SLICE}"); @@ -79,9 +97,17 @@ if($_POST['bootslice']) { } if($_POST['destslice']) { + +echo << + Duplicaating slice, please wait... +

  + +EOF; + for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } + ob_implicit_flush(1); exec("dd if=/dev/zero of=/dev/{$TOFLASH} bs=1m count=1"); - exec("/bin/dd if=/dev/{$BOOTFLASH} of=/dev/{$TOFLASH} obs=64k"); - exec("/sbin/gpart set -a active -i {$SLICE} {$BOOT_DRIVE}"); + exec("/bin/dd if=/dev/{$BOOTFLASH} of=/dev/{$TOFLASH} bs=64k"); exec("/bin/mkdir /tmp/{$GLABEL_SLICE}"); exec("/sbin/mount /dev/ufs/{$GLABEL_SLICE} /tmp/{$GLABEL_SLICE}"); exec("/bin/cp /etc/fstab /tmp/{$GLABEL_SLICE}/etc/fstab"); @@ -90,19 +116,14 @@ if($_POST['destslice']) { exec("/sbin/umount /tmp/{$GLABEL_SLICE}"); $savemsg = "There was an error while duplicating the slice. Operation aborted."; } else { + $savemsg = "The slice has been duplicated"; exec("/sbin/umount /tmp/{$GLABEL_SLICE}"); - exec("/usr/sbin/boot0cfg -s {$SLICE} -v /dev/{$BOOT_DRIVE}"); } } -?> - -"> - - - @@ -118,9 +139,9 @@ if ($savemsg) NOTE:  The options on this page are intended for use by advanced users only. -

  +
  -
+

@@ -179,3 +200,11 @@ if ($savemsg) + +"; +echo "$('loading').innerHTML = '';"; +echo ""; + +?> \ No newline at end of file -- cgit v1.1
Bootup information