diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 978ce71a85..d7490c6eb2 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 ZFS "; + $disk = installer_find_first_disk(); + if(!$disk) + echo gettext("WARNING: Could not find any suitable disks for installation."); + page_table_start(); + echo << +
+
+ Welcome to the {$g['product_name']} PCSysInstaller!

+ This utility will install {$g['product_name']} to a hard disk, flash drive, etc. + + + + +
+
+
+
+
+ Please select an installer option to begin: + + + + +
+
+
+ Rescue config.xml

+ Install {$g['product_name']} using the UFS + {$zfs_enabled} + filesystem. +

+
+
+
+
+

+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 "
";
+print_r(installer_find_all_disks());
+echo "
"; + ?>