append some code logic and documentation for rhels7 support on grub2

This commit is contained in:
immarvin 2014-03-21 04:40:25 -07:00
parent 1af1135646
commit c6cb1c9977
4 changed files with 31 additions and 13 deletions

View File

@ -599,7 +599,7 @@ noderes => {
descriptions => {
node => 'The node name or group name.',
servicenode => 'A comma separated list of node names (as known by the management node) that provides most services for this node. The first service node on the list that is accessible will be used. The 2nd node on the list is generally considered to be the backup service node for this node when running commands like snmove.',
netboot => 'The type of network booting to use for this node. Valid values: pxe or xnba for x86* architecture, yaboot for POWER architecture.',
netboot => 'The type of network booting to use for this node. Valid values: pxe or xnba for x86* architecture, yaboot for POWER architecture, grub2 for RHEL7 on Power. Notice: yaboot is not supported from rhels7 on Power,use grub2 instead',
tftpserver => 'The TFTP server for this node (as known by this node). If not set, it defaults to networks.tftpserver.',
tftpdir => 'The directory that roots this nodes contents from a tftp and related perspective. Used for NAS offload by using different mountpoints.',
nfsserver => 'The NFS or HTTP server for this node (as known by this node).',

View File

@ -515,16 +515,25 @@ sub process_request {
unless (($args[0] eq 'stat') || ($inittime) || ($args[0] eq 'offline')) {
foreach my $osimage (keys %osimagenodehash) {
#TOTO check the existence of grub2 executable files for corresponding arch
my $osimgent = $osimagetab->getAttribs({imagename => $osimage },'arch');
my $grub2 = "/boot/grub2/grub2.ppc";
my $tftppath = $tftpdir . $grub2;
unless (-e "$tftppath") {
my $rsp;
push @{$rsp->{data}},
"stop configuration, missing $tftppath.\n";
xCAT::MsgUtils->message("E", $rsp, $callback);
return;
}
my $osimgent = $osimagetab->getAttribs({imagename => $osimage },'osarch');
my $validarch=undef;
if($osimgent and $osimgent->{'osarch'})
{
$validarch = $osimgent->{'osarch'};
}
if ($validarch =~ /ppc64/i)
{
$validarch="ppc"
}
my $grub2 = "/boot/grub2/grub2.".$validarch;
my $tftppath = $tftpdir . $grub2;
unless (-e "$tftppath") {
my $rsp;
push @{$rsp->{data}},
"stop configuration, missing $tftppath.\n";
xCAT::MsgUtils->message("E", $rsp, $callback);
return;
}
if ($do_dhcpsetup) {
if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command
$sub_req->({command=>['makedhcp'],

View File

@ -571,7 +571,16 @@ sub process_request {
$osn = $2;
$osm = 0;
}
#Redhat recommend to use grub2 instead of yaboot for rhels7 provision
if ( $osv =~ /rh/ and int($osn) == 7 ){
my $rsp;
push @{$rsp->{data}},
"stop configuration because yaboot DOES NOT work for $os provision, please change noderes.netboot=grub2 instead.\n";
xCAT::MsgUtils->message("E", $rsp, $callback);
return;
}
if (($osv =~ /rh/ and int($osn) < 6) or
($osv =~ /sles/ and int($osn) < 11)) {
# check if yaboot-xcat installed

View File

@ -20,7 +20,7 @@ AutoReqProv: no
# also need to fix Requires for AIX
%ifos linux
BuildArch: noarch
Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser
Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser grub2-xcat
Obsoletes: atftp-xcat
%endif