From 7d3cd9bd6dffa3d072d65fb8d23a0682e9e06061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:41:28 -0300 Subject: [PATCH] fix(netboot): use the HTTP tftp alias --- perl-xCAT/xCAT/DHCP/BootPolicy.pm | 6 +++--- xCAT-server/lib/xcat/plugins/mknb.pm | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/DHCP/BootPolicy.pm b/perl-xCAT/xCAT/DHCP/BootPolicy.pm index ba33b89b6..3c6c976ef 100644 --- a/perl-xCAT/xCAT/DHCP/BootPolicy.pm +++ b/perl-xCAT/xCAT/DHCP/BootPolicy.pm @@ -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", diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index c4b77db11..891310e2d 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -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";