diff options
author | Pavel Zhukov <pazhukov@suse.de> | 2023-04-18 15:33:25 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-04-20 11:56:06 +0100 |
commit | c1e24cee0edae07611e3ddb2659f6109df14e9ae (patch) | |
tree | ea9605fec79be49f76bd3c3265297651e3f03c8b /scripts/runqemu | |
parent | d84eb2a5e484992952f79b5829ae516c823460f1 (diff) | |
download | poky-c1e24cee0edae07611e3ddb2659f6109df14e9ae.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.
(From OE-Core rev: d4073dedbb234ff3c6bbebafc836fedf90d96569)
Signed-off-by: Pavel Zhukov <pazhukov@suse.de>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 7 |
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): | |||
66 | MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified) | 66 | MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified) |
67 | Simplified QEMU command-line options can be passed with: | 67 | Simplified QEMU command-line options can be passed with: |
68 | nographic - disable video console | 68 | nographic - disable video console |
69 | nonetwork - disable network connectivity | ||
69 | novga - Disable VGA emulation completely | 70 | novga - Disable VGA emulation completely |
70 | sdl - choose the SDL UI frontend | 71 | sdl - choose the SDL UI frontend |
71 | gtk - choose the Gtk UI frontend | 72 | gtk - choose the Gtk UI frontend |
@@ -178,6 +179,7 @@ class BaseConfig(object): | |||
178 | self.serialconsole = False | 179 | self.serialconsole = False |
179 | self.serialstdio = False | 180 | self.serialstdio = False |
180 | self.nographic = False | 181 | self.nographic = False |
182 | self.nonetwork = False | ||
181 | self.sdl = False | 183 | self.sdl = False |
182 | self.gtk = False | 184 | self.gtk = False |
183 | self.gl = False | 185 | self.gl = False |
@@ -495,6 +497,8 @@ to your build configuration. | |||
495 | self.check_arg_fstype(arg) | 497 | self.check_arg_fstype(arg) |
496 | elif arg == 'nographic': | 498 | elif arg == 'nographic': |
497 | self.nographic = True | 499 | self.nographic = True |
500 | elif arg == "nonetwork": | ||
501 | self.nonetwork = True | ||
498 | elif arg == 'sdl': | 502 | elif arg == 'sdl': |
499 | self.sdl = True | 503 | self.sdl = True |
500 | elif arg == 'gtk': | 504 | elif arg == 'gtk': |
@@ -1224,7 +1228,8 @@ to your build configuration. | |||
1224 | self.set('NETWORK_CMD', '%s %s' % (self.network_device.replace('@MAC@', mac), qemu_tap_opt)) | 1228 | self.set('NETWORK_CMD', '%s %s' % (self.network_device.replace('@MAC@', mac), qemu_tap_opt)) |
1225 | 1229 | ||
1226 | def setup_network(self): | 1230 | def setup_network(self): |
1227 | if self.get('QB_NET') == 'none': | 1231 | if self.nonetwork or self.get('QB_NET') == 'none': |
1232 | self.set('NETWORK_CMD', '-nic none') | ||
1228 | return | 1233 | return |
1229 | if sys.stdin.isatty(): | 1234 | if sys.stdin.isatty(): |
1230 | self.saved_stty = subprocess.check_output(("stty", "-g")).decode('utf-8').strip() | 1235 | self.saved_stty = subprocess.check_output(("stty", "-g")).decode('utf-8').strip() |