public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Alexander Kanavin <alex.kanavin@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Alexander Kanavin <alex@linutronix.de>
Subject: [PATCH 3/3] scripts/runqemu: remove the code block that works around the missing bitbake environment
Date: Tue,  7 Oct 2025 14:46:52 +0200	[thread overview]
Message-ID: <20251007124652.259629-3-alex.kanavin@gmail.com> (raw)
In-Reply-To: <20251007124652.259629-1-alex.kanavin@gmail.com>

From: Alexander Kanavin <alex@linutronix.de>

As confirmed by the previous patch this code path is never taken
and can be removed.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 scripts/runqemu | 34 ++++++----------------------------
 1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 1e8406e1194..2be7a0f2869 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1007,34 +1007,12 @@ to your build configuration.
             if not self.bitbake_e:
                 self.load_bitbake_env()
 
-            if self.bitbake_e:
-                native_vars = ['STAGING_DIR_NATIVE']
-                for nv in native_vars:
-                    s = re.search('^%s="(.*)"' % nv, self.bitbake_e, re.M)
-                    if s and s.group(1) != self.get(nv):
-                        logger.info('Overriding conf file setting of %s to %s from Bitbake environment' % (nv, s.group(1)))
-                        self.set(nv, s.group(1))
-            else:
-                # when we're invoked from a running bitbake instance we won't
-                # be able to call `bitbake -e`, then try:
-                # - get OE_TMPDIR from environment and guess paths based on it
-                # - get OECORE_NATIVE_SYSROOT from environment (for sdk)
-                tmpdir = self.get('OE_TMPDIR')
-                oecore_native_sysroot = self.get('OECORE_NATIVE_SYSROOT')
-                if tmpdir:
-                    logger.info('Setting STAGING_DIR_NATIVE and STAGING_BINDIR_NATIVE relative to OE_TMPDIR (%s)' % tmpdir)
-                    hostos, _, _, _, machine = os.uname()
-                    buildsys = '%s-%s' % (machine, hostos.lower())
-                    staging_dir_native = '%s/sysroots/%s' % (tmpdir, buildsys)
-                    self.set('STAGING_DIR_NATIVE', staging_dir_native)
-                elif oecore_native_sysroot:
-                    logger.info('Setting STAGING_DIR_NATIVE to OECORE_NATIVE_SYSROOT (%s)' % oecore_native_sysroot)
-                    self.set('STAGING_DIR_NATIVE', oecore_native_sysroot)
-                if self.get('STAGING_DIR_NATIVE'):
-                    # we have to assume that STAGING_BINDIR_NATIVE is at usr/bin
-                    staging_bindir_native = '%s/usr/bin' % self.get('STAGING_DIR_NATIVE')
-                    logger.info('Setting STAGING_BINDIR_NATIVE to %s' % staging_bindir_native)
-                    self.set('STAGING_BINDIR_NATIVE', '%s/usr/bin' % self.get('STAGING_DIR_NATIVE'))
+            native_vars = ['STAGING_DIR_NATIVE']
+            for nv in native_vars:
+                s = re.search('^%s="(.*)"' % nv, self.bitbake_e, re.M)
+                if s and s.group(1) != self.get(nv):
+                    logger.info('Overriding conf file setting of %s to %s from Bitbake environment' % (nv, s.group(1)))
+                    self.set(nv, s.group(1))
 
     def print_config(self):
         logoutput = ['Continuing with the following parameters:']
-- 
2.39.5



      parent reply	other threads:[~2025-10-07 12:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07 12:46 [PATCH 1/3] scripts/runqemu: raise an error when bitbake was not found Alexander Kanavin
2025-10-07 12:46 ` [PATCH 2/3] runqemu: ensure that bitbake environment is either returned, or an exception is raised Alexander Kanavin
2025-10-07 12:46 ` Alexander Kanavin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251007124652.259629-3-alex.kanavin@gmail.com \
    --to=alex.kanavin@gmail.com \
    --cc=alex@linutronix.de \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox