dhcp: support ipxe; closes #5385

Suggested by: @alex-s-team
This commit is contained in:
Franco Fichtner 2022-04-08 13:55:07 +02:00
parent 09e68888b4
commit 1b7ab40ce4
2 changed files with 12 additions and 2 deletions

View File

@ -1091,6 +1091,13 @@ EOD;
'00:0b' => 'filename64arm',
];
if (!empty($dhcpifconf['filenameipxe'])) {
$dhcpdconf .= " if exists user-class and option user-class = \"iPXE\" {\n";
$dhcpdconf .= " filename \"{$dhcpifconf['filenameipxe']}\";\n";
$dhcpdconf .= " }";
$conditional = true;
}
foreach ($filemap as $arch => $file) {
if (empty($dhcpifconf[$file])) {
continue;
@ -1103,6 +1110,7 @@ EOD;
$conditional = true;
}
if ($conditional) {
if (!empty($dhcpifconf['filename'])) {
$dhcpdconf .= " else {\n";

View File

@ -58,7 +58,7 @@ $config_copy_fieldsnames = array('enable', 'staticarp', 'failover_peerip', 'fail
'defaultleasetime', 'maxleasetime', 'gateway', 'domain', 'domainsearchlist', 'denyunknown','ignoreuids', 'ddnsdomain',
'ddnsdomainprimary', 'ddnsdomainkeyname', 'ddnsdomainkey', 'ddnsdomainalgorithm', 'ddnsupdate', 'mac_allow',
'mac_deny', 'tftp', 'bootfilename', 'ldap', 'netboot', 'nextserver', 'filename', 'filename32', 'filename64',
'filename32arm', 'filename64arm', 'rootpath', 'netmask', 'numberoptions', 'interface_mtu', 'wpad', 'omapi', 'omapiport',
'filename32arm', 'filename64arm', 'filenameipxe', 'rootpath', 'netmask', 'numberoptions', 'interface_mtu', 'wpad', 'omapi', 'omapiport',
'omapialgorithm', 'omapikey', 'minsecs');
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
@ -988,8 +988,10 @@ include("head.inc");
<input name="filename32arm" type="text" id="filename32arm" value="<?=$pconfig['filename32arm'];?>" /><br />
<?=gettext('Set ARM UEFI (64-bit) filename');?>
<input name="filename64arm" type="text" id="filename64arm" value="<?=$pconfig['filename64arm'];?>" /><br />
<?=gettext('Set iPXE boot filename');?>
<input name="filenameipxe" type="text" id="filenameipxe" value="<?=$pconfig['filenameipxe'];?>" /><br />
<?= gettext('You need both a filename and a boot server configured for this to work.') ?><br/>
<br/><br/>
<br/>
<?=gettext('Set root-path string');?>
<input name="rootpath" type="text" id="rootpath" size="90" value="<?=$pconfig['rootpath'];?>" /><br />
<?=gettext("Note: string-format: iscsi:(servername):(protocol):(port):(LUN):targetname");?>