mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +00:00 
			
		
		
		
	support site.httpport in nodeset and mknb
This commit is contained in:
		| @@ -859,11 +859,17 @@ sub mkinstall { | ||||
|                 $instserver = '!myipfn!'; | ||||
|             } | ||||
|  | ||||
|             my $httpport="80"; | ||||
|             my @hports=xCAT::TableUtils->get_site_attribute("httpport"); | ||||
|             if ($hports[0]){ | ||||
|                 $httpport=$hports[0]; | ||||
|             } | ||||
|  | ||||
|             if ($ent and $ent->{nfsserver}) { | ||||
|                 $instserver = $ent->{nfsserver}; | ||||
|             } | ||||
|  | ||||
|             my $kcmdline = "nofb utf8 auto url=http://" . $instserver . "/install/autoinst/" . $node; | ||||
|             my $kcmdline = "nofb utf8 auto url=http://" . $instserver . ":$httpport/install/autoinst/" . $node; | ||||
|  | ||||
|             $kcmdline .= " xcatd=" . $instserver; | ||||
|             $kcmdline .= " mirror/http/hostname=" . $instserver; | ||||
| @@ -927,7 +933,7 @@ sub mkinstall { | ||||
|  | ||||
|             #from 12.10, the live install changed, so add the live-installer | ||||
|             if (-r "$pkgdir/install/filesystem.squashfs") { | ||||
|                 $kcmdline .= " live-installer/net-image=http://${instserver}${pkgdir}/install/filesystem.squashfs"; | ||||
|                 $kcmdline .= " live-installer/net-image=http://${instserver}:$httpport${pkgdir}/install/filesystem.squashfs"; | ||||
|             } | ||||
|  | ||||
|             xCAT::MsgUtils->trace($verbose_on_off, "d", "debian->mkinstall: kcmdline=$kcmdline kernal=$rtftppath/vmlinuz initrd=$rtftppath/initrd.img"); | ||||
| @@ -1326,7 +1332,7 @@ sub mknetboot | ||||
|                     $kcmdline = "NFSROOT=$nfssrv:$nfsdir STATEMNT="; | ||||
|                 } | ||||
|             } else { | ||||
|                 $kcmdline = "imgurl=http://$imgsrv/$rootimgdir/rootimg-statelite.gz STATEMNT="; | ||||
|                 $kcmdline = "imgurl=http://$imgsrv:$httpport/$rootimgdir/rootimg-statelite.gz STATEMNT="; | ||||
|             } | ||||
|  | ||||
|  | ||||
| @@ -1384,7 +1390,7 @@ sub mknetboot | ||||
|         else | ||||
|         { | ||||
|             $kcmdline = | ||||
|               "imgurl=http://$imgsrv/$rootimgdir/$compressedrootimg "; | ||||
|               "imgurl=http://$imgsrv:$httpport/$rootimgdir/$compressedrootimg "; | ||||
|             $kcmdline .= "XCAT=$xcatmaster:$xcatdport "; | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -46,6 +46,12 @@ sub process_request { | ||||
|         $xcatdport = $t_entry; | ||||
|     } | ||||
|  | ||||
|     my $httpport="80"; | ||||
|     my @hports=xCAT::TableUtils->get_site_attribute("httpport"); | ||||
|     if ($hports[0]){ | ||||
|         $httpport=$hports[0]; | ||||
|     } | ||||
|  | ||||
|     @entries = xCAT::TableUtils->get_site_attribute("dhcpinterfaces"); | ||||
|     $t_entry = $entries[0]; | ||||
|     if (defined($t_entry)) { | ||||
| @@ -289,15 +295,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}/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/machyp}' . "\n"; | ||||
|                 if ($lzma_exit_value) { | ||||
|                     print $cfg 'imgfetch -n nbfs http://${next-server}/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}/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}/tftpboot/xcat/nbk.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline\n"; | ||||
|                 print $cfg 'imgfetch -n nbfs http://${next-server}/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"; | ||||
| @@ -317,7 +323,7 @@ sub process_request { | ||||
|                 close($cfg); | ||||
|                 open($cfg, ">", "$tftpdir/xcat/xnba/nets/$net.uefi"); | ||||
|                 print $cfg "#!gpxe\n"; | ||||
|                 print $cfg 'chain http://${next-server}/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nets/' . "$net.elilo\n"; | ||||
|                 print $cfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nets/' . "$net.elilo\n"; | ||||
|                 close($cfg); | ||||
|             } | ||||
|         } elsif ($arch =~ /ppc/) { | ||||
| @@ -325,8 +331,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->{$_} . ":80/$tftpdir/xcat/genesis.kernel.$arch\n"; | ||||
|             print $cfgfile "   initrd http://" . $normnets->{$_} . ":80/$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); | ||||
|         } | ||||
| @@ -363,8 +369,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->{$_} . ":80/$tftpdir/xcat/genesis.kernel.$arch\n"; | ||||
|             print $cfgfile "   initrd http://" . $hexnets->{$_} . ":80/$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); | ||||
|         } | ||||
|   | ||||
| @@ -459,7 +459,7 @@ sub mknetboot | ||||
|                     $kcmdline = "NFSROOT=$nfssrv:$nfsdir STATEMNT="; | ||||
|                 } | ||||
|             } else { | ||||
|                 $kcmdline = "imgurl=$httpmethod://$imgsrv/$rootimgdir/rootimg-statelite.gz STATEMNT="; | ||||
|                 $kcmdline = "imgurl=$httpmethod://$imgsrv:$httpport/$rootimgdir/rootimg-statelite.gz STATEMNT="; | ||||
|             } | ||||
|  | ||||
|             # add support for subVars in the value of "statemnt" | ||||
| @@ -512,7 +512,7 @@ sub mknetboot | ||||
|         else | ||||
|         { | ||||
|             $kcmdline = | ||||
|               "imgurl=$httpmethod://$imgsrv/$rootimgdir/$compressedrootimg "; | ||||
|               "imgurl=$httpmethod://$imgsrv:$httpport/$rootimgdir/$compressedrootimg "; | ||||
|         } | ||||
|         $kcmdline .= "XCAT=$xcatmaster:$xcatdport quiet "; | ||||
|  | ||||
|   | ||||
| @@ -111,6 +111,12 @@ sub setstate { | ||||
|     my $imgaddkcmdline = $linuximghashref->{'addkcmdline'}; | ||||
|     my $imgboottarget = $linuximghashref->{'boottarget'}; | ||||
|  | ||||
|     my $httpport="80"; | ||||
|      my @hports=xCAT::TableUtils->get_site_attribute("httpport"); | ||||
|      if ($hports[0]){ | ||||
|          $httpport=$hports[0]; | ||||
|      } | ||||
|  | ||||
|     # get kernel and initrd from boottarget table | ||||
|     my $bttab; | ||||
|     my $btentry; | ||||
| @@ -246,8 +252,8 @@ sub setstate { | ||||
|             my $kernel; | ||||
|             ($kernel, $hypervisor) = split /!/, $kern->{kernel}; | ||||
|             print $pcfg " set 209:string xcat/xnba/nodes/$node.pxelinux\n"; | ||||
|             print $pcfg " set 210:string http://" . '${next-server}' . "/tftpboot/\n"; | ||||
|             print $pcfg " imgfetch -n pxelinux.0 http://" . '${next-server}' . "/tftpboot/xcat/pxelinux.0\n"; | ||||
|             print $pcfg " set 210:string http://" . '${next-server}'. ':' . $httpport . "/tftpboot/\n"; | ||||
|             print $pcfg " imgfetch -n pxelinux.0 http://" . '${next-server}' . ':' . $httpport . "/tftpboot/xcat/pxelinux.0\n"; | ||||
|             print $pcfg " imgload pxelinux.0\n"; | ||||
|             print $pcfg " imgexec pxelinux.0\n"; | ||||
|             close($pcfg); | ||||
| @@ -257,8 +263,8 @@ sub setstate { | ||||
|         } else { | ||||
|             if ($kern->{kernel} =~ /\.c32\z/ or $kern->{kernel} =~ /memdisk\z/) { #gPXE comboot support seems insufficient, chain pxelinux instead | ||||
|                 print $pcfg " set 209:string xcat/xnba/nodes/$node.pxelinux\n"; | ||||
|                 print $pcfg " set 210:string http://" . '${next-server}' . "/tftpboot/\n"; | ||||
|                 print $pcfg " imgfetch -n pxelinux.0 http://" . '${next-server}' . "/tftpboot/xcat/pxelinux.0\n"; | ||||
|                 print $pcfg " set 210:string http://" . '${next-server}' . ':' . $httpport . "/tftpboot/\n"; | ||||
|                 print $pcfg " imgfetch -n pxelinux.0 http://" . '${next-server}' . ':' . $httpport . "/tftpboot/xcat/pxelinux.0\n"; | ||||
|                 print $pcfg " imgload pxelinux.0\n"; | ||||
|                 print $pcfg " imgexec pxelinux.0\n"; | ||||
|                 close($pcfg); | ||||
| @@ -286,11 +292,11 @@ sub setstate { | ||||
|                         $kern->{kcmdline} =~ s/xcat\/netboot/\/tftpboot\/xcat\/netboot/; | ||||
|                     } | ||||
|                     print $ucfg "#!gpxe\n"; | ||||
|                     print $ucfg 'chain http://${next-server}/tftpboot/xcat/esxboot-x64.efi ' . $kern->{kcmdline} . "\n"; | ||||
|                     print $ucfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/esxboot-x64.efi ' . $kern->{kcmdline} . "\n"; | ||||
|                     close($ucfg); | ||||
|                 } | ||||
|             } else { #other than comboot/multiboot, we won't have need of pxelinux | ||||
|                 print $pcfg "imgfetch -n kernel http://" . '${next-server}/tftpboot/' . $kern->{kernel} . "\n"; | ||||
|                 print $pcfg "imgfetch -n kernel http://" . '${next-server}:' . $httpport.'/tftpboot/' . $kern->{kernel} . "\n"; | ||||
|                 print $pcfg "imgload kernel\n"; | ||||
|                 if ($kern->{kcmdline}) { | ||||
|                     print $pcfg "imgargs kernel " . $kern->{kcmdline} . ' BOOTIF=01-${netX/machyp}' . "\n"; | ||||
| @@ -298,14 +304,14 @@ sub setstate { | ||||
|                     print $pcfg "imgargs kernel BOOTIF=" . '${netX/mac}' . "\n"; | ||||
|                 } | ||||
|                 if ($kern->{initrd}) { | ||||
|                     print $pcfg "imgfetch http://" . '${next-server}' . "/tftpboot/" . $kern->{initrd} . "\n"; | ||||
|                     print $pcfg "imgfetch http://" . '${next-server}:' . "$httpport/tftpboot/" . $kern->{initrd} . "\n"; | ||||
|                 } | ||||
|                 print $pcfg "imgexec kernel\n"; | ||||
|                 if ($kern->{kcmdline} and $kern->{initrd}) { #only a linux kernel/initrd pair should land here, write elilo config and uefi variant of xnba config file | ||||
|                     my $ucfg; | ||||
|                     open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".uefi"); | ||||
|                     print $ucfg "#!gpxe\n"; | ||||
|                     print $ucfg 'chain http://${next-server}/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nodes/' . $node . ".elilo\n"; | ||||
|                     print $ucfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nodes/' . $node . ".elilo\n"; | ||||
|                     close($ucfg); | ||||
|                     open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".elilo"); | ||||
|                     print $ucfg 'default="xCAT"' . "\n"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user