From fe0ef2c6bb301c0476eea49566c55a63bb50e250 Mon Sep 17 00:00:00 2001 From: Adrian Freihofer Date: Thu, 22 Jun 2023 19:01:29 +0200 Subject: runqemu: configurable tap names Support the new environment variable OE_TAP_NAME. (From OE-Core rev: 6795dddb4074274279b7ff7b9639d15786f06a40) Signed-off-by: Adrian Freihofer Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie --- scripts/runqemu | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') 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. logger.debug('Running %s...' % str(cmd)) ip_link = subprocess.check_output(cmd).decode('utf-8') # Matches line like: 6: tap0: - possibles = re.findall('^[0-9]+: +(tap[0-9]+): <.*', ip_link, re.M) + oe_tap_name = 'tap' + if 'OE_TAP_NAME' in os.environ: + oe_tap_name = os.environ['OE_TAP_NAME'] + tap_re = '^[0-9]+: +(' + oe_tap_name + '[0-9]+): <.*' + possibles = re.findall(tap_re, ip_link, re.M) tap = "" for p in possibles: lockfile = os.path.join(lockdir, p) @@ -1198,7 +1202,7 @@ to your build configuration. logger.error("Failed to setup tap device. Run runqemu-gen-tapdevs to manually create.") sys.exit(1) self.tap = tap - tapnum = int(tap[3:]) + tapnum = int(tap[len(oe_tap_name):]) gateway = tapnum * 2 + 1 client = gateway + 1 if self.fstype == 'nfs': -- cgit v1.2.3-54-g00ecf