From ee1a1574c361ce85b30c04b118c12fe611607bf9 Mon Sep 17 00:00:00 2001 From: mellor Date: Wed, 24 Sep 2014 02:38:54 -0700 Subject: [PATCH] generate default netboot configure file for p8 hardware discovery --- xCAT-server/lib/xcat/plugins/dhcp.pm | 3 +++ xCAT-server/lib/xcat/plugins/mknb.pm | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index e86bb20d3..1a427824d 100755 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -2416,6 +2416,9 @@ sub addnet push @netent, " } else if option client-architecture = 00:02 { #ia64\n "; push @netent, " filename \"elilo.efi\";\n"; + push @netent, + " } else if option client-architecture = 00:0e { #OPAL-v3\n "; + push @netent, " option conf-file = \"http://$tftp/tftpboot/pxelinux.cfg/p/default\";\n"; push @netent, " } else if substring(filename,0,1) = null { #otherwise, provide yaboot if the client isn't specific\n "; push @netent, " filename \"/yaboot\";\n"; diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index bdb2bcd17..381b95af0 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -117,6 +117,7 @@ sub process_request { system("ssh-keygen -t rsa -f $tempdir/etc/ssh_host_rsa_key -C '' -N ''"); system("ssh-keygen -t dsa -f $tempdir/etc/ssh_host_dsa_key -C '' -N ''"); } + my $initrd_file = undef; my $lzma_exit_value=1; if ($invisibletouch) { my $done=0; @@ -129,18 +130,25 @@ sub process_request { unlink ("$tftpdir/xcat/genesis.fs.$arch.lzma"); } else { $done = 1; + $initrd_file = "$tftpdir/xcat/genesis.fs.$arch.lzma"; } } if (not $done) { $callback->({data=>["Creating genesis.fs.$arch.gz in $tftpdir/xcat"]}); system("cd $tempdir; find . | cpio -o -H newc | gzip -9 > $tftpdir/xcat/genesis.fs.$arch.gz"); + $initrd_file = "$tftpdir/xcat/genesis.fs.$arch.gz"; } } else { $callback->({data=>["Creating nbfs.$arch.gz in $tftpdir/xcat"]}); system("cd $tempdir; find . | cpio -o -H newc | gzip -9 > $tftpdir/xcat/nbfs.$arch.gz"); + $initrd_file = "$tftpdir/xcat/nbfs.$arch.gz"; } system ("rm -rf $tempdir"); + unless ($initrd_file) { + $callback->({data=>["Creating filesystem file in $tftpdir/xcat failed"]}); + return; + } my $hexnets = xCAT::NetworkUtils->my_hexnets(); my $normnets = xCAT::NetworkUtils->my_nets(); my $consolecmdline; @@ -170,7 +178,7 @@ sub process_request { chmod(0644,"$tftpdir/pxelinux.0"); } } elsif ($arch =~ /ppc/) { - mkpath("$tftpdir/etc"); + mkpath("$tftpdir/pxelinux.cfg/p/"); } my $dopxe=0; foreach (keys %{$normnets}) { @@ -262,11 +270,11 @@ sub process_request { close($cfgfile); } elsif ($arch =~ /ppc/) { open($cfgfile,">","$tftpdir/etc/".lc($_)); - print $cfgfile "timeout=5\n"; - print $cfgfile " label=xcat\n"; - print $cfgfile " image=xcat/nbk.$arch\n"; - print $cfgfile " initrd=xcat/nbfs.$arch.gz\n"; - print $cfgfile ' append="quiet xcatd='.$hexnets->{$_}.":$xcatdport $consolecmdline\"\n"; + print $cfgfile "default xCAT\n"; + print $cfgfile " label xCAT\n"; + print $cfgfile " kernel http://".$hexnets->{$_}.":80/$tftpdir/xcat/genesis.kernel.$arch\n"; + print $cfgfile " initrd http://".$hexnets->{$_}.":80/$initrd_file\n"; + print $cfgfile ' append "quiet xcatd='.$hexnets->{$_}.":$xcatdport $consolecmdline\"\n"; close($cfgfile); } }