From 9c45c6ee64703e1fe6b72e29f93a8558308e18d3 Mon Sep 17 00:00:00 2001 From: Jia Zhao Date: Wed, 28 Jan 2015 09:40:22 +0800 Subject: [PATCH] Addding netboot image check for ubuntu nodeimport --- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index 35b53ea37..750ef892f 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -858,6 +858,13 @@ sub check_profile_consistent{ my $arch = $nodetypeentry->{'arch'}; $nodetypetab->close(); + # Get Imageprofile pkgdir + my $osdistroname = $os . "-" . $arch; + my $osdistrotab = xCAT::Table->new('osdistro'); + my $osdistroentry = ($osdistrotab->getAllAttribsWhere("osdistroname = '$osdistroname'", 'ALL' ))[0]; + my $pkgdir = $osdistroentry->{'dirpaths'}; + $osdistrotab->close(); + # Get networkprofile netboot and installnic my $noderestab = xCAT::Table->new('noderes'); my $noderesentry = $noderestab->getNodeAttribs($networkprofile, ['netboot', 'installnic']); @@ -889,6 +896,12 @@ sub check_profile_consistent{ my $nodetype = undef; $nodetype = $ntentry->{'nodetype'} if ($ntentry->{'nodetype'}); $ppctab->close(); + + # Checking whether netboot initrd image for Ubuntu ppc64 + # This image should be downloaded from internet + if ($arch =~ /ppc64/i and $os =~ /ubuntu/i and !(-e "$pkgdir/install/netboot/initrd.gz")){ + return 0, "The netboot initrd is not found in $pkgdir/install/netboot, please download it firstly."; + } # Check if exists provision network if (not ($installnic and exists $netprofile_nicshash{$installnic}{"network"})){ @@ -941,7 +954,7 @@ sub check_profile_consistent{ } return 0, $errmsg; } - + return 1, ""; }