diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index d78832f27..2fd822aa0 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -85,7 +85,7 @@ sub majversion { my $version = shift; my $majorrel; - if ($osver =~ /^\D*(\d*)[.\d]*$/) { + if ($osver =~ /^\D*(\d*)[.\d]*.*$/) { $majorrel = $1; } @@ -141,6 +141,9 @@ sub umount_chroot { #only remove the /dev in rootimg directory if it is not a mount point system("findmnt $rootimage_dir/dev/ >/dev/null 2>&1 || rm -rf $rootimage_dir/dev/*"); } + + #rpm complains "Failed to initialize NSS library" when /dev/urandom does not exist, leave /dev/urandom + use_devurandom(); } #check whether a dir is NFS mounted @@ -375,7 +378,6 @@ unless ($onlyinitrd) { mount_chroot($rootimg_dir); - my %pkg_hash = imgutils::get_package_names($pkglist); my $index = 1; @@ -520,7 +522,7 @@ unless ($onlyinitrd) { # Hack uname when deal otherpkgs use_hackuname($arch, $kernelver); use_devnull(); - use_devurandom(); + foreach $pass (sort { $a <=> $b } (keys(%extra_hash))) { $yumcmd = $yumcmd_base;