diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 04eeeca6c..9733b57a1 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -2450,10 +2450,10 @@ sub addnet my $mask = shift; my $nic; my $domain; - my $httpport="80"; + my $httpport=""; my @hports=xCAT::TableUtils->get_site_attribute("httpport"); - if ($hports[0]){ - $httpport=$hports[0]; + if ($hports[0] and $hports[0] ne "80"){ + $httpport=":".$hports[0]; } my $firstoctet = $net; $firstoctet =~ s/^(\d+)\..*/$1/; @@ -2781,6 +2781,8 @@ sub addnet push @netent, " filename = \"http://$tftp$httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . "\";\n"; push @netent, " } else if option user-class-identifier = \"xNBA\" and option client-architecture = 00:09 { #x86, xCAT Network Boot Agent\n"; push @netent, " filename = \"http://$tftp$httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . ".uefi\";\n"; + push @netent, " } else if option user-class-identifier = \"xNBA\" and option client-architecture = 00:07 { #x86, xCAT Network Boot Agent\n"; + push @netent, " filename = \"http://$tftp$httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . ".uefi\";\n"; push @netent, " } else if option client-architecture = 00:00 { #x86\n"; push @netent, " filename \"xcat/xnba.kpxe\";\n"; push @netent, " } else if option vendor-class-identifier = \"Etherboot-5.4\" { #x86\n"; diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index 02a3a39c5..37a19be90 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -46,10 +46,10 @@ sub process_request { $xcatdport = $t_entry; } - my $httpport="80"; + my $httpport=""; my @hports=xCAT::TableUtils->get_site_attribute("httpport"); - if ($hports[0]){ - $httpport=$hports[0]; + if ($hports[0] and $hports[0] ne "80"){ + $httpport=":" . $hports[0]; } @entries = xCAT::TableUtils->get_site_attribute("dhcpinterfaces"); @@ -315,15 +315,15 @@ sub process_request { open($cfg, ">", "$tftpdir/xcat/xnba/nets/$net"); print $cfg "#!gpxe\n"; if ($invisibletouch) { - print $cfg 'imgfetch -n kernel http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.kernel.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline BOOTIF=01-" . '${netX/machyp}' . "\n"; + print $cfg 'imgfetch -n kernel http://${next-server}'.$httpport.'/tftpboot/xcat/genesis.kernel.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline BOOTIF=01-" . '${netX/mac:hexhyp}' . "\n"; if ($lzma_exit_value) { - print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.gz\n"; + print $cfg 'imgfetch -n nbfs http://${next-server}'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.gz\n"; } else { - print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.lzma\n"; + print $cfg 'imgfetch -n nbfs http://${next-server}'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.lzma\n"; } } else { - print $cfg 'imgfetch -n kernel http://${next-server}:'.$httpport.'/tftpboot/xcat/nbk.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline\n"; - print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport.'/tftpboot/xcat/nbfs.' . "$arch.gz\n"; + print $cfg 'imgfetch -n kernel http://${next-server}'.$httpport.'/tftpboot/xcat/nbk.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline\n"; + print $cfg 'imgfetch -n nbfs http://${next-server}'.$httpport.'/tftpboot/xcat/nbfs.' . "$arch.gz\n"; } print $cfg "imgload kernel\n"; print $cfg "imgexec kernel\n"; @@ -343,7 +343,14 @@ sub process_request { close($cfg); open($cfg, ">", "$tftpdir/xcat/xnba/nets/$net.uefi"); print $cfg "#!gpxe\n"; - print $cfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nets/' . "$net.elilo\n"; + print $cfg 'imgfetch -n kernel http://${next-server}'.$httpport.'/tftpboot/xcat/genesis.kernel.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline initrd=nbfs BOOTIF=01-" . '${netX/mac:hexhyp}' . "\n"; + if ($lzma_exit_value) { + print $cfg 'imgfetch -n nbfs http://${next-server}'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.gz\n"; + } else { + print $cfg 'imgfetch -n nbfs http://${next-server}'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.lzma\n"; + } + print $cfg "imgload kernel\n"; + print $cfg "imgexec kernel\n"; close($cfg); } } elsif ($arch =~ /ppc/) { @@ -351,8 +358,8 @@ sub process_request { print $cfgfile "default \"xCAT Genesis (" . $normnets->{$_} . ")\"\n"; print $cfgfile " delay=10\n"; print $cfgfile " label \"xCAT Genesis (" . $normnets->{$_} . ")\"\n"; - print $cfgfile " kernel http://" . $normnets->{$_} . ":$httpport/$tftpdir/xcat/genesis.kernel.$arch\n"; - print $cfgfile " initrd http://" . $normnets->{$_} . ":$httpport/$initrd_file\n"; + print $cfgfile " kernel http://" . $normnets->{$_} . "$httpport/$tftpdir/xcat/genesis.kernel.$arch\n"; + print $cfgfile " initrd http://" . $normnets->{$_} . "$httpport/$initrd_file\n"; print $cfgfile ' append "quiet xcatd=' . $normnets->{$_} . ":$xcatdport $consolecmdline\"\n"; close($cfgfile); } @@ -389,8 +396,8 @@ sub process_request { print $cfgfile "default \"xCAT Genesis (" . $normnets->{$_} . ")\"\n"; print $cfgfile " delay=10\n"; print $cfgfile " label \"xCAT Genesis (" . $normnets->{$_} . ")\"\n"; - print $cfgfile " kernel http://" . $hexnets->{$_} . ":$httpport/$tftpdir/xcat/genesis.kernel.$arch\n"; - print $cfgfile " initrd http://" . $hexnets->{$_} . ":$httpport/$initrd_file\n"; + print $cfgfile " kernel http://" . $hexnets->{$_} . "$httpport/$tftpdir/xcat/genesis.kernel.$arch\n"; + print $cfgfile " initrd http://" . $hexnets->{$_} . "$httpport/$initrd_file\n"; print $cfgfile ' append "quiet xcatd=' . $hexnets->{$_} . ":$xcatdport $consolecmdline\"\n"; close($cfgfile); }