mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
wic: misc: Do not find for executables in ASSUME_PROVIDED
Executables like tar won't be available on the native sysroot, as they are part of the ASSUME_PROVIDED variable. Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: 2f574d535f8665b26dab65c14668cf8fc7b751c0) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
6cfcc149ef
commit
fc2589384b
+12
-2
@@ -45,7 +45,8 @@ NATIVE_RECIPES = {"bmaptool": "bmap-tools",
|
|||||||
"parted": "parted",
|
"parted": "parted",
|
||||||
"sfdisk": "util-linux",
|
"sfdisk": "util-linux",
|
||||||
"sgdisk": "gptfdisk",
|
"sgdisk": "gptfdisk",
|
||||||
"syslinux": "syslinux"
|
"syslinux": "syslinux",
|
||||||
|
"tar": "tar"
|
||||||
}
|
}
|
||||||
|
|
||||||
def runtool(cmdln_or_args):
|
def runtool(cmdln_or_args):
|
||||||
@@ -112,6 +113,15 @@ def exec_cmd(cmd_and_args, as_shell=False):
|
|||||||
"""
|
"""
|
||||||
return _exec_cmd(cmd_and_args, as_shell)[1]
|
return _exec_cmd(cmd_and_args, as_shell)[1]
|
||||||
|
|
||||||
|
def find_executable(cmd, paths):
|
||||||
|
recipe = cmd
|
||||||
|
if recipe in NATIVE_RECIPES:
|
||||||
|
recipe = NATIVE_RECIPES[recipe]
|
||||||
|
provided = get_bitbake_var("ASSUME_PROVIDED")
|
||||||
|
if provided and "%s-native" % recipe in provided:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return spawn.find_executable(cmd, paths)
|
||||||
|
|
||||||
def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""):
|
def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""):
|
||||||
"""
|
"""
|
||||||
@@ -136,7 +146,7 @@ def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""):
|
|||||||
logger.debug("exec_native_cmd: %s", native_cmd_and_args)
|
logger.debug("exec_native_cmd: %s", native_cmd_and_args)
|
||||||
|
|
||||||
# If the command isn't in the native sysroot say we failed.
|
# If the command isn't in the native sysroot say we failed.
|
||||||
if spawn.find_executable(args[0], native_paths):
|
if find_executable(args[0], native_paths):
|
||||||
ret, out = _exec_cmd(native_cmd_and_args, True)
|
ret, out = _exec_cmd(native_cmd_and_args, True)
|
||||||
else:
|
else:
|
||||||
ret = 127
|
ret = 127
|
||||||
|
|||||||
Reference in New Issue
Block a user