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 8fb508dd39..57c042c503 100644 --- a/scripts/lib/wic/misc.py +++ b/scripts/lib/wic/misc.py | |||
@@ -46,7 +46,8 @@ NATIVE_RECIPES = {"bmaptool": "bmap-tools", | |||
46 | "parted": "parted", | 46 | "parted": "parted", |
47 | "sfdisk": "util-linux", | 47 | "sfdisk": "util-linux", |
48 | "sgdisk": "gptfdisk", | 48 | "sgdisk": "gptfdisk", |
49 | "syslinux": "syslinux" | 49 | "syslinux": "syslinux", |
50 | "tar": "tar" | ||
50 | } | 51 | } |
51 | 52 | ||
52 | def runtool(cmdln_or_args): | 53 | def runtool(cmdln_or_args): |
@@ -113,6 +114,15 @@ def exec_cmd(cmd_and_args, as_shell=False): | |||
113 | """ | 114 | """ |
114 | return _exec_cmd(cmd_and_args, as_shell)[1] | 115 | return _exec_cmd(cmd_and_args, as_shell)[1] |
115 | 116 | ||
117 | def find_executable(cmd, paths): | ||
118 | recipe = cmd | ||
119 | if recipe in NATIVE_RECIPES: | ||
120 | recipe = NATIVE_RECIPES[recipe] | ||
121 | provided = get_bitbake_var("ASSUME_PROVIDED") | ||
122 | if provided and "%s-native" % recipe in provided: | ||
123 | return True | ||
124 | |||
125 | return spawn.find_executable(cmd, paths) | ||
116 | 126 | ||
117 | def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): | 127 | def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): |
118 | """ | 128 | """ |
@@ -141,7 +151,7 @@ def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): | |||
141 | logger.debug("exec_native_cmd: %s", native_cmd_and_args) | 151 | logger.debug("exec_native_cmd: %s", native_cmd_and_args) |
142 | 152 | ||
143 | # If the command isn't in the native sysroot say we failed. | 153 | # If the command isn't in the native sysroot say we failed. |
144 | if spawn.find_executable(args[0], native_paths): | 154 | if find_executable(args[0], native_paths): |
145 | ret, out = _exec_cmd(native_cmd_and_args, True) | 155 | ret, out = _exec_cmd(native_cmd_and_args, True) |
146 | else: | 156 | else: |
147 | ret = 127 | 157 | ret = 127 |