Bläddra i källkod

qemuriscv: Add the virtio-rng device to pass entropy to the guest

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Alistair Francis 5 år sedan
förälder
incheckning
41ef243e31

+ 2 - 0
conf/machine/include/qemuriscv.inc

@@ -29,6 +29,8 @@ QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
 QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
 QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
 QB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
+# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
+QB_OPT_APPEND = " -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0"
 
 BAD_RECOMMENDATIONS += "\
     libcxx-dev \

+ 1 - 1
conf/machine/qemuriscv32.conf

@@ -6,7 +6,7 @@ require conf/machine/include/qemuriscv.inc
 
 DEFAULTTUNE = "riscv32"
 
-QB_OPT_APPEND = "-show-cursor -monitor null -device loader,file=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE},addr=0x80400000"
+QB_OPT_APPEND += "-show-cursor -monitor null -device loader,file=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE},addr=0x80400000"
 
 # u-boot doesn't compile, error: "can't link hard-float modules with soft-float modules"
 # EXTRA_IMAGEDEPENDS += "u-boot"

+ 1 - 1
conf/machine/qemuriscv64.conf

@@ -4,7 +4,7 @@
 
 require conf/machine/include/qemuriscv.inc
 
-QB_OPT_APPEND = "-show-cursor -monitor null -device loader,file=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE},addr=0x80200000"
+QB_OPT_APPEND += "-show-cursor -monitor null -device loader,file=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE},addr=0x80200000"
 
 EXTRA_IMAGEDEPENDS += "u-boot"
 UBOOT_MACHINE = "qemu-riscv64_defconfig"