diff options
-rw-r--r-- | scripts/lib/wic/misc.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py index 1f199b9f23..91975ba151 100644 --- a/scripts/lib/wic/misc.py +++ b/scripts/lib/wic/misc.py | |||
@@ -45,7 +45,8 @@ NATIVE_RECIPES = {"bmaptool": "bmap-tools", | |||
45 | "parted": "parted", | 45 | "parted": "parted", |
46 | "sfdisk": "util-linux", | 46 | "sfdisk": "util-linux", |
47 | "sgdisk": "gptfdisk", | 47 | "sgdisk": "gptfdisk", |
48 | "syslinux": "syslinux" | 48 | "syslinux": "syslinux", |
49 | "tar": "tar" | ||
49 | } | 50 | } |
50 | 51 | ||
51 | def runtool(cmdln_or_args): | 52 | def runtool(cmdln_or_args): |
@@ -112,6 +113,15 @@ def exec_cmd(cmd_and_args, as_shell=False): | |||
112 | """ | 113 | """ |
113 | return _exec_cmd(cmd_and_args, as_shell)[1] | 114 | return _exec_cmd(cmd_and_args, as_shell)[1] |
114 | 115 | ||
116 | def find_executable(cmd, paths): | ||
117 | recipe = cmd | ||
118 | if recipe in NATIVE_RECIPES: | ||
119 | recipe = NATIVE_RECIPES[recipe] | ||
120 | provided = get_bitbake_var("ASSUME_PROVIDED") | ||
121 | if provided and "%s-native" % recipe in provided: | ||
122 | return True | ||
123 | |||
124 | return spawn.find_executable(cmd, paths) | ||
115 | 125 | ||
116 | def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): | 126 | def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): |
117 | """ | 127 | """ |
@@ -136,7 +146,7 @@ def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): | |||
136 | logger.debug("exec_native_cmd: %s", native_cmd_and_args) | 146 | logger.debug("exec_native_cmd: %s", native_cmd_and_args) |
137 | 147 | ||
138 | # If the command isn't in the native sysroot say we failed. | 148 | # If the command isn't in the native sysroot say we failed. |
139 | if spawn.find_executable(args[0], native_paths): | 149 | if find_executable(args[0], native_paths): |
140 | ret, out = _exec_cmd(native_cmd_and_args, True) | 150 | ret, out = _exec_cmd(native_cmd_and_args, True) |
141 | else: | 151 | else: |
142 | ret = 127 | 152 | ret = 127 |