Skip to content

Commit

Permalink
fix issue chroot, rpm -qa error: Failed to initialize NSS library #4959
Browse files Browse the repository at this point in the history
… (#5011)

* move use_devurandom before package instllation:fix issue #4959
  • Loading branch information
immarvin authored and robin2008 committed Mar 26, 2018
1 parent 492b8fe commit 3217230
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xCAT-server/share/xcat/netboot/rh/genimage
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ sub majversion {
my $version = shift;
my $majorrel;

if ($osver =~ /^\D*(\d*)[.\d]*$/) {
if ($osver =~ /^\D*(\d*)[.\d]*.*$/) {
$majorrel = $1;
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -375,7 +378,6 @@ unless ($onlyinitrd) {


mount_chroot($rootimg_dir);

my %pkg_hash = imgutils::get_package_names($pkglist);

my $index = 1;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3217230

Please sign in to comment.