diff --git a/xCAT-server-2.0/share/xcat/netboot/rh/genimage b/xCAT-server-2.0/share/xcat/netboot/rh/genimage index 4466367ca..5c267212b 100755 --- a/xCAT-server-2.0/share/xcat/netboot/rh/genimage +++ b/xCAT-server-2.0/share/xcat/netboot/rh/genimage @@ -18,6 +18,12 @@ my @filestoadd; my $profile; my $osver; my $pathtofiles=dirname($0); +my $name = basename($0); +my $onlyinitrd=0; +if ($name =~ /geninitrd/) { + $onlyinitrd=1; +} + GetOptions( #'a=s' => \$architecture, 'p=s' => \$profile, @@ -57,7 +63,6 @@ my $yumconfig; open($yumconfig,">","/tmp/genimage.$$.yum.conf"); my $repnum=0; foreach $srcdir (@yumdirs) { - print $srcdir; print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; $repnum += 1; } @@ -88,14 +93,16 @@ while (<$yumconfig>) { $yumcmd .= $_ . " "; } $yumcmd =~ s/ $/\n/; -my $rc = system($yumcmd); -if ($rc) { - print "yum invocation failed\n"; - exit 1; +unless ($onlyinitrd) { + my $rc = system($yumcmd); + if ($rc) { + print "yum invocation failed\n"; + exit 1; + } + postscripts(); #run 'postscripts' } -mkinitrd(); -postscripts(); #run 'postscripts' unlink "/tmp/genimage.$$.yum.conf"; +mkinitrd(); sub getlibs { my $file = shift; diff --git a/xCAT-server-2.0/share/xcat/netboot/rh/geninitrd b/xCAT-server-2.0/share/xcat/netboot/rh/geninitrd new file mode 120000 index 000000000..2271c3f0f --- /dev/null +++ b/xCAT-server-2.0/share/xcat/netboot/rh/geninitrd @@ -0,0 +1 @@ +genimage \ No newline at end of file