diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-09-23 18:25:06 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-24 22:32:49 +0100 |
commit | b6b985a22393931adef3412e726832848c41ce64 (patch) | |
tree | c107412df4fdfee0dcf9afd8f3a11a9519362922 /meta | |
parent | 6890a23a18e9c470c27854ec38e47030fdb2f0ed (diff) | |
download | poky-b6b985a22393931adef3412e726832848c41ce64.tar.gz |
qemuboot: Add QB_RNG variable
RNG passthru has been enabled on all qemu machines but its being added
to each one of them, with this patch its turned into QB variables which
defaults to host passthru, yet it can be overridden if needed via
machine or config metadata if needed.
(From OE-Core rev: 26dd24506ef36088e17f999ce5489dc4b72194e8)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/qemuboot.bbclass | 4 | ||||
-rw-r--r-- | meta/conf/machine/include/qemuboot-mips.inc | 2 | ||||
-rw-r--r-- | meta/conf/machine/include/qemuboot-x86.inc | 2 | ||||
-rw-r--r-- | meta/conf/machine/include/riscv/qemuriscv.inc | 3 | ||||
-rw-r--r-- | meta/conf/machine/qemuarm.conf | 2 | ||||
-rw-r--r-- | meta/conf/machine/qemuarm64.conf | 2 | ||||
-rw-r--r-- | meta/conf/machine/qemuarmv5.conf | 2 | ||||
-rw-r--r-- | meta/conf/machine/qemuppc.conf | 2 |
8 files changed, 4 insertions, 15 deletions
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index d8f62ef6ea..824676216e 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass | |||
@@ -29,6 +29,9 @@ | |||
29 | # QB_AUDIO_OPT: qemu audio option, e.g., "-soundhw ac97,es1370", used | 29 | # QB_AUDIO_OPT: qemu audio option, e.g., "-soundhw ac97,es1370", used |
30 | # when QB_AUDIO_DRV is set. | 30 | # when QB_AUDIO_DRV is set. |
31 | # | 31 | # |
32 | # QB_RNG: Pass-through for host random number generator, it can speedup boot | ||
33 | # in system mode, where system is experiencing entropy starvation | ||
34 | # | ||
32 | # QB_KERNEL_ROOT: kernel's root, e.g., /dev/vda | 35 | # QB_KERNEL_ROOT: kernel's root, e.g., /dev/vda |
33 | # | 36 | # |
34 | # QB_NETWORK_DEVICE: network device, e.g., "-device virtio-net-pci,netdev=net0,mac=@MAC@", | 37 | # QB_NETWORK_DEVICE: network device, e.g., "-device virtio-net-pci,netdev=net0,mac=@MAC@", |
@@ -77,6 +80,7 @@ QB_MEM ?= "-m 256" | |||
77 | QB_SERIAL_OPT ?= "-serial mon:stdio -serial null" | 80 | QB_SERIAL_OPT ?= "-serial mon:stdio -serial null" |
78 | QB_DEFAULT_KERNEL ?= "${KERNEL_IMAGETYPE}" | 81 | QB_DEFAULT_KERNEL ?= "${KERNEL_IMAGETYPE}" |
79 | QB_DEFAULT_FSTYPE ?= "ext4" | 82 | QB_DEFAULT_FSTYPE ?= "ext4" |
83 | QB_RNG ?= "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0" | ||
80 | QB_OPT_APPEND ?= "" | 84 | QB_OPT_APPEND ?= "" |
81 | QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@" | 85 | QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@" |
82 | QB_CMDLINE_IP_SLIRP ?= "ip=dhcp" | 86 | QB_CMDLINE_IP_SLIRP ?= "ip=dhcp" |
diff --git a/meta/conf/machine/include/qemuboot-mips.inc b/meta/conf/machine/include/qemuboot-mips.inc index e99bade2e3..230f032c53 100644 --- a/meta/conf/machine/include/qemuboot-mips.inc +++ b/meta/conf/machine/include/qemuboot-mips.inc | |||
@@ -3,8 +3,6 @@ IMAGE_CLASSES += "qemuboot" | |||
3 | QB_MACHINE = "-machine malta" | 3 | QB_MACHINE = "-machine malta" |
4 | QB_KERNEL_CMDLINE_APPEND = "console=ttyS0 console=tty" | 4 | QB_KERNEL_CMDLINE_APPEND = "console=ttyS0 console=tty" |
5 | QB_OPT_APPEND = "-usb -device usb-tablet" | 5 | QB_OPT_APPEND = "-usb -device usb-tablet" |
6 | # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy | ||
7 | QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0" | ||
8 | 6 | ||
9 | # For graphics to work we need to define the VGA device as well as the necessary USB devices | 7 | # For graphics to work we need to define the VGA device as well as the necessary USB devices |
10 | QB_OPT_APPEND += "-vga std" | 8 | QB_OPT_APPEND += "-vga std" |
diff --git a/meta/conf/machine/include/qemuboot-x86.inc b/meta/conf/machine/include/qemuboot-x86.inc index ccc6dcd3bf..2a4760c717 100644 --- a/meta/conf/machine/include/qemuboot-x86.inc +++ b/meta/conf/machine/include/qemuboot-x86.inc | |||
@@ -10,6 +10,4 @@ QB_AUDIO_DRV = "alsa" | |||
10 | QB_AUDIO_OPT = "-soundhw ac97,es1370" | 10 | QB_AUDIO_OPT = "-soundhw ac97,es1370" |
11 | QB_KERNEL_CMDLINE_APPEND = "oprofile.timer=1" | 11 | QB_KERNEL_CMDLINE_APPEND = "oprofile.timer=1" |
12 | QB_OPT_APPEND = "-usb -device usb-tablet" | 12 | QB_OPT_APPEND = "-usb -device usb-tablet" |
13 | # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy | ||
14 | QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0" | ||
15 | 13 | ||
diff --git a/meta/conf/machine/include/riscv/qemuriscv.inc b/meta/conf/machine/include/riscv/qemuriscv.inc index 759c8a196e..0e88c91aa6 100644 --- a/meta/conf/machine/include/riscv/qemuriscv.inc +++ b/meta/conf/machine/include/riscv/qemuriscv.inc | |||
@@ -33,6 +33,3 @@ QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" | |||
33 | QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0" | 33 | QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0" |
34 | QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon" | 34 | QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon" |
35 | QB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon" | 35 | QB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon" |
36 | # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy | ||
37 | QB_OPT_APPEND = " -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0" | ||
38 | |||
diff --git a/meta/conf/machine/qemuarm.conf b/meta/conf/machine/qemuarm.conf index 3364dcf042..702b850cbb 100644 --- a/meta/conf/machine/qemuarm.conf +++ b/meta/conf/machine/qemuarm.conf | |||
@@ -21,8 +21,6 @@ QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0" | |||
21 | # For graphics to work we need to define the VGA device as well as the necessary USB devices | 21 | # For graphics to work we need to define the VGA device as well as the necessary USB devices |
22 | QB_OPT_APPEND = "-device VGA,edid=on" | 22 | QB_OPT_APPEND = "-device VGA,edid=on" |
23 | QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd" | 23 | QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd" |
24 | # Add the virtio RNG | ||
25 | QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0" | ||
26 | # Virtio Networking support | 24 | # Virtio Networking support |
27 | QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" | 25 | QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" |
28 | QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" | 26 | QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" |
diff --git a/meta/conf/machine/qemuarm64.conf b/meta/conf/machine/qemuarm64.conf index fdd464d708..2f61eb0aed 100644 --- a/meta/conf/machine/qemuarm64.conf +++ b/meta/conf/machine/qemuarm64.conf | |||
@@ -22,8 +22,6 @@ QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0" | |||
22 | # For graphics to work we need to define the VGA device as well as the necessary USB devices | 22 | # For graphics to work we need to define the VGA device as well as the necessary USB devices |
23 | QB_OPT_APPEND = "-device VGA,edid=on" | 23 | QB_OPT_APPEND = "-device VGA,edid=on" |
24 | QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd" | 24 | QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd" |
25 | # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy | ||
26 | QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0" | ||
27 | # Virtio Networking support | 25 | # Virtio Networking support |
28 | QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" | 26 | QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" |
29 | QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" | 27 | QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" |
diff --git a/meta/conf/machine/qemuarmv5.conf b/meta/conf/machine/qemuarmv5.conf index 48e83f13e1..7e8c9e1fa6 100644 --- a/meta/conf/machine/qemuarmv5.conf +++ b/meta/conf/machine/qemuarmv5.conf | |||
@@ -14,8 +14,6 @@ QB_SYSTEM_NAME = "qemu-system-arm" | |||
14 | QB_MACHINE = "-machine versatilepb" | 14 | QB_MACHINE = "-machine versatilepb" |
15 | QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0,115200 console=tty" | 15 | QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0,115200 console=tty" |
16 | QB_OPT_APPEND = "-usb -device usb-tablet" | 16 | QB_OPT_APPEND = "-usb -device usb-tablet" |
17 | # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy | ||
18 | QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0" | ||
19 | PREFERRED_VERSION_linux-yocto ??= "5.8%" | 17 | PREFERRED_VERSION_linux-yocto ??= "5.8%" |
20 | QB_DTB = "${@oe.utils.version_less_or_equal('PREFERRED_VERSION_linux-yocto', '4.7', '', 'zImage-versatile-pb.dtb', d)}" | 18 | QB_DTB = "${@oe.utils.version_less_or_equal('PREFERRED_VERSION_linux-yocto', '4.7', '', 'zImage-versatile-pb.dtb', d)}" |
21 | 19 | ||
diff --git a/meta/conf/machine/qemuppc.conf b/meta/conf/machine/qemuppc.conf index 9733b5e85b..a84594f335 100644 --- a/meta/conf/machine/qemuppc.conf +++ b/meta/conf/machine/qemuppc.conf | |||
@@ -17,6 +17,4 @@ QB_MACHINE = "-machine mac99" | |||
17 | QB_CPU = "-cpu G4" | 17 | QB_CPU = "-cpu G4" |
18 | QB_KERNEL_CMDLINE_APPEND = "console=tty console=ttyS0" | 18 | QB_KERNEL_CMDLINE_APPEND = "console=tty console=ttyS0" |
19 | QB_OPT_APPEND = "-usb -device usb-tablet" | 19 | QB_OPT_APPEND = "-usb -device usb-tablet" |
20 | # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy | ||
21 | QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0" | ||
22 | QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" | 20 | QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" |