Allow initrd-only mode of genimage, for kernel updates, only in the rhel copy at the moment

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@454 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-02-12 19:36:20 +00:00
parent d38258c8e1
commit 695dcd7fae
2 changed files with 15 additions and 7 deletions

View File

@ -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;

View File

@ -0,0 +1 @@
genimage