aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-09-04 14:30:16 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-09-04 14:30:16 +0200
commit209f4dc115344db63035020f79096b0cfc299335 (patch)
treee4f1bc78024611dd416f3a8a6fd2d3fe423207d8
parent4a4d3af3d24700f7ea5d4885f7f652a4b85b7a12 (diff)
use `make net` target to prepare the tap/bridge so `make qemu-*net` wont require root
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c05b0ac..36f3e8b 100644
--- a/Makefile
+++ b/Makefile
@@ -150,6 +150,10 @@ image-repack:
rm -f '$(INITRD_TARGET)'
$(DO_BUILD)
+net:
+ sudo ip tuntap add linux-qemu-test mode tap
+ sudo /etc/qemu-ifup linux-qemu-test
+
qemu: image
qemu-system-$(ARCH) -kernel '$(LINUX_BUILD_DIR)/arch/$(ARCH)/boot/bzImage' -initrd '$(INITRD_TARGET)' -enable-kvm -vga qxl -display sdl
@@ -159,9 +163,13 @@ qemu-console: image
qemu-serial: image
qemu-system-$(ARCH) -kernel '$(LINUX_BUILD_DIR)/arch/$(ARCH)/boot/bzImage' -initrd '$(INITRD_TARGET)' -enable-kvm -nographic -append console=ttyS0
+qemu-serial-net: image
+ qemu-system-$(ARCH) -kernel '$(LINUX_BUILD_DIR)/arch/$(ARCH)/boot/bzImage' -initrd '$(INITRD_TARGET)' -enable-kvm -nographic \
+ -net nic,macaddr=$(NET_HWADDR) -net tap,ifname=linux-qemu-test,br=$(NET_BRIDGE),script=no,downscript=no -append 'net $(if $(NET_IP4),ip4) console=ttyS0'
+
qemu-net: image
qemu-system-$(ARCH) -kernel '$(LINUX_BUILD_DIR)/arch/$(ARCH)/boot/bzImage' -initrd '$(INITRD_TARGET)' -enable-kvm -vga qxl -display sdl \
- -net nic,macaddr=$(NET_HWADDR) -net tap,ifname=linux-qemu-test,br=$(NET_BRIDGE) -append 'net $(if $(NET_IP4),ip4)'
+ -net nic,macaddr=$(NET_HWADDR) -net tap,ifname=linux-qemu-test,br=$(NET_BRIDGE),script=no,downscript=no -append 'net $(if $(NET_IP4),ip4)'
define HELP_PREFIX
@echo "\t make $1\t- $2"