diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index e4dff9ade..0f52db821 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -149,6 +149,7 @@ sub process_request sub mknetboot { + my $xenstyle=0; my $req = shift; my $callback = shift; my $doreq = shift; @@ -249,6 +250,11 @@ sub mknetboot #TODO: only copy if newer... unless ($donetftp{$osver,$arch,$profile}) { + if (-f "/$installroot/netboot/$osver/$arch/$profile/hypervisor") { + copy("/$installroot/netboot/$osver/$arch/$profile/hypervisor", + "/$tftpdir/xcat/netboot/$osver/$arch/$profile/"); + $xenstyle=1; + } copy("/$installroot/netboot/$osver/$arch/$profile/kernel", "/$tftpdir/xcat/netboot/$osver/$arch/$profile/"); copy("/$installroot/netboot/$osver/$arch/$profile/initrd.gz", @@ -363,10 +369,14 @@ sub mknetboot } + my $kernstr="xcat/netboot/$osver/$arch/$profile/kernel"; + if ($xenstyle) { + $kernstr.= "!xcat/netboot/$osver/$arch/$profile/hypervisor"; + } $bptab->setNodeAttribs( $node, { - kernel => "xcat/netboot/$osver/$arch/$profile/kernel", + kernel => "$kernstr", initrd => "xcat/netboot/$osver/$arch/$profile/initrd.gz", kcmdline => $kcmdline } diff --git a/xCAT-server/lib/xcat/plugins/pxe.pm b/xCAT-server/lib/xcat/plugins/pxe.pm index 41f8dfb7b..2f0321bdd 100644 --- a/xCAT-server/lib/xcat/plugins/pxe.pm +++ b/xCAT-server/lib/xcat/plugins/pxe.pm @@ -78,6 +78,13 @@ sub setstate { print $pcfg "LOCALBOOT 0\n"; close($pcfg); } elsif ($kern and $kern->{kernel}) { + if ($kern->{kernel} =~ /!/) { + my $hypervisor; + my $kernel; + ($kernel,$hypervisor) = split /!/,$kern->{kernel}; + print $pcfg " KERNEL mboot.c32\n"; + print $pcfg " APPEND $hypervisor --- $kernel ".$kern->{kcmdline}." --- ".$kern->{initrd}."\n"; + } else { #It's time to set pxelinux for this node to boot the kernel.. print $pcfg " KERNEL ".$kern->{kernel}."\n"; if ($kern->{initrd} or $kern->{kcmdline}) { @@ -91,6 +98,7 @@ sub setstate { } else { print $pcfg "\n"; } + } close($pcfg); my $inetn = inet_aton($node); unless ($inetn) {