From 5e35a058c2909267b6da634a8bf66fce581e3f12 Mon Sep 17 00:00:00 2001 From: Jerome Forissier <jerome.forissier@linaro.org> Date: Tue, 21 Aug 2018 10:01:32 +0200 Subject: [PATCH] qemu: buildroot: always enable networking Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> --- common.mk | 15 ++++----------- docs/qemu.md | 12 +++++++----- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/common.mk b/common.mk index 3abdf4d..f4232f9 100644 --- a/common.mk +++ b/common.mk @@ -37,9 +37,6 @@ CCACHE ?= $(shell which ccache) # Don't remove this comment (space is needed) QEMU_VIRTFS_ENABLE ?= n QEMU_VIRTFS_HOST_DIR ?= $(ROOT) -# Enable SLiRP user networking -QEMU_USERNET_ENABLE ?= n - ################################################################################ # Mandatory for autotools (for specifying --host) ################################################################################ @@ -309,10 +306,8 @@ QEMU_EXTRA_ARGS +=\ -device virtio-9p-device,fsdev=fsdev0,mount_tag=host endif -ifeq ($(QEMU_USERNET_ENABLE),y) -QEMU_EXTRA_ARGS +=\ - -netdev user,id=vmnic -device virtio-net-device,netdev=vmnic -endif +# Enable QEMU SLiRP user networking +QEMU_EXTRA_ARGS += -netdev user,id=vmnic -device virtio-net-device,netdev=vmnic define run-help @echo @@ -511,10 +506,8 @@ filelist-tee-common: optee-client xtest optee-examples echo "file /lib/libyaml-0.so.2.0.5 $(LIBYAML_LIB_OUT)/libyaml-0.so.2.0.5 755 0 0" \ >> $(fl); \ fi - @if [ "$(QEMU_USERNET_ENABLE)" = "y" ]; then \ - echo "slink /etc/rc.d/S02_udhcp_networking /etc/init.d/udhcpc 755 0 0" \ - >> $(fl); \ - fi + @echo "slink /etc/rc.d/S02_udhcp_networking /etc/init.d/udhcpc 755 0 0" \ + >> $(fl); @echo "# Secure storage dir" >> $(fl) @echo "dir /data 755 0 0" >> $(fl) @echo "dir /data/tee 755 0 0" >> $(fl) diff --git a/docs/qemu.md b/docs/qemu.md index c9559d8..f1cdc2c 100644 --- a/docs/qemu.md +++ b/docs/qemu.md @@ -45,12 +45,14 @@ To mount host folder in QEMU, simply run: ```bash $ mount -t 9p -o trans=virtio host <mount_point> ``` -# 5. SLiRP user networking -To enable SLiRP user networking just set `QEMU_USERNET_ENABLE ?= y` in `common.mk`. -After booting QEMU VM, eth0 will automatically receive IP address via DHCP +# 5. Networking +After booting the QEMU VM, `eth0` will automatically receive an IP address from +QEMU via DHCP thanks to the SLiRP user networking feature. QEMU will act as a +gateway to the host network [SLiRP]. -*Important* Take into account that ICMP doesn't work in SLiRP mode, -so `ping` utility won't work. +Please note that ICMP won't work in the guest unless additional configuration is +made, so the `ping` utility won't work. [bios]: https://github.com/linaro-swg/bios_qemu_tz_arm [README.md]: ../README.md +[SLiRP]: https://wiki.qemu.org/Documentation/Networking#User_Networking_.28SLIRP.29 -- GitLab