2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-04 12:07:56 +00:00

fix(netboot): use the HTTP tftp alias

This commit is contained in:
Vinícius Ferrão
2026-08-26 18:41:28 -03:00
parent 36c5d6d434
commit 7d3cd9bd6d
2 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -76,6 +76,7 @@ sub kea_httpboot_network_classes {
my $portsuffix = ( $httpport eq '80' ) ? '' : ":$httpport";
my $tftpdir = $opts{tftpdir} || '/tftpboot';
$tftpdir =~ s{/+$}{};
my $http_tftp_root = '/tftpboot';
my $present = $opts{loader_present};
my @classes;
@@ -88,7 +89,7 @@ sub kea_httpboot_network_classes {
name => $name,
test => "option[93].hex == $spec->{arch_id}",
additional_only => 1,
'boot-file-name' => "http://$opts{next_server}$portsuffix$tftpdir/$spec->{loader}",
'boot-file-name' => "http://$opts{next_server}$portsuffix$http_tftp_root/$spec->{loader}",
'option-data' => [
{
name => 'vendor-class-identifier',
@@ -107,7 +108,6 @@ sub isc_client_architecture_lines {
my $tftp = $opts{next_server} // '';
my $portsuffix = $opts{portsuffix} // '';
my $tftpdir = $opts{tftpdir} // '/tftpboot';
my $net = $opts{net} // '';
my $maskbits = $opts{prefix} // '';
@@ -135,7 +135,7 @@ sub isc_client_architecture_lines {
" filename \"boot/grub2/grub2.riscv64\";\n",
" } else if option client-architecture = 00:1c { #riscv64 uefi http boot\n ",
" option vendor-class-identifier \"HTTPClient\";\n",
" filename \"http://$tftp$portsuffix$tftpdir/boot/grub2/grub2.riscv64\";\n",
" filename \"http://$tftp$portsuffix/tftpboot/boot/grub2/grub2.riscv64\";\n",
" } else if option client-architecture = 00:0e { #OPAL-v3\n ",
" option conf-file = \"http://$tftp$portsuffix/tftpboot/pxelinux.cfg/p/${net}_${maskbits}\";\n",
" } else if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { #for onie on cumulus switch\n",
+3 -2
View File
@@ -899,6 +899,7 @@ sub _write_grub2_discovery_config {
# node that does not serve the TFTP root over HTTP.
my $httpport = $args{httpport} || '80';
my $httproot = 'http,' . $args{xcatd_address} . ($httpport eq '80' ? '' : ":$httpport");
my $http_tftp_root = '/tftpboot';
my $tftproot = 'tftp,' . $args{xcatd_address};
my $content = "# xCAT Genesis discovery for network $hexnet - generated by mknb, do not edit\n";
$content .= "set default=0\n";
@@ -914,8 +915,8 @@ sub _write_grub2_discovery_config {
$content .= " insmod http\n";
$content .= " insmod tftp\n";
$content .= " set root=$httproot\n";
$content .= " linux $tftpdir/$kernel $cmdline BOOTIF=\$net_default_mac\n";
$content .= " initrd $tftpdir/$initrd\n";
$content .= " linux $http_tftp_root/$kernel $cmdline BOOTIF=\$net_default_mac\n";
$content .= " initrd $http_tftp_root/$initrd\n";
$content .= "}\n";
$content .= "menuentry \"xCAT Genesis $arch (TFTP)\" {\n";
$content .= " insmod tftp\n";