Revision 60e70198
Added by Scott Ullrich over 14 years ago
usr/local/www/installer/installer.php | ||
---|---|---|
54 | 54 |
case "verify_before_install": |
55 | 55 |
verify_before_install(); |
56 | 56 |
exit; |
57 |
case "easy_install_ufs": |
|
58 |
easy_install("UFS+S"); |
|
59 |
exit; |
|
60 |
case "easy_install_ufs": |
|
61 |
easy_install("ZFS"); |
|
62 |
exit; |
|
63 |
|
|
57 | 64 |
default: |
58 | 65 |
installer_main(); |
59 | 66 |
} |
60 | 67 |
|
68 |
function easy_install($fstype = "UFS+S") { |
|
69 |
// Calculate swap and disk sizes |
|
70 |
$disks = installer_find_all_disks(); |
|
71 |
$memory = get_memory(); |
|
72 |
$swap_size = $memory[0] * 2; |
|
73 |
$first_disk = trim(installer_find_first_disk()); |
|
74 |
$disk_info = pcsysinstall_get_disk_info($first_disk); |
|
75 |
$size = $disk_info['size']; |
|
76 |
$first_disk_size = $size - $swap_size; |
|
77 |
$disk_setup = array(); |
|
78 |
$tmp_array = array(); |
|
79 |
// Build the disk layout for / |
|
80 |
$tmp_array['disk'] = $first_disk; |
|
81 |
$tmp_array['size'] = $first_disk_size; |
|
82 |
$tmp_array['mountpoint'] = "/"; |
|
83 |
$tmp_array['fstype'] = $fstype; |
|
84 |
$disk_setup[] = $tmp_array; |
|
85 |
// Build the disk layout for SWAP |
|
86 |
$tmp_array['disk'] = $first_disk; |
|
87 |
$tmp_array['size'] = $swap_size; |
|
88 |
$tmp_array['mountpoint'] = "none"; |
|
89 |
$tmp_array['fstype'] = "SWAP"; |
|
90 |
$disk_setup[] = $tmp_array; |
|
91 |
unset($tmp_array); |
|
92 |
$bootmanager = "bsd"; |
|
93 |
file_put_contents("/tmp/webInstaller_disk_layout.txt", serialize($disk_setup)); |
|
94 |
file_put_contents("/tmp/webInstaller_disk_bootmanager.txt", serialize($bootmanager)); |
|
95 |
Header("Location: installer.php?state=verify_before_install"); |
|
96 |
exit; |
|
97 |
} |
|
98 |
|
|
61 | 99 |
function write_out_pc_sysinstaller_config($disks, $bootmanager = "bsd") { |
62 | 100 |
$diskareas = ""; |
63 | 101 |
$fd = fopen("/usr/sbin/pc-sysinstall/examples/pfSense-install.cfg", "w"); |
... | ... | |
452 | 490 |
$bootmanager = unserialize(file_get_contents("/tmp/webInstaller_disk_bootmanager.txt")); |
453 | 491 |
$restored_layout_from_file = true; |
454 | 492 |
$restored_layout_txt = "The previous disk layout was restored from disk"; |
493 |
} else { |
|
494 |
$disks = array(); |
|
455 | 495 |
} |
456 | 496 |
if(!$bootmanager) |
457 | 497 |
$bootmanager = $_REQUEST['bootmanager']; |
458 | 498 |
echo "\n<!--" . print_r($_REQUEST, true) . " -->\n"; |
459 | 499 |
$disk = pcsysinstall_get_disk_info(htmlspecialchars($_REQUEST['disk'])); |
460 | 500 |
$disksize = format_bytes($disk['size'] * 1048576); |
461 |
$disks = array(); |
|
462 | 501 |
// Loop through posted items and create an array |
463 | 502 |
for($x=0; $x<99; $x++) { // XXX: Make this more optimal |
464 | 503 |
if(!$_REQUEST['fstype' . $x]) |
... | ... | |
1034 | 1073 |
body_html(); |
1035 | 1074 |
$disk = installer_find_first_disk(); |
1036 | 1075 |
// Only enable ZFS if this exists. The install will fail otherwise. |
1037 |
// if(file_exists("/boot/gptzfsboot"))
|
|
1038 |
// $zfs_enabled = "<tr bgcolor=\"#9A9A9A\"><td align=\"center\"><a href=\"installer.php?state=verify_before_install&fstype0=ZFS&size=200M\">Easy installation of {$g['product_name']} using the ZFS filesystem on disk {$disk}</a></td></tr>";
|
|
1076 |
if(file_exists("/boot/gptzfsboot")) |
|
1077 |
$zfs_enabled = "<tr bgcolor=\"#9A9A9A\"><td align=\"center\"><a href=\"installer.php?state=easy_install_zfs\">Easy installation of {$g['product_name']} using the ZFS filesystem on disk {$disk}</a></td></tr>";
|
|
1039 | 1078 |
page_table_start(); |
1040 | 1079 |
echo <<<EOF |
1041 | 1080 |
<form action="installer.php" method="post" state="step1_post"> |
... | ... | |
1068 | 1107 |
|
1069 | 1108 |
<table cellspacing="5" cellpadding="5" style="border: 1px dashed;"> |
1070 | 1109 |
<tr bgcolor="#CECECE"><td align="center"> |
1071 |
<!-- |
|
1072 |
<a href="installer.php?state=verify_before_install&disk={$disk}&fstype=UFS&swapsize=200M">Easy installation of {$g['product_name']} using the UFS filesystem on disk {$disk}</a> |
|
1073 |
--> |
|
1110 |
<a href="installer.php?state=easy_install_ufs">Easy installation of {$g['product_name']} using the UFS filesystem on disk {$disk}</a> |
|
1074 | 1111 |
</td></tr> |
1075 | 1112 |
{$zfs_enabled} |
1076 | 1113 |
<tr bgcolor="#AAAAAA"><td align="center"> |
Also available in: Unified diff
Add back easy install options for UFS and ZFS