1
0
mirror of https://github.com/rancher/os.git synced 2025-08-29 19:44:22 +00:00

Use /dev/urandom as random number input for rngd

As /dev/hwrng may not exist in some environments
This commit is contained in:
niusmallnan 2018-10-29 10:08:31 +08:00 committed by niusmallnan
parent 6b41747e6d
commit 0e35ee7e53

View File

@ -76,7 +76,11 @@ func mdadmScan() error {
} }
func runRngd() error { func runRngd() error {
cmd := exec.Command("rngd", "-q") // use /dev/urandom as random number input for rngd
// this is a really bad idea
// since I am simple filling the kernel entropy pool with entropy coming from the kernel itself!
// but this does not need to consider the user's hw rngd drivers.
cmd := exec.Command("rngd", "-r", "/dev/urandom", "-q")
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
return cmd.Run() return cmd.Run()