mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-24 04:00:26 +00:00
This commit is contained in:
@@ -520,7 +520,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;
|
||||
@@ -2355,6 +2355,18 @@ sub use_devnull {
|
||||
}
|
||||
}
|
||||
|
||||
#in rhels7.5, the /dev/urandom does not exist in rootimg directory
|
||||
#which cause any rpm command fail with `error: Failed to initialize NSS library`
|
||||
#create urandom in genimage to avoid the error
|
||||
sub use_devurandom {
|
||||
if (-e "$rootimg_dir/dev/urandom" and !-c "$rootimg_dir/dev/urandom") {
|
||||
system("rm -f $rootimg_dir/dev/urandom");
|
||||
}
|
||||
if (!-e "$rootimg_dir/dev/urandom") {
|
||||
system("mknod -m444 $rootimg_dir/dev/urandom c 1 9");
|
||||
}
|
||||
}
|
||||
|
||||
# Hack uname functions to match what's installed in the rootimg
|
||||
# instead of what's running on the management node.
|
||||
# Needed for some RPMs, especially kernel modules via DKMS.
|
||||
|
Reference in New Issue
Block a user