diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index a9b0b5c61..150eed5b6 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -248,15 +248,7 @@ if ($arch eq "s390x") { } unless ($osver and $profile) { - print 'Usage: genimage [ -i ] [ -n ] [-r ] -o -p -k [--permission ]'."\n"; - print ' genimage [ -i ] [ -n ] [-r ] -k '."\n"; - print " --permission only works with statelite mode\n"; - print "Examples:\n"; - print " genimage -i eth0 -n tg3 -o centos5.1 -p compute \n"; - print " genimage -i eth0 -r eth1,eth2 -n tg3,bnx2 -o centos5.1 -p compute\n"; - print " genimage -i eth0 -n igb,e1000e,e1000,bnx2,tg3 -o centos5.4 -p nfsroot\n"; - print " genimage -i eth0 -n igb,e1000e,e1000,bnx2,tg3 -o centos5.4 -p nfsroot --permission 777\n"; - print " genimage -i eth0 -n tg3 myimage\n"; + usage(); exit 1; } @@ -490,7 +482,7 @@ $basekernelver = `uname -r` unless ($basekernelver); $kernelver = $basekernelver unless ($kernelver); chomp($kernelver); -$updates{'kernelver'} = $kernelver if ($needUpdateTable); +#$updates{'kernelver'} = $kernelver if ($needUpdateTable); # copy the kernel to $destdir if ( -e "$rootimg_dir/boot/vmlinux-$kernelver") { @@ -1604,4 +1596,18 @@ sub load_dd () return @dd_drivers; } +sub usage { + print 'Usage: genimage [ -i ] [ -n ] [-r ] -o -p -k [--permission ]'."\n"; + print ' genimage [ -i ] [ -n ] [-r ] -k '."\n"; + print " --permission only works with statelite mode\n"; + print "Examples:\n"; + print " genimage -i eth0 -n tg3 -o centos5.1 -p compute \n"; + print " genimage -i eth0 -r eth1,eth2 -n tg3,bnx2 -o centos5.1 -p compute\n"; + print " genimage -i eth0 -n igb,e1000e,e1000,bnx2,tg3 -o centos5.4 -p nfsroot\n"; + print " genimage -i eth0 -n igb,e1000e,e1000,bnx2,tg3 -o centos5.4 -p nfsroot --permission 777\n"; + print " genimage -i eth0 -n tg3 myimage\n"; + + return 0; +} + diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index bd435fd04..c14e3c440 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -55,6 +55,7 @@ my $postinstall_filename; my $rootimg_dir; my $mode; my $permission; #the permission works only for statelite mode currently +my $krpmver; sub xdie { system("rm -rf /tmp/xcatinitrd.$$"); @@ -138,7 +139,7 @@ if (@ARGV > 0 and $needUpdateTable eq 1) { exit 1; } - (my $ref_linuximage_tab) = $linuximagetab->getAttribs({imagename => $imagename}, 'pkglist', 'pkgdir', 'otherpkglist', 'otherpkgdir', 'postinstall', 'rootimgdir', 'kerneldir', 'nodebootif', 'otherifce', 'kernelver', 'netdrivers', 'permission'); + (my $ref_linuximage_tab) = $linuximagetab->getAttribs({imagename => $imagename}, 'pkglist', 'pkgdir', 'otherpkglist', 'otherpkgdir', 'postinstall', 'rootimgdir', 'kerneldir', 'nodebootif', 'otherifce', 'kernelver', 'krpmver', 'netdrivers', 'permission'); unless ($ref_linuximage_tab) { print "Cannot find $imagename from the linuximage table\n"; exit 1; @@ -200,6 +201,15 @@ if (@ARGV > 0 and $needUpdateTable eq 1) { $kernelver = $ref_linuximage_tab->{'kernelver'}; } + if ($krpmver) { + if ($krpmver ne $ref_linuximage_tab->{'krpmver'}) { + print "The krpmver is different from the value in linuximage table, will update it\n"; + $updates{'krpmver'} = $krpmver; + } + } else { + $krpmver = $ref_linuximage_tab->{'krpmver'}; + } + if ($netdriver) { if ($netdriver ne $ref_linuximage_tab->{'netdrivers'}) { print "The netdrivers are different from the value in linuximage table, will update it\n"; @@ -248,15 +258,7 @@ $kerneldir = "$installroot/kernels" unless ($kerneldir); # the default direct $updates{'kerneldir'} = $kerneldir if ($needUpdateTable); unless ($osver and $profile) { - print 'Usage: genimage -i -n [-r ] -k -o -p [-a ] [-l rootlimitsize] [-t tmplimitsize] [--permission ]'."\n"; - print ' genimage [-i ] [-n ] [-r ] [-k ] [-o ] [-p ] [-a ] [-l rootlimitsize] [-t tmplimitsize] [--permission ] '."\n"; - print " --permission is used for statelite only\n"; - print "Examples:\n"; - print " genimage -i eth0 -n tg3 -o sles11 -p compute\n"; - print " genimage -i eth0 -r eth1,eth2 -n tg3,bnx2 -o sles11 -p compute\n"; - print " genimage -i eth0 -n tg3,bnx2 -o sles11 -p compute\n"; - print " genimage -i eth0 -n tg3,bnx2 -o sles11 -p compute --permission 777\n"; - print " genimage -i eth0 -n tg3 myimagename\n"; + usage(); exit 1; } my @ndrivers; @@ -582,7 +584,7 @@ unless ($basekernelver) { $kernelver = $basekernelver unless ($kernelver); chomp $kernelver; -$updates{kernelver} = $kernelver if ($needUpdateTable); +#$updates{kernelver} = $kernelver if ($needUpdateTable); # copy the kernel to $destdir if ( -e "$rootimg_dir/boot/vmlinux-$kernelver") { @@ -1643,3 +1645,16 @@ sub load_dd() return @dd_drivers; } + +sub usage { + print 'Usage: genimage -o [-a ] -p -i -n [-r ] [-k ] [-g ] [-l rootlimitsize] [-t tmplimitsize] [--permission ]'."\n"; + print ' genimage [-o ] [-a ] [-p ] [-i ] [-n ] [-r ] [-k ] [-g ] [-l rootlimitsize] [-t tmplimitsize] [--permission ] '."\n"; + print " --permission is used for statelite only\n"; + print "Examples:\n"; + print " genimage -i eth0 -n tg3 -o sles11 -p compute\n"; + print " genimage -i eth0 -r eth1,eth2 -n tg3,bnx2 -o sles11 -p compute\n"; + print " genimage -i eth0 -n tg3,bnx2 -o sles11 -p compute\n"; + print " genimage -i eth0 -n tg3,bnx2 -o sles11 -p compute --permission 777\n"; + print " genimage -i eth0 -n tg3 myimagename\n"; + return 0; +}