From 695dcd7faeb2b6af9c2e9c44dbca7afde0d029e7 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 12 Feb 2008 19:36:20 +0000 Subject: [PATCH] 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 --- .../share/xcat/netboot/rh/genimage | 21 ++++++++++++------- .../share/xcat/netboot/rh/geninitrd | 1 + 2 files changed, 15 insertions(+), 7 deletions(-) create mode 120000 xCAT-server-2.0/share/xcat/netboot/rh/geninitrd 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