diff --git a/xCAT-client/bin/genimage b/xCAT-client/bin/genimage index f3b6abed5..7de6bac5e 100755 --- a/xCAT-client/bin/genimage +++ b/xCAT-client/bin/genimage @@ -39,7 +39,7 @@ my $krpmver; my $kerneldir; my $mode; my $interactive; - +my $onlyinitrd; #----------------------------------------------------------------------------- =head3 print_usage - usage message @@ -51,8 +51,8 @@ sub print_usage { print "Usage:\n"; print " genimage\n\n"; - print ' genimage -o [-a ] -p -i -n [-r ] [-k ] [-g ] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission ] [--interactive]'."\n\n"; - print ' genimage [-o ] [-a ] [-p ] [-i ] [-n ] [-r ] [-k ] [-g ] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission ] [--interactive] '."\n\n"; + print ' genimage -o [-a ] -p -i -n [--onlyinitrd] [-r ] [-k ] [-g ] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission ] [--interactive]'."\n\n"; + print ' genimage [-o ] [-a ] [-p ] [-i ] [-n ] [--onlyinitrd] [-r ] [-k ] [-g ] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission ] [--interactive] '."\n\n"; print " --permission is used for statelite only\n"; print " -g is used for SLES only\n\n"; print " -m is used for urbuntu, debian and fedora12 only\n\n"; @@ -60,6 +60,7 @@ sub print_usage print " genimage\n"; print " genimage --interactive\n"; print " genimage -i eth0 -n tg3 -o sles11 -p compute\n"; + print " genimage -i eth0 -n tg3 -o sles11 -p compute --onlyinitrd\n"; print " genimage -i eth0 -r eth1,eth2 -n tg3,bnx2 -o centos5.1 -p compute --interactive\n"; print " genimage -i eth0 -n tg3,bnx2 -o sles11 -p compute\n"; print " genimage -i eth0 -n igb,e1000e,e1000,bnx2,tg3 -o centos5.4 -p nfsroot --permission 777\n"; @@ -82,6 +83,7 @@ if (!GetOptions( 'permission=s' => \$permission, 'kerneldir=s' => \$kerneldir, 'interactive' => \$interactive, + 'onlyinitrd' => \$onlyinitrd, 'h|help' => \$help, 'v|version' => \$version, )) { @@ -388,6 +390,11 @@ if ($interactive) { push @arg, "--interactive"; } + +if ($onlyinitrd) { + push @arg, "--onlyinitrd"; +} + my $cmdref; push (@{$cmdref->{arg}}, @arg); $cmdref->{command}->[0] = "genimage"; diff --git a/xCAT-server/lib/xcat/plugins/genimage.pm b/xCAT-server/lib/xcat/plugins/genimage.pm index 6fe3cff34..4939d195c 100644 --- a/xCAT-server/lib/xcat/plugins/genimage.pm +++ b/xCAT-server/lib/xcat/plugins/genimage.pm @@ -65,6 +65,7 @@ sub process_request { my $permission; #the permission works only for statelite mode currently my $krpmver; my $interactive; + my $onlyinitrd; my $tempfile; GetOptions( @@ -82,6 +83,7 @@ sub process_request { 'kerneldir=s' => \$kerneldir, 'permission=s' => \$permission, 'interactive' => \$interactive, + 'onlyinitrd' => \$onlyinitrd, 'tempfile=s' => \$tempfile, ); @@ -288,6 +290,7 @@ sub process_request { if ($permission) { $cmd .= " --permission $permission"; } if ($kerneldir) { $cmd .= " --kerneldir $kerneldir"; } if ($interactive) { $cmd .= " --interactive" } + if ($onlyinitrd) { $cmd .= " --onlyinitrd" } if ($srcdir) { $cmd .= " --srcdir $srcdir";} if ($pkglist) { $cmd .= " --pkglist $pkglist";} diff --git a/xCAT-server/share/xcat/netboot/debian/genimage b/xCAT-server/share/xcat/netboot/debian/genimage index 327ed22f1..6ff2337c7 100755 --- a/xCAT-server/share/xcat/netboot/debian/genimage +++ b/xCAT-server/share/xcat/netboot/debian/genimage @@ -28,6 +28,7 @@ my $pathtofiles=dirname($0); my $fullpath=realpath($pathtofiles); my $name = basename($0); my $onlyinitrd=0; +#that this method of calling genimage is no longer used if ($name =~ /geninitrd/) { $onlyinitrd=1; } @@ -81,6 +82,7 @@ GetOptions( 'postinstall=s' => \$postinstall_filename, #internal flag 'rootimgdir=s' => \$destdir, #internal flag 'interactive' =>\$prompt, + 'onlyinitrd' =>\$onlyinitrd, ); if (@ARGV > 0) { diff --git a/xCAT-server/share/xcat/netboot/fedora12/genimage b/xCAT-server/share/xcat/netboot/fedora12/genimage index 02e23a836..335e4137a 100755 --- a/xCAT-server/share/xcat/netboot/fedora12/genimage +++ b/xCAT-server/share/xcat/netboot/fedora12/genimage @@ -33,6 +33,7 @@ my $pathtofiles=dirname($0); my $fullpath=realpath($pathtofiles); my $name = basename($0); my $onlyinitrd=0; +#that this method of calling genimage is no longer used if ($name =~ /geninitrd/) { $onlyinitrd=1; } @@ -85,6 +86,7 @@ GetOptions( 'postinstall=s' => \$postinstall_filename, #internal flag 'rootimgdir=s' => \$destdir, #internal flag 'interactive' =>\$prompt, + 'onlyinitrd' =>\$onlyinitrd, ); if (@ARGV > 0) { diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 0cce03a42..09fa0ab7f 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -40,6 +40,7 @@ my $pathtofiles=dirname($0); my $fullpath=realpath($pathtofiles); my $name = basename($0); my $onlyinitrd=0; +#that this method of calling genimage is no longer used if ($name =~ /geninitrd/) { $onlyinitrd=1; } @@ -91,6 +92,7 @@ GetOptions( 'rootimgdir=s' => \$destdir, #internal flag 'driverupdatesrc=s' => \$driverupdatesrc, #internal flag 'interactive' =>\$prompt, + 'onlyinitrd' =>\$onlyinitrd, ); if (@ARGV > 0) { diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 6219cd3b4..bcea75bf9 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -34,6 +34,7 @@ my $pathtofiles=dirname($0); my $fullpath=realpath($pathtofiles); my $name = basename($0); my $onlyinitrd=0; +#that this method of calling genimage is no longer used if ($name =~ /geninitrd/) { $onlyinitrd=1; } @@ -103,6 +104,7 @@ GetOptions( 'rootimgdir=s' => \$destdir, #internal flag 'driverupdatesrc=s' => \$driverupdatesrc, #internal flag 'interactive' =>\$prompt, + 'onlyinitrd' =>\$onlyinitrd, ); if (@ARGV > 0) { diff --git a/xCAT-server/share/xcat/netboot/suse/genimage b/xCAT-server/share/xcat/netboot/suse/genimage index f6961efff..04f5fa9ae 100755 --- a/xCAT-server/share/xcat/netboot/suse/genimage +++ b/xCAT-server/share/xcat/netboot/suse/genimage @@ -28,6 +28,7 @@ my $pathtofiles=dirname($0); my $fullpath=realpath($pathtofiles); my $name = basename($0); my $onlyinitrd=0; +#that this method of calling genimage is no longer used if ($name =~ /geninitrd/) { $onlyinitrd=1; } @@ -77,7 +78,8 @@ GetOptions( 'r=s' => \$othernics, 'l=s' => \$rootlimit, 't=s' => \$tmplimit, - 'k=s' => \$kernelver + 'k=s' => \$kernelver, + 'onlyinitrd' =>\$onlyinitrd, ); if (@ARGV > 0) { $imagename=$ARGV[0]; diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index c55749728..069540640 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -38,6 +38,7 @@ my $pathtofiles=dirname($0); my $fullpath=realpath($pathtofiles); my $name = basename($0); my $onlyinitrd=0; +#that this method of calling genimage is no longer used if ($name =~ /geninitrd/) { $onlyinitrd=1; } @@ -89,6 +90,7 @@ GetOptions( 'postinstall=s' => \$postinstall_filename, #internal flag 'rootimgdir=s' => \$destdir, #internal flag 'interactive' =>\$prompt, + 'onlyinitrd' =>\$onlyinitrd, ); if (@ARGV > 0) {