58 |
58 |
installer_main();
|
59 |
59 |
}
|
60 |
60 |
|
61 |
|
function write_out_pc_sysinstaller_config($disk, $fstype = "UFS+S", $swapsize = false) {
|
|
61 |
function write_out_pc_sysinstaller_config($disk, $fstype = "UFS+S", $swapsize = false, $encryption = false, $encpass = "") {
|
62 |
62 |
$fd = fopen("/usr/sbin/pc-sysinstall/examples/pfSense-install.cfg", "w");
|
63 |
63 |
if(!$fd) {
|
64 |
64 |
return true;
|
... | ... | |
87 |
87 |
# All sizes are expressed in MB
|
88 |
88 |
# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP
|
89 |
89 |
# Size 0 means use the rest of the slice size
|
|
90 |
# Alternatively, you can append .eli to any of
|
|
91 |
# the above filesystem types to encrypt that disk.
|
|
92 |
# If you with to use a passphrase with this
|
|
93 |
# encrypted partition, on the next line
|
|
94 |
# the flag "encpass=" should be entered:
|
|
95 |
# encpass=mypass
|
90 |
96 |
{$diskareas}
|
91 |
97 |
|
92 |
98 |
# Do it now!
|
... | ... | |
307 |
313 |
$fstype = htmlspecialchars(strtoupper($_REQUEST['fstype']));
|
308 |
314 |
else
|
309 |
315 |
$fstype = "UFS+S";
|
310 |
|
write_out_pc_sysinstaller_config($disk, $fstype);
|
|
316 |
if(substr($_REQUEST['fstype'], -4, 4) == ".eli") {
|
|
317 |
$encryption = true;
|
|
318 |
if($_REQUEST['encpass'])
|
|
319 |
$encpass = $_REQUEST['encpass'];
|
|
320 |
else
|
|
321 |
$encpass = "";
|
|
322 |
} else {
|
|
323 |
$encryption = false;
|
|
324 |
$encpass = "";
|
|
325 |
}
|
|
326 |
write_out_pc_sysinstaller_config($disk, $fstype, $encryption, $encpass);
|
311 |
327 |
update_installer_status_win(sprintf(gettext("Beginning installation on disk %s."),$disk));
|
312 |
328 |
start_installation();
|
313 |
329 |
}
|
... | ... | |
642 |
658 |
$custom_txt .= "</select></td></tr>\n";
|
643 |
659 |
// XXX: Convert to rowhelper. Add Ajax callbacks to verify sizes, etc.
|
644 |
660 |
// Prepare disk types
|
645 |
|
$custom_txt .= "<tr><td align='right'><b>Filesystem type:</td><td><select name='fstype'>\n";
|
|
661 |
$custom_txt .= "<tr><td align='right'><b>Filesystem type:</td><td><select onChange='onfstypeChange()' name='fstype'>\n";
|
646 |
662 |
$custom_txt .= "<option value='UFS'>UFS</option>\n";
|
647 |
663 |
$custom_txt .= "<option value='UFS+S'>UFS + Softupdates</option>\n";
|
|
664 |
$custom_txt .= "<option value='UFS.eli'>Encrypted UFS</option>\n";
|
|
665 |
$custom_txt .= "<option value='UFS+S.eli'>Encrypted UFS + Softupdates</option>\n";
|
648 |
666 |
$release = php_uname("r");
|
649 |
667 |
$release = $release[0];
|
650 |
|
if($release == "9")
|
|
668 |
if($release == "9") {
|
651 |
669 |
$custom_txt .= "<option value='UFS+J'>UFS + Journaling</option>\n";
|
652 |
|
if(file_exists("/boot/gptzfsboot"))
|
|
670 |
$custom_txt .= "<option value='UFS+J.eli'>Encrypted UFS + Journaling</option>\n";
|
|
671 |
}
|
|
672 |
if(file_exists("/boot/gptzfsboot")) {
|
653 |
673 |
$custom_txt .= "<option value='ZFS'>ZFS</option>\n";
|
654 |
|
$custom_txt .= "</select>\n</td></tr></table><p/>";
|
|
674 |
$custom_txt .= "<option value='ZFS.eli'>Encrypted ZFS</option>\n";
|
|
675 |
}
|
|
676 |
$custom_txt .= "</select>\n";
|
|
677 |
$custom_txt .= "</td></tr>";
|
|
678 |
$custom_txt .= "<tr><td align='right'>Disk encryption password:</td><td>";
|
|
679 |
$custom_txt .= "<input name='encpass' id='encpass'>";
|
|
680 |
$custom_txt .= "</td></tr></table><p/>";
|
655 |
681 |
}
|
656 |
682 |
echo <<<EOF
|
657 |
683 |
<script type="text/javascript">
|
... | ... | |
664 |
690 |
</div>
|
665 |
691 |
<script type="text/javascript">
|
666 |
692 |
\$('contentdiv').appear();
|
|
693 |
// Start out with this option disabled.
|
|
694 |
\$('encpass').disabled = 1;
|
|
695 |
function onfstypeChange() {
|
|
696 |
var fstype = $V('fstype');
|
|
697 |
if(fstype.substring(fstype.length - 4, 4) == ".eli")
|
|
698 |
\$('encpass').disabled = 0;
|
|
699 |
else
|
|
700 |
\$('encpass').disabled = 1;
|
|
701 |
}
|
667 |
702 |
</script>
|
668 |
703 |
</center>
|
669 |
704 |
</td></tr>
|
Add newline after 99 menu option. Otherwise it looks very strange.