mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 19:32:31 +00:00 
			
		
		
		
	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:
		| @@ -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; | ||||
|   | ||||
							
								
								
									
										1
									
								
								xCAT-server-2.0/share/xcat/netboot/rh/geninitrd
									
									
									
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								xCAT-server-2.0/share/xcat/netboot/rh/geninitrd
									
									
									
									
									
										Symbolic link
									
								
							| @@ -0,0 +1 @@ | ||||
| genimage | ||||
		Reference in New Issue
	
	Block a user