Skip to content
Snippets Groups Projects
Commit 5e35a058 authored by Jerome Forissier's avatar Jerome Forissier Committed by Jérôme Forissier
Browse files

qemu: buildroot: always enable networking


Signed-off-by: default avatarJerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
parent d97413e8
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment