summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-08-13 21:18:54 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-08-13 21:19:32 -0400
commitdd4be2d0bca2d45500f2cca66833478e9b4d11c8 (patch)
tree15bcf3ea8aa740d80eaee7812f188c3b06131ef5 /usr
parent120c21bd1661698ca8b597c899c13ed7d90469ae (diff)
downloadpfsense-dd4be2d0bca2d45500f2cca66833478e9b4d11c8.zip
pfsense-dd4be2d0bca2d45500f2cca66833478e9b4d11c8.tar.gz
Add installer_find_all_disks() which probes disks and returns an array of all disk info
Diffstat (limited to 'usr')
-rw-r--r--usr/local/www/installer.php78
1 files changed, 78 insertions, 0 deletions
diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php
index 978ce71..d7490c6 100644
--- a/usr/local/www/installer.php
+++ b/usr/local/www/installer.php
@@ -30,6 +30,8 @@
require("globals.inc");
require("guiconfig.inc");
+define('PC_SYSINSTALL', '/PCBSD/pc-sysinstall/pc-sysinstall');
+
// Handle other type of file systems
if($_REQUEST['fstype'])
$fstype = strtoupper($_REQUEST['fstype']);
@@ -126,6 +128,27 @@ function installer_find_first_disk() {
return $disk;
}
+// Return an array with all disks information.
+function installer_find_all_disks() {
+ global $g, $fstype;
+ $disk = split("\n", `/PCBSD/pc-sysinstall/pc-sysinstall disk-list`);
+ $disks_array = array();
+ foreach($disk as $d) {
+ $disks_info = split(":", $d);
+ $tmp_array = array();
+ $disk_info = split("\n", `/PCBSD/pc-sysinstall/pc-sysinstall disk-info {$disks_info[0]}`);
+ foreach($disk_info as $di) {
+ $di_s = split("=", $di);
+ if($di_s[0])
+ $tmp_array[$di_s[0]] = $di_s[1];
+ }
+ $tmp_array['disk'] = trim($disks_info[0]);
+ $tmp_array['desc'] = trim(htmlentities($disks_info[1]));
+ $disks_array[] = $tmp_array;
+ }
+ return $disks_array;
+}
+
function update_installer_status() {
global $g, $fstype;
// Ensure status files exist
@@ -456,6 +479,57 @@ EOF;
}
+function installer_custom() {
+ global $g, $fstype;
+ if(file_exists("/tmp/.pc-sysinstall/pc-sysinstall.log"))
+ unlink("/tmp/.pc-sysinstall/pc-sysinstall.log");
+ head_html();
+ body_html();
+ // Only enable ZFS if this exists. The install will fail otherwise.
+ if(file_exists("/boot/gptzfsboot"))
+ $zfs_enabled = "or <a href=\"installer.php?state=quickeasyinstall&fstype=ZFS\">ZFS</a> ";
+ $disk = installer_find_first_disk();
+ if(!$disk)
+ echo gettext("WARNING: Could not find any suitable disks for installation.");
+ page_table_start();
+ echo <<<EOF
+ <form action="installer.php" method="post" state="step1_post">
+ <div id="mainlevel">
+ <center>
+ <b><font face="arial" size="+2">Welcome to the {$g['product_name']} PCSysInstaller!</b></font><p/>
+ <font face="arial" size="+1">This utility will install {$g['product_name']} to a hard disk, flash drive, etc.</font>
+ <table width="100%" border="0" cellpadding="5" cellspacing="0">
+ <tr>
+ <td>
+ <center>
+ <div id="mainarea">
+ <br/>
+ <center>
+ Please select an installer option to begin:
+ <table width="100%" border="0" cellpadding="5" cellspacing="5">
+ <tr>
+ <td>
+ <div id="pfsenseinstaller">
+ <center>
+ Rescue config.xml<p/>
+ Install {$g['product_name']} using the <a href="installer.php?state=quickeasyinstall">UFS</a>
+ {$zfs_enabled}
+ filesystem.
+ </p>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+EOF;
+ page_table_end();
+ end_html();
+}
+
function installer_main() {
global $g, $fstype;
if(file_exists("/tmp/.pc-sysinstall/pc-sysinstall.log"))
@@ -507,4 +581,8 @@ EOF;
end_html();
}
+echo "<pre>";
+print_r(installer_find_all_disks());
+echo "</pre>";
+
?>
OpenPOWER on IntegriCloud