summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Zhukov <pazhukov@suse.de>2023-04-18 15:33:25 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-04-20 11:56:03 +0100
commitd4073dedbb234ff3c6bbebafc836fedf90d96569 (patch)
tree9f972d49ff6cf9a989111dd6ee6b75db07a3cb98
parenteb3ec7469fff857c819332371ad1d586f43c79c3 (diff)
downloadopenembedded-core-contrib-d4073dedbb234ff3c6bbebafc836fedf90d96569.tar.gz
scripts/runqemu: Add possibility to disable network
Default network configuration requires tun/tap module and while being usable it conflicts with tap devices created by VPN clients sometimes and requires root permissions to use . While it's possible to work this around it's not always feasible if network is not required Add nonetwork option which can be specified if the network connectivity is not needed and SDL/serial is enough to communicate with the image. Signed-off-by: Pavel Zhukov <pazhukov@suse.de> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
-rwxr-xr-xscripts/runqemu7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 4c06cefbff..56715c3e1e 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -66,6 +66,7 @@ of the following environment variables (in any order):
MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)
Simplified QEMU command-line options can be passed with:
nographic - disable video console
+ nonetwork - disable network connectivity
novga - Disable VGA emulation completely
sdl - choose the SDL UI frontend
gtk - choose the Gtk UI frontend
@@ -178,6 +179,7 @@ class BaseConfig(object):
self.serialconsole = False
self.serialstdio = False
self.nographic = False
+ self.nonetwork = False
self.sdl = False
self.gtk = False
self.gl = False
@@ -495,6 +497,8 @@ to your build configuration.
self.check_arg_fstype(arg)
elif arg == 'nographic':
self.nographic = True
+ elif arg == "nonetwork":
+ self.nonetwork = True
elif arg == 'sdl':
self.sdl = True
elif arg == 'gtk':
@@ -1224,7 +1228,8 @@ to your build configuration.
self.set('NETWORK_CMD', '%s %s' % (self.network_device.replace('@MAC@', mac), qemu_tap_opt))
def setup_network(self):
- if self.get('QB_NET') == 'none':
+ if self.nonetwork or self.get('QB_NET') == 'none':
+ self.set('NETWORK_CMD', '-nic none')
return
if sys.stdin.isatty():
self.saved_stty = subprocess.check_output(("stty", "-g")).decode('utf-8').strip()