diff --git a/xCAT-server/share/xcat/netboot/fedora12/genimage b/xCAT-server/share/xcat/netboot/fedora12/genimage index a24fb0c13..74ba09017 100755 --- a/xCAT-server/share/xcat/netboot/fedora12/genimage +++ b/xCAT-server/share/xcat/netboot/fedora12/genimage @@ -218,6 +218,10 @@ unless ($onlyinitrd) { foreach $pass (sort (keys(%pkg_hash))) { my $pkgnames = ""; foreach (keys(%{$pkg_hash{$pass}})) { + if($_ eq "INCLUDEBAD") { + print "Unable to open the following pkglist files:\n".join("\n",@{$pkg_hash{$pass}{INCLUDEBAD}}); + exit 1; + } if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE")) { next;} my $pa=$pkg_hash{$pass}{$_}; $pkgnames .= " " . join(' ', @$pa); @@ -248,6 +252,12 @@ unless ($onlyinitrd) { my $index=1; foreach $pass (sort (keys(%extra_hash))) { foreach (keys(%{$extra_hash{$pass}})) { + + if($_ eq "INCLUDEBAD") { + print "Unable to open the following pkglist files:\n".join("\n",@{$extra_hash{$pass}{INCLUDEBAD}}); + exit 1; + } + if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE")) { next;} print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; $index++; diff --git a/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm b/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm index 32787c595..c41848aa2 100644 --- a/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm +++ b/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm @@ -117,7 +117,7 @@ sub get_package_names { } } - #print "pkgtext=$pkgtext\n"; + #print "\n\npkgtext=$pkgtext\n\n"; my @tmp=split(',', $pkgtext); my $pass=1; foreach (@tmp) { @@ -140,6 +140,15 @@ sub get_package_names { $pkgnames{$pass}{ENVLIST} = [$env]; } next; + } elsif (/^#INCLUDEBAD:([^#^\n]+)#/){ + my $pa=$pkgnames{$pass}{INCLUDEBAD}; + my $file=$1; + if (exists($pkgnames{$pass}{INCLUDEBAD})){ + push(@$pa,$file); + } else { + $pkgnames{$pass}{INCLUDEBAD} =[$file]; + } + next; } elsif (/^#/) { # ignore all other comment lines next; diff --git a/xCAT-server/share/xcat/netboot/mic/genimage b/xCAT-server/share/xcat/netboot/mic/genimage index 3be6eb295..6e1e52723 100755 --- a/xCAT-server/share/xcat/netboot/mic/genimage +++ b/xCAT-server/share/xcat/netboot/mic/genimage @@ -120,6 +120,12 @@ if ($otherpkglist) { my $pass; foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) { foreach (keys(%{$extra_hash{$pass}})) { + + if($_ eq "INCLUDEBAD") { + print "Unable to open the following pkglist files:\n".join("\n",@{$extra_hash{$pass}{INCLUDEBAD}}); + exit 1; + } + if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;} print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; $repohash{$pass}{$index} = 1; diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index cb35c3cc2..5769d2983 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -276,11 +276,17 @@ unless ($onlyinitrd) { } my %pkg_hash=imgutils::get_package_names($pkglist); + my $index=1; my $pass; foreach $pass (sort {$a <=> $b} (keys(%pkg_hash))) { my $pkgnames = ""; foreach (keys(%{$pkg_hash{$pass}})) { + if($_ eq "INCLUDEBAD") { + print "Unable to open the following pkglist files:\n".join("\n",@{$pkg_hash{$pass}{INCLUDEBAD}}); + exit 1; + } + if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;} my $pa=$pkg_hash{$pass}{$_}; my @npa = (); @@ -350,6 +356,12 @@ unless ($onlyinitrd) { my $index=1; foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) { foreach (keys(%{$extra_hash{$pass}})) { + + if($_ eq "INCLUDEBAD") { + print "Unable to open the following pkglist files:\n".join("\n",@{$extra_hash{$pass}{INCLUDEBAD}}); + exit 1; + } + if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;} print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; $repohash{$pass}{$index} = 1; diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 5d8f5df78..3a87e43a8 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -316,6 +316,12 @@ unless ($onlyinitrd) { my $pass; foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) { foreach (keys(%{$extra_hash{$pass}})) { + + if($_ eq "INCLUDEBAD") { + print "Unable to open the following pkglist files:\n".join("\n",@{$extra_hash{$pass}{INCLUDEBAD}}); + exit 1; + } + if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;} my $whole_path="$srcdir_otherpkgs/$_"; if (-r "$srcdir_otherpkgs/$_/repodata/repomd.xml") { @@ -395,6 +401,12 @@ unless ($onlyinitrd) { $pkgnames = ""; $group_pkgnames = ""; foreach (keys(%{$pkg_hash{$pass}})) { + + if($_ eq "INCLUDEBAD") { + print "Unable to open the following pkglist files:\n".join("\n",@{$pkg_hash{$pass}{INCLUDEBAD}}); + exit 1; + } + if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;} my $pa=$pkg_hash{$pass}{$_}; # replace the kernel package with the name has the specific version diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 965de17a2..2a0bd3f3b 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -266,6 +266,11 @@ unless ($onlyinitrd) { foreach $pass (sort {$a <=> $b} (keys(%pkg_hash))) { my $pkgnames = ""; foreach (keys(%{$pkg_hash{$pass}})) { + if($_ eq "INCLUDEBAD") { + print "Unable to open the following pkglist files:\n".join("\n",@{$pkg_hash{$pass}{INCLUDEBAD}}); + exit 1; + } + if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;} my $pa=$pkg_hash{$pass}{$_}; my @npa = (); @@ -357,6 +362,11 @@ unless ($onlyinitrd) { my $index=1; foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) { foreach (keys(%{$extra_hash{$pass}})) { + if($_ eq "INCLUDEBAD") { + print "Unable to open the following pkglist files:\n".join("\n",@{$extra_hash{$pass}{INCLUDEBAD}}); + exit 1; + } + if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;} $index++; my $pa=$extra_hash{$pass}{$_};