cmd/qemu: Disable rng on macOS

With rng-random, booting hangs before switching
to the initrd.

fixes https://github.com/linuxkit/linuxkit/issues/3320

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
This commit is contained in:
Rolf Neugebauer 2019-07-06 11:13:03 +01:00
parent 66cd2b6ee5
commit 5426ae55af

View File

@ -574,15 +574,20 @@ func buildQemuCmdline(config QemuConfig) (QemuConfig, []string) {
} }
} }
rng := "rng-random,id=rng0" // rng-random does not work on macOS
if runtime.GOOS == "linux" { // Temporarily disable it until fixed upstream.
rng = rng + ",filename=/dev/urandom" if runtime.GOOS != "darwin" {
} rng := "rng-random,id=rng0"
if config.Arch == "s390x" { if runtime.GOOS == "linux" {
qemuArgs = append(qemuArgs, "-object", rng, "-device", "virtio-rng-ccw,rng=rng0") rng = rng + ",filename=/dev/urandom"
} else { }
qemuArgs = append(qemuArgs, "-object", rng, "-device", "virtio-rng-pci,rng=rng0") if config.Arch == "s390x" {
qemuArgs = append(qemuArgs, "-object", rng, "-device", "virtio-rng-ccw,rng=rng0")
} else {
qemuArgs = append(qemuArgs, "-object", rng, "-device", "virtio-rng-pci,rng=rng0")
}
} }
var lastDisk int var lastDisk int
for i, d := range config.Disks { for i, d := range config.Disks {
index := i index := i