diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2016-09-18 00:39:29 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-20 15:11:08 +0100 |
commit | 5637f8605f824fe69bf4b9af037388b99d9c9e6e (patch) | |
tree | 11e05b869ef5c91d517778e0ffc9e98740599810 /scripts/runqemu | |
parent | 5060e66c75ed01e00b0c9002e3457dc688c5938d (diff) | |
download | poky-5637f8605f824fe69bf4b9af037388b99d9c9e6e.tar.gz |
runqemu: use OECORE_NATIVE_SYSROOT from sdk
There is no STAGING_DIR_NATIVE or bitbake in a extracted sdk,
so check OECORE_NATIVE_SYSROOT and use it.
(From OE-Core rev: 93649edc034f2540ff55dc9b41638797209cfb9c)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 4050dccfbe..30a49590c4 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -619,18 +619,25 @@ class BaseConfig(object): | |||
619 | self.set(nv, s.group(1)) | 619 | self.set(nv, s.group(1)) |
620 | else: | 620 | else: |
621 | # when we're invoked from a running bitbake instance we won't | 621 | # when we're invoked from a running bitbake instance we won't |
622 | # be able to call `bitbake -e` but should have OE_TMPDIR set in | 622 | # be able to call `bitbake -e`, then try: |
623 | # the environment and can guess paths based on it | 623 | # - get OE_TMPDIR from environment and guess paths based on it |
624 | # - get OECORE_NATIVE_SYSROOT from environment (for sdk) | ||
624 | tmpdir = os.environ.get('OE_TMPDIR', None) | 625 | tmpdir = os.environ.get('OE_TMPDIR', None) |
626 | oecore_native_sysroot = os.environ.get('OECORE_NATIVE_SYSROOT', None) | ||
625 | if tmpdir: | 627 | if tmpdir: |
626 | logger.info('Setting STAGING_DIR_NATIVE and STAGING_BINDIR_NATIVE relative to OE_TMPDIR (%s)' % tmpdir) | 628 | logger.info('Setting STAGING_DIR_NATIVE and STAGING_BINDIR_NATIVE relative to OE_TMPDIR (%s)' % tmpdir) |
627 | hostos, _, _, _, machine = os.uname() | 629 | hostos, _, _, _, machine = os.uname() |
628 | buildsys = '%s-%s' % (machine, hostos.lower()) | 630 | buildsys = '%s-%s' % (machine, hostos.lower()) |
629 | staging_dir_native = '%s/sysroots/%s' % (tmpdir, buildsys) | 631 | staging_dir_native = '%s/sysroots/%s' % (tmpdir, buildsys) |
630 | self.set('STAGING_DIR_NATIVE', staging_dir_native) | 632 | self.set('STAGING_DIR_NATIVE', staging_dir_native) |
633 | elif oecore_native_sysroot: | ||
634 | logger.info('Setting STAGING_DIR_NATIVE to OECORE_NATIVE_SYSROOT (%s)' % oecore_native_sysroot) | ||
635 | self.set('STAGING_DIR_NATIVE', oecore_native_sysroot) | ||
636 | if self.get('STAGING_DIR_NATIVE'): | ||
631 | # we have to assume that STAGING_BINDIR_NATIVE is at usr/bin | 637 | # we have to assume that STAGING_BINDIR_NATIVE is at usr/bin |
632 | staging_bindir_native = '%s/usr/bin' % staging_dir_native | 638 | staging_bindir_native = '%s/usr/bin' % self.get('STAGING_DIR_NATIVE') |
633 | self.set('STAGING_BINDIR_NATIVE', staging_bindir_native) | 639 | logger.info('Setting STAGING_BINDIR_NATIVE to %s' % staging_bindir_native) |
640 | self.set('STAGING_BINDIR_NATIVE', '%s/usr/bin' % self.get('STAGING_DIR_NATIVE')) | ||
634 | 641 | ||
635 | def print_config(self): | 642 | def print_config(self): |
636 | logger.info('Continuing with the following parameters:\n') | 643 | logger.info('Continuing with the following parameters:\n') |