Fix live images when using the extensible sdk
cover Fix live images when using the extensible sdk
The following changes since commit 505a82673ac2487df5ea343a6422c2fc47018831:
build-appliance-image: Update to jethro head revision (2015-10-21 23:13:11 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib rewitt/codepage
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=rewitt/codepage
Randy Witt (3):
Add 850 codepage to uninative-tarball mtools_4.0.18.bb: Use create_wrapper() for mcopy wic/utils/oe/misc.py: Preserve PATH when running native tools
Richard Purdie (2):
scripts/oe-pkgdata-util: Fix variable name in error handling
populate_sdk_base: Ensure PKGDATA_DIR exists
meta/classes/populate_sdk_base.bbclass | 2 +- meta/recipes-core/meta/uninative-tarball.bb | 1 + meta/recipes-devtools/mtools/mtools_4.0.18.bb | 5 +++++ scripts/lib/wic/utils/oe/misc.py | 20 ++++++++++++++++---- scripts/oe-pkgdata-util | 2 +- 5 files changed, 24 insertions(+), 6 deletions(-)
Signature · 1 line
2.4.3
PATCH 1/5 Add 850 codepage to uninative-tarball
--- meta/recipes-core/meta/uninative-tarball.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-core/meta/uninative-tarball.bb +1 -0
@@ -7,6 +7,7 @@ TOOLCHAIN_TARGET_TASK = "" TOOLCHAIN_HOST_TASK = "\ nativesdk-glibc \ + nativesdk-glibc-gconv-ibm850 \ nativesdk-patchelf \ "
Signature · 1 line
2.4.3
PATCH 2/5 scripts/oe-pkgdata-util: Fix variable name in error handling
From: Richard Purdie <[email protected]>
Fix:
logger.error('Unable to find pkgdata directory %s' % pkgdata_dir)
NameError: global name 'pkgdata_dir' is not defined
--- scripts/oe-pkgdata-util | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/oe-pkgdata-util +1 -1
@@ -496,7 +496,7 @@ def main(): sys.exit(1) if not os.path.exists(args.pkgdata_dir): - logger.error('Unable to find pkgdata directory %s' % pkgdata_dir) + logger.error('Unable to find pkgdata directory %s' % args.pkgdata_dir) sys.exit(1) ret = args.func(args)
Signature · 1 line
2.4.3
PATCH 3/5 populate_sdk_base: Ensure PKGDATA_DIR exists
In reply to Randy WittFrom: Richard Purdie <[email protected]>
--- meta/classes/populate_sdk_base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/populate_sdk_base.bbclass +1 -1
@@ -188,7 +188,7 @@ populate_sdk_log_check() { done } -do_populate_sdk[dirs] = "${TOPDIR}" +do_populate_sdk[dirs] = "${TOPDIR} ${PKGDATA_DIR}" do_populate_sdk[depends] += "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_DEPENDS', True).split()])} ${@d.getVarFlag('do_rootfs', 'depends', False)}" do_populate_sdk[rdepends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_RDEPENDS', True).split()])}" do_populate_sdk[recrdeptask] += "do_packagedata do_package_write_rpm do_package_write_ipk do_package_write_deb"
Signature · 1 line
2.4.3
Re: [PATCH 3/5] populate_sdk_base: Ensure PKGDATA_DIR exists
meta/classes/populate_sdk_base.bbclass populate_sdk_log_check() { · line 191
Quoted 3 lines · Randy Witt
meta/classes/populate_sdk_base.bbclass +1
-1-do_populate_sdk[dirs] = "${TOPDIR}" +do_populate_sdk[dirs] = "${TOPDIR} ${PKGDATA_DIR}"
I hope do_populate_sdk doesn't care where it's run from, as this doesn't just make sure the dir exists, it changes the dir the task runs in (the last entry in dirs is the cwd of the task).
Signature · 5 lines
Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
Re: [PATCH 3/5] populate_sdk_base: Ensure PKGDATA_DIR exists
Quoted 8 lines · Christopher Larson
On Thu, Oct 22, 2015 at 8:30 PM, Randy Witt
<[email protected]> wrote:-do_populate_sdk[dirs] = "${TOPDIR}" +do_populate_sdk[dirs] = "${TOPDIR} ${PKGDATA_DIR}"I hope
do_populate_sdkdoesn't care where it's run from, as this doesn't just make sure the dir exists, it changes the dir the task runs in (the last entry in dirs is the cwd of the task).
I was trying to remember which way around that was and planned to check before merging. I agree this needs to be reversed (and the commit needs a touch more explanation). I'll tweak that.
Cheers,
Richard
PATCH 4/5 mtools_4.0.18.bb: Use create_wrapper() for mcopy
In reply to Randy Wittmcopy uses the IBM850 codepage from gconv. The default install location for gconv will not match the actual install location since it can be pulled from sstate. This patch overrides the default location when running by adding GCONV_PATH to the environment for mcopy.
[YOCTO #7629]
--- meta/recipes-devtools/mtools/mtools_4.0.18.bb | 5 +++++ 1 file changed, 5 insertions(+)
meta/recipes-devtools/mtools/mtools_4.0.18.bb +5 -0
@@ -45,3 +45,8 @@ do_install_prepend () { mkdir -p ${D}/${bindir} mkdir -p ${D}/${datadir} } + +do_install_append_class-native () { + create_wrapper ${D}${bindir}/mcopy \ + GCONV_PATH=${libdir}/gconv +}
Signature · 1 line
2.4.3
PATCH 5/5 wic/utils/oe/misc.py: Preserve PATH when running native tools
In reply to Randy WittPreviously exec_native_cmd() would remove all items from PATH except for the native sysroot. This can cause issues for the tools that are created using create_wrapper().
Now instead of wiping out the PATH, run a sanity check to check if the command is in the native sysroot.
--- scripts/lib/wic/utils/oe/misc.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
scripts/lib/wic/utils/oe/misc.py +16 -4
@@ -82,6 +82,12 @@ def exec_cmd(cmd_and_args, as_shell=False, catch=3): return out +def cmd_in_path(cmd, path): + import scriptpath + + scriptpath.add_bitbake_lib_path() + + return bb.utils.which(path, cmd) != "" or False def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): """
@@ -92,15 +98,21 @@ def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): Always need to execute native commands as_shell """ native_paths = \ - "export PATH=%s/sbin:%s/usr/sbin:%s/usr/bin" % \ + "%s/sbin:%s/usr/sbin:%s/usr/bin" % \ (native_sysroot, native_sysroot, native_sysroot) - native_cmd_and_args = "%s;%s" % (native_paths, cmd_and_args) + native_cmd_and_args = "export PATH=%s:$PATH;%s" % \ + (native_paths, cmd_and_args) msger.debug("exec_native_cmd: %s" % cmd_and_args) - args = cmd_and_args.split() + # The reason -1 is used is because there may be "export" commands. + args = cmd_and_args.split(';')[-1].split() msger.debug(args) - ret, out = _exec_cmd(native_cmd_and_args, True, catch) + # If the command isn't in the native sysroot say we failed. + if cmd_in_path(args[0], native_paths): + ret, out = _exec_cmd(native_cmd_and_args, True, catch) + else: + ret = 127 if ret == 127: # shell command-not-found prog = args[0]
Signature · 1 line
2.4.3