diff options
author | Daniel Stefan Haischt <dsh@pfsense.org> | 2007-01-11 11:03:31 +0000 |
---|---|---|
committer | Daniel Stefan Haischt <dsh@pfsense.org> | 2007-01-11 11:03:31 +0000 |
commit | 40b0848cf0bc85ee5c85a75b1ae3a75494e8d09d (patch) | |
tree | 4a5059d75748ddbd7c5cff28e98b2a7e1d5cabc0 /packages/freenas | |
parent | 4c220daee80a863e20460950a2a49d29d5bc3075 (diff) | |
download | pfsense-packages-40b0848cf0bc85ee5c85a75b1ae3a75494e8d09d.tar.gz pfsense-packages-40b0848cf0bc85ee5c85a75b1ae3a75494e8d09d.tar.bz2 pfsense-packages-40b0848cf0bc85ee5c85a75b1ae3a75494e8d09d.zip |
* sync to latest FreeNAS trunk
Diffstat (limited to 'packages/freenas')
-rw-r--r-- | packages/freenas/pkg/freenas_disks.inc | 10 | ||||
-rw-r--r-- | packages/freenas/pkg/freenas_guiconfig.inc | 8 | ||||
-rw-r--r-- | packages/freenas/pkg/freenas_utils.inc | 6 | ||||
-rw-r--r-- | packages/freenas/www/diag_raid_infos.php | 26 | ||||
-rw-r--r-- | packages/freenas/www/disks_manage_init.php | 11 | ||||
-rw-r--r-- | packages/freenas/www/disks_manage_tools.php | 46 | ||||
-rw-r--r-- | packages/freenas/www/disks_mount_tools.php | 2 |
7 files changed, 92 insertions, 17 deletions
diff --git a/packages/freenas/pkg/freenas_disks.inc b/packages/freenas/pkg/freenas_disks.inc index 3ccc4f24..16f5a12f 100644 --- a/packages/freenas/pkg/freenas_disks.inc +++ b/packages/freenas/pkg/freenas_disks.inc @@ -1034,6 +1034,9 @@ function disks_raid_graid5_delete($raidname) { // Stop the volume mwexec("/sbin/graid5 stop $raidname"); + + // The volume can disapear a few second after stop + sleep(2); // Clear the graid5 information on the hard drive foreach ($freenas_config['graid5']['vdisk'] as $a_raid) { @@ -1155,6 +1158,7 @@ function disks_bsdlabel($harddrive,$partition,$type) { // If the line contain the word "unused" if (ereg ("unused",$val)) { // Replacing c: by a: + // Why ??? Must found the web page where I see this method $val = ereg_replace ("c:","a:", $val); // Peplacing unused by $type $val = ereg_replace ("unused",$type, $val); @@ -1198,8 +1202,6 @@ function disks_set_ataidle() { $apm=$disk['apm']; $ac=$disk['acoustic']; - /* mwexec("/usr/local/sbin/ataidle -A $ac -P $apm -S $time $channel $device"); */ - $cmd = "/usr/local/sbin/ataidle "; if ($disk['acoustic'] != 0) { $cmd .= "-A $ac "; } @@ -1227,9 +1229,11 @@ Result is in the form: [type] => 0xa5 [flags] => 0x80 ) + +Called in disks_manage_tools.php */ function disks_get_partition_info($disk) { - exec("/sbin/fdisk -s /dev/{$disk}", $rawdata); + exec("/sbin/fdisk -s {$disk}", $rawdata); array_shift($rawdata); array_shift($rawdata); diff --git a/packages/freenas/pkg/freenas_guiconfig.inc b/packages/freenas/pkg/freenas_guiconfig.inc index 93e7a826..1464b147 100644 --- a/packages/freenas/pkg/freenas_guiconfig.inc +++ b/packages/freenas/pkg/freenas_guiconfig.inc @@ -50,7 +50,13 @@ define("DONE_PARAGRAPH", " define("CMDOUT_PARA", " <p style='font-size: small;'> - <strong>Command output:</strong> (use the toggle icon to unveil detailed infos): + <strong>Command output</strong> (use the toggle icon to unveil detailed infos): + </p> + "); + +define("CMDOUT_PARA_WOHINT", " + <p style='font-size: small;'> + <strong>Command output:</strong> </p> "); diff --git a/packages/freenas/pkg/freenas_utils.inc b/packages/freenas/pkg/freenas_utils.inc index a18a9795..1e812412 100644 --- a/packages/freenas/pkg/freenas_utils.inc +++ b/packages/freenas/pkg/freenas_utils.inc @@ -579,7 +579,11 @@ function get_ata_disks_list() { /* Separe la ligne par les espace */ $dmesgtab = explode(" ", $dmesgline); $dmesgtab[0] = rtrim($dmesgtab[0],":"); - if ($dmesgtab[0]!="" &&(strcasecmp($dmesgtab[0],$diskname) == 0)) + /* When there is a wrong DMA cable, the first line is: + * ad0: DMA limited to UDMA33, controller found non-ATA66 cable + */ + if ($dmesgtab[0]!="" && (strcasecmp($dmesgtab[0],$diskname) == 0) && + strcmp($dmesgtab[1],"DMA") !=0) { $disklist[$diskname]['size'] = $dmesgtab[1]; } // end if } // end foreach diff --git a/packages/freenas/www/diag_raid_infos.php b/packages/freenas/www/diag_raid_infos.php index 88b9a5fc..ad1621c1 100644 --- a/packages/freenas/www/diag_raid_infos.php +++ b/packages/freenas/www/diag_raid_infos.php @@ -115,19 +115,39 @@ echo $pfSenseHead->getHTML(); <td align="left" valign="top"> <?php echo "<pre style=\"font-size: medium;\">"; - echo "<strong>Software RAID - gmirror status:</strong><br />"; + echo "<strong>" . gettext("Software RAID") . " - " . gettext("Geom Mirror") . ":</strong><br /><br />"; exec("/sbin/gmirror list",$rawdata); foreach ($rawdata as $line) { echo htmlspecialchars($line) . "<br />"; } unset ($line); unset ($rawdata); - echo "<strong>Software RAID - gvinum status:</strong><br />"; + echo "<strong>" . gettext("Software RAID") . " - " . gettext("Geom Vinum") . ":</strong><br /><br />"; exec("/sbin/gvinum list",$rawdata); foreach ($rawdata as $line) { - echo htmlspecialchars($line) . "<br>"; + echo htmlspecialchars($line) . "<br />"; + } + unset ($line); + unset ($rawdata); + echo "<strong>" . gettext("Software RAID") . " - " . gettext("Geom Concat") . ":</strong><br /><br />"; + exec("/sbin/gconcat list",$rawdata); + foreach ($rawdata as $line) { + echo htmlspecialchars($line) . "<br />"; + } + unset ($line); + unset ($rawdata); + echo "<strong>" . gettext("Software RAID") . " - " . gettext("Geom Stripe") . ":</strong><br /><br />"; + exec("/sbin/gstripe list",$rawdata); + foreach ($rawdata as $line) { + echo htmlspecialchars($line) . "<br />"; } unset ($line); + unset ($rawdata); + echo "<strong>" . gettext("Software RAID") . " - " . gettext("Geom Raid5") . ":</strong><br /><br />"; + exec("/sbin/graid5 list",$rawdata); + foreach ($rawdata as $line) { + echo htmlspecialchars($line) . "<br />"; + } echo "</pre>"; ?> </td> diff --git a/packages/freenas/www/disks_manage_init.php b/packages/freenas/www/disks_manage_init.php index 4f55aabe..e8d939d3 100644 --- a/packages/freenas/www/disks_manage_init.php +++ b/packages/freenas/www/disks_manage_init.php @@ -270,7 +270,12 @@ $a_gmirror = &$freenas_config['gmirror']['vdisk']; $a_gstripe = &$freenas_config['gstripe']['vdisk']; $a_graid5 = &$freenas_config['graid5']['vdisk']; $a_gvinum = &$freenas_config['gvinum']['vdisk']; -$all_disk = array_merge($a_disk,$a_gconcat,$a_gmirror,$a_gstripe,$a_graid5,$a_gvinum); + $a_alldisk = array_merge($a_disk, + $a_gconcat, + $a_gmirror, + $a_gstripe, + $a_graid5, + $a_gvinum); if (! empty($_POST)) { @@ -402,7 +407,7 @@ echo $pfSenseHead->getHTML(); function disk_change() { switch(document.iform.disk.value) { - <?php foreach ($a_disk as $diskv): ?> + <?php foreach ($a_alldisk as $diskv): ?> case "<?=$diskv['fullname'];?>": <?php $i = 0;?> <?php foreach ($a_fst as $fstval => $fstname): ?> @@ -448,7 +453,7 @@ function disk_change() { <td width="22%" valign="top" class="vncellreq"><?=gettext("Disk");?></td> <td width="78%" class="vtable"> <select name="disk" class="formselect" id="disk" onchange="disk_change();"> - <?php foreach ($all_disk as $diskv): ?> + <?php foreach ($a_alldisk as $diskv): ?> <option value="<?=$diskv['fullname'];?>" <?php if ($diskv['name'] == $disk) echo "selected=\selected\"";?>> <?php echo htmlspecialchars($diskv['name'] . ": " .$diskv['size'] . " (" . $diskv['desc'] . ")");?> <?php endforeach; ?> diff --git a/packages/freenas/www/disks_manage_tools.php b/packages/freenas/www/disks_manage_tools.php index 01438dab..0f5b1027 100644 --- a/packages/freenas/www/disks_manage_tools.php +++ b/packages/freenas/www/disks_manage_tools.php @@ -73,7 +73,7 @@ EOD; if($umount && $ismounted) { $diskinit_str = "<strong class='red'>" . gettext("Note") . ":</strong> " . gettext("The disk is currently mounted! The mount point will be removed temporary to perform selected command.") . "<br /><br />"; $retvalue .=<<<EOD - <div id="ismounted_out" style="display: none; font-family: Courier, monospace; font-size: small;"> + <div id="ismounted_out" style="font-family: Courier, monospace; font-size: small;"> <pre style="font-family: Courier, monospace; font-size: small; font-style: italic;">{$diskinit_str}</pre> </div> @@ -90,7 +90,7 @@ EOD; case "ufsgpt": case "ufsgpt_no_su": $button = create_toggle_button("Checking disk", "ufsgn_fsck_out"); - $cmd = "/sbin/fsck_ufs -y -f /dev/" . escapeshellarg($disk . $partition); + $cmd = "/sbin/fsck_ufs -y -f " . escapeshellarg($disk . $partition); $out = create_cmdout_container("ufsgn_fsck_out", $cmd); $retvalue .= assemble_cmdout($button, $out); break; @@ -107,7 +107,7 @@ EOD; break; case "msdos": $button = create_toggle_button("Checking disk", "dos_fsck_out"); - $cmd = "/sbin/fsck_msdosfs -y -f /dev/" . escapeshellarg($disk . $partition); + $cmd = "/sbin/fsck_msdosfs -y -f " . escapeshellarg($disk . $partition); $out = create_cmdout_container("dos_fsck_out", $cmd); $retvalue .= assemble_cmdout($button, $out); break; @@ -129,7 +129,37 @@ if (!is_array($freenas_config['disks']['disk'])) disks_sort(); -$a_disk = &$freenas_config['disks']['disk']; +if (!is_array($freenas_config['gvinum']['vdisk'])) + $freenas_config['gvinum']['vdisk'] = array(); + +gvinum_sort(); + +if (!is_array($freenas_config['gmirror']['vdisk'])) + $freenas_config['gmirror']['vdisk'] = array(); + +gmirror_sort(); + +if (!is_array($freenas_config['gconcat']['vdisk'])) + $freenas_config['gconcat']['vdisk'] = array(); + +gconcat_sort(); + +if (!is_array($freenas_config['gstripe']['vdisk'])) + $config['gstripe']['vdisk'] = array(); + +gstripe_sort(); + +if (!is_array($freenas_config['graid5']['vdisk'])) + $freenas_config['graid5']['vdisk'] = array(); + +graid5_sort(); + +$a_disk = array_merge($freenas_config['disks']['disk'], + $freenas_config['gvinum']['vdisk'], + $freenas_config['gmirror']['vdisk'], + $freenas_config['gconcat']['vdisk'], + $freenas_config['gstripe']['vdisk'], + $freenas_config['graid5']['vdisk']); if ($_POST) { unset($input_errors); @@ -189,6 +219,9 @@ function disk_change() { switch(document.iform.disk.value) { <?php foreach ($a_disk as $diskv): ?> + <?php if (strcmp($diskv['fstype'],"softraid")==0): ?> + <?php continue; ?> + <?php endif; ?> case "<?=$diskv['name'];?>": <?php $partinfo = disks_get_partition_info($diskv['name']);?> <?php foreach($partinfo as $partinfon => $partinfov): ?> @@ -233,7 +266,10 @@ function disk_change() { <td width="78%" class="vtable"> <select name="disk" class="formselect" id="disk" onchange="disk_change()"> <?php foreach ($a_disk as $diskn): ?> - <option value="<?=$diskn['name'];?>"<?php if ($diskn['name'] == $disk) echo "selected";?>> + <?php if (strcmp($diskn['fstype'],"softraid")==0): ?> + <?php continue; ?> + <?php endif; ?> + <option value="<?=$diskn['fullname'];?>"<?php if ($diskn['fullname'] == $disk) echo "selected=\"selected\"";?>> <?php echo htmlspecialchars($diskn['name'] . ": " .$diskn['size'] . " (" . $diskn['desc'] . ")");?> <?php endforeach; ?> </option> diff --git a/packages/freenas/www/disks_mount_tools.php b/packages/freenas/www/disks_mount_tools.php index 26e7471d..4f415b77 100644 --- a/packages/freenas/www/disks_mount_tools.php +++ b/packages/freenas/www/disks_mount_tools.php @@ -51,7 +51,7 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); function create_cmd_output(&$action, &$a_mount, &$fullname) { - $cmdout = CMDOUT_PARA; + $cmdout = CMDOUT_PARA_WOHINT; ob_end_flush(); |