Skip to content

Commit 085a7d1

Browse files
committed
qemu: Split out common portions of make run rule
This will be useful later when we add targets for other architectures. Signed-off-by: David Hendricks <david.hendricks@gmail.com>
1 parent 23a775b commit 085a7d1

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

examples/qemu/Makefile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,15 @@ PATCHES_DIR := ./patches
3030
include $(OSF_BUILDER_DIR)/Makefile.inc
3131
OUT ?= build/$(PLATFORM)/osf-$(PLATFORM).rom
3232

33+
# RNG to avoid DHCP lockups when waiting for entropy
34+
# redirect all the output to the console
35+
QEMU_COMMON_OPTS := -bios $(OUT) $(QEMU_KVM_OPTS) \
36+
-m 1024 \
37+
-object rng-random,filename=/dev/urandom,id=rng0 \
38+
-nographic
39+
3340
run:
34-
ifeq ($(ARCH), amd64)
35-
sudo qemu-system-$(ARCH) \
36-
`# the machine type specified in the coreboot mainboard configuration` \
37-
-M q35 \
38-
`# use KVM to avail of hardware virtualization extensions` \
39-
-enable-kvm \
40-
`# the coreboot ROM to run as system firmware` \
41-
-bios $(OUT) \
42-
`# the amount of RAM in MB` \
43-
-m 1024 \
44-
`# RNG to avoid DHCP lockups when waiting for entropy` \
45-
-object rng-random,filename=/dev/urandom,id=rng0 \
46-
`# redirect all the output to the console` \
47-
-nographic
41+
ifeq ($(ARCH), x86_64)
42+
$(QEMU_SYSTEM) $(QEMU_COMMON_OPTS) \
43+
-M q35
4844
endif

0 commit comments

Comments
 (0)