2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

fix issue chroot, rpm -qa error: Failed to initialize NSS library #4959 (#5011)

* move use_devurandom before package instllation:fix issue #4959
This commit is contained in:
yangsong 2018-03-26 17:35:19 +08:00 committed by Bin Xu
parent 492b8fe5a9
commit 3217230d19

View File

@ -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;