Revision ae396e30
Added by Scott Ullrich about 16 years ago
usr/local/www/diag_nanobsd.php | ||
---|---|---|
33 | 33 |
##|*MATCH=diag_nanobsd.php* |
34 | 34 |
##|-PRIV |
35 | 35 |
|
36 |
ini_set('zlib.output_compression', 0); |
|
37 |
ini_set('implicit_flush', 1); |
|
38 |
ini_set('max_input_time', '9999'); |
|
36 | 39 |
|
37 | 40 |
require_once("guiconfig.inc"); |
38 | 41 |
|
... | ... | |
63 | 66 |
$BOOTFLASH="{$BOOT_DRIVE}s{$OLDSLICE}"; |
64 | 67 |
} |
65 | 68 |
|
69 |
?> |
|
70 |
|
|
71 |
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?=$jsevents["body"]["onload"];?>"> |
|
72 |
<script src="/javascript/sorttable.js" type="text/javascript"></script> |
|
73 |
<?php include("fbegin.inc"); ?> |
|
74 |
<?php |
|
75 |
|
|
66 | 76 |
if($_POST['bootslice']) { |
77 |
echo <<<EOF |
|
78 |
<div id="loading"> |
|
79 |
<img src="/themes/metallic/images/misc/loader.gif"> Setting slice, please wait... |
|
80 |
<p/> |
|
81 |
</div> |
|
82 |
EOF; |
|
83 |
for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } |
|
84 |
ob_implicit_flush(1); |
|
67 | 85 |
exec("gpart set -a active -i {$SLICE} {$BOOT_DRIVE}"); |
68 | 86 |
exec("/usr/sbin/boot0cfg -s {$SLICE} -v /dev/{$BOOT_DRIVE}"); |
69 | 87 |
exec("/bin/mkdir /tmp/{$GLABEL_SLICE}"); |
... | ... | |
79 | 97 |
} |
80 | 98 |
|
81 | 99 |
if($_POST['destslice']) { |
100 |
|
|
101 |
echo <<<EOF |
|
102 |
<div id="loading"> |
|
103 |
<img src="/themes/metallic/images/misc/loader.gif"> Duplicaating slice, please wait... |
|
104 |
<p/> |
|
105 |
</div> |
|
106 |
EOF; |
|
107 |
for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } |
|
108 |
ob_implicit_flush(1); |
|
82 | 109 |
exec("dd if=/dev/zero of=/dev/{$TOFLASH} bs=1m count=1"); |
83 |
exec("/bin/dd if=/dev/{$BOOTFLASH} of=/dev/{$TOFLASH} obs=64k"); |
|
84 |
exec("/sbin/gpart set -a active -i {$SLICE} {$BOOT_DRIVE}"); |
|
110 |
exec("/bin/dd if=/dev/{$BOOTFLASH} of=/dev/{$TOFLASH} bs=64k"); |
|
85 | 111 |
exec("/bin/mkdir /tmp/{$GLABEL_SLICE}"); |
86 | 112 |
exec("/sbin/mount /dev/ufs/{$GLABEL_SLICE} /tmp/{$GLABEL_SLICE}"); |
87 | 113 |
exec("/bin/cp /etc/fstab /tmp/{$GLABEL_SLICE}/etc/fstab"); |
... | ... | |
90 | 116 |
exec("/sbin/umount /tmp/{$GLABEL_SLICE}"); |
91 | 117 |
$savemsg = "There was an error while duplicating the slice. Operation aborted."; |
92 | 118 |
} else { |
119 |
$savemsg = "The slice has been duplicated"; |
|
93 | 120 |
exec("/sbin/umount /tmp/{$GLABEL_SLICE}"); |
94 |
exec("/usr/sbin/boot0cfg -s {$SLICE} -v /dev/{$BOOT_DRIVE}"); |
|
95 | 121 |
} |
96 | 122 |
} |
97 | 123 |
|
98 |
?> |
|
99 |
|
|
100 |
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?=$jsevents["body"]["onload"];?>"> |
|
101 |
<script src="/javascript/sorttable.js" type="text/javascript"></script> |
|
102 |
<?php include("fbegin.inc"); ?> |
|
103 |
<?php |
|
104 | 124 |
if ($savemsg) |
105 | 125 |
print_info_box($savemsg) |
126 |
|
|
106 | 127 |
?> |
107 | 128 |
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
108 | 129 |
<tr> |
... | ... | |
118 | 139 |
<strong>NOTE: </strong> |
119 | 140 |
</span> |
120 | 141 |
The options on this page are intended for use by advanced users only. |
121 |
<p/>
|
|
142 |
<br/>
|
|
122 | 143 |
</span> |
123 |
<br/>
|
|
144 |
<p/>
|
|
124 | 145 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
125 | 146 |
<tr> |
126 | 147 |
<td colspan="2" valign="top" class="listtopic">Bootup information</td> |
... | ... | |
179 | 200 |
<?php require("fend.inc"); ?> |
180 | 201 |
</body> |
181 | 202 |
</html> |
203 |
|
|
204 |
<?php |
|
205 |
|
|
206 |
echo "<script type=\"text/javascript\">"; |
|
207 |
echo "$('loading').innerHTML = '';"; |
|
208 |
echo "</script>"; |
|
209 |
|
|
210 |
?> |
Also available in: Unified diff
Do not set bootup slice after duplication. Add some progress information.