diff options
author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2023-06-22 19:01:29 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-24 12:21:48 +0100 |
commit | fe0ef2c6bb301c0476eea49566c55a63bb50e250 (patch) | |
tree | df6afa840df5f68af2d70c6bf6a7747fd68497c4 /scripts | |
parent | 9e1e717bf7498d645891eba80f8db455bd4f036b (diff) | |
download | poky-fe0ef2c6bb301c0476eea49566c55a63bb50e250.tar.gz |
runqemu: configurable tap names
Support the new environment variable OE_TAP_NAME.
(From OE-Core rev: 6795dddb4074274279b7ff7b9639d15786f06a40)
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index bd1f8366b6..e1aa5a925c 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -1159,7 +1159,11 @@ to your build configuration. | |||
1159 | logger.debug('Running %s...' % str(cmd)) | 1159 | logger.debug('Running %s...' % str(cmd)) |
1160 | ip_link = subprocess.check_output(cmd).decode('utf-8') | 1160 | ip_link = subprocess.check_output(cmd).decode('utf-8') |
1161 | # Matches line like: 6: tap0: <foo> | 1161 | # Matches line like: 6: tap0: <foo> |
1162 | possibles = re.findall('^[0-9]+: +(tap[0-9]+): <.*', ip_link, re.M) | 1162 | oe_tap_name = 'tap' |
1163 | if 'OE_TAP_NAME' in os.environ: | ||
1164 | oe_tap_name = os.environ['OE_TAP_NAME'] | ||
1165 | tap_re = '^[0-9]+: +(' + oe_tap_name + '[0-9]+): <.*' | ||
1166 | possibles = re.findall(tap_re, ip_link, re.M) | ||
1163 | tap = "" | 1167 | tap = "" |
1164 | for p in possibles: | 1168 | for p in possibles: |
1165 | lockfile = os.path.join(lockdir, p) | 1169 | lockfile = os.path.join(lockdir, p) |
@@ -1198,7 +1202,7 @@ to your build configuration. | |||
1198 | logger.error("Failed to setup tap device. Run runqemu-gen-tapdevs to manually create.") | 1202 | logger.error("Failed to setup tap device. Run runqemu-gen-tapdevs to manually create.") |
1199 | sys.exit(1) | 1203 | sys.exit(1) |
1200 | self.tap = tap | 1204 | self.tap = tap |
1201 | tapnum = int(tap[3:]) | 1205 | tapnum = int(tap[len(oe_tap_name):]) |
1202 | gateway = tapnum * 2 + 1 | 1206 | gateway = tapnum * 2 + 1 |
1203 | client = gateway + 1 | 1207 | client = gateway + 1 |
1204 | if self.fstype == 'nfs': | 1208 | if self.fstype == 'nfs': |