diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2009-07-05 21:24:34 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2009-07-05 21:24:34 -0400 |
commit | ae396e3010f9e724ee73f15066073343abfe2456 (patch) | |
tree | 621b0fa7e6917e8dc1cdacf54fd65d357ef7e7c0 | |
parent | 8c292e5468f6575bbbe2d9c52360e4a6ad84fda4 (diff) | |
download | pfsense-ae396e3010f9e724ee73f15066073343abfe2456.zip pfsense-ae396e3010f9e724ee73f15066073343abfe2456.tar.gz |
Do not set bootup slice after duplication. Add some progress information.
-rwxr-xr-x | usr/local/www/diag_nanobsd.php | 51 |
1 files changed, 40 insertions, 11 deletions
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}"; } +?> + +<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?=$jsevents["body"]["onload"];?>"> +<script src="/javascript/sorttable.js" type="text/javascript"></script> +<?php include("fbegin.inc"); ?> +<?php + if($_POST['bootslice']) { + echo <<<EOF + <div id="loading"> + <img src="/themes/metallic/images/misc/loader.gif"> Setting slice, please wait... + <p/> + </div> +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 <<<EOF + <div id="loading"> + <img src="/themes/metallic/images/misc/loader.gif"> Duplicaating slice, please wait... + <p/> + </div> +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}"); } } -?> - -<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?=$jsevents["body"]["onload"];?>"> -<script src="/javascript/sorttable.js" type="text/javascript"></script> -<?php include("fbegin.inc"); ?> -<?php if ($savemsg) print_info_box($savemsg) + ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> @@ -118,9 +139,9 @@ if ($savemsg) <strong>NOTE: </strong> </span> The options on this page are intended for use by advanced users only. - <p/> + <br/> </span> - <br/> + <p/> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> <td colspan="2" valign="top" class="listtopic">Bootup information</td> @@ -179,3 +200,11 @@ if ($savemsg) <?php require("fend.inc"); ?> </body> </html> + +<?php + +echo "<script type=\"text/javascript\">"; +echo "$('loading').innerHTML = '';"; +echo "</script>"; + +?>
\ No newline at end of file |