summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-08-03 16:51:48 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-09 00:14:01 -0700
commit87a846d588f49ce2e0e166fa3f7c671d97821635 (patch)
tree9bfd7fc6b7160fe142ad027adc2a3ff517e3d4de /scripts
parentdaa81093148a7c5a7786bd4e9b86ab9d5187e4af (diff)
downloadpoky-87a846d588f49ce2e0e166fa3f7c671d97821635.tar.gz
wic: Report recipe name for native commands
exec_native_cmd was modified to report recipe to build native programs. Pairs executable->recipe are hardcoded as it's not possible to obtain this information automatically. [YOCTO #7631] (From OE-Core rev: 1274379c91ee8e2fb9fbb34a6445cd5767eb4a35) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/utils/oe/misc.py29
1 files changed, 26 insertions, 3 deletions
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index 49787456b2..af831d3505 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -30,6 +30,21 @@ from collections import defaultdict
30from wic import msger 30from wic import msger
31from wic.utils import runner 31from wic.utils import runner
32 32
33# executable -> recipe pairs for exec_native_cmd
34NATIVE_RECIPES = {"mcopy": "mtools",
35 "mkdosfs": "dosfstools",
36 "mkfs.btrfs": "btrfs-tools",
37 "mkfs.ext2": "e2fsprogs",
38 "mkfs.ext3": "e2fsprogs",
39 "mkfs.ext4": "e2fsprogs",
40 "mkfs.vfat": "dosfstools",
41 "mksquashfs": "squashfs-tools",
42 "mkswqp": "util-linux",
43 "parted": "parted",
44 "sgdisk": "gptfdisk",
45 "syslinux": "syslinux"
46 }
47
33def __exec_cmd(cmd_and_args, as_shell=False, catch=3): 48def __exec_cmd(cmd_and_args, as_shell=False, catch=3):
34 """ 49 """
35 Execute command, catching stderr, stdout 50 Execute command, catching stderr, stdout
@@ -85,9 +100,17 @@ def exec_native_cmd(cmd_and_args, native_sysroot, catch=3):
85 rc, out = __exec_cmd(native_cmd_and_args, True, catch) 100 rc, out = __exec_cmd(native_cmd_and_args, True, catch)
86 101
87 if rc == 127: # shell command-not-found 102 if rc == 127: # shell command-not-found
88 msger.error("A native program %s required to build the image " 103 prog = args[0]
89 "was not found (see details above). Please make sure " 104 msg = "A native program %s required to build the image "\
90 "it's installed and try again." % args[0]) 105 "was not found (see details above).\n\n" % prog
106 recipe = NATIVE_RECIPES.get(prog)
107 if recipe:
108 msg += "Please bake it with 'bitbake %s-native' "\
109 "and try again.\n" % recipe
110 else:
111 msg += "Wic failed to find a recipe to build native %s. Please "\
112 "file a bug against wic.\n" % prog
113 msger.error(msg)
91 if out: 114 if out:
92 msger.debug('"%s" output: %s' % (args[0], out)) 115 msger.debug('"%s" output: %s' % (args[0], out))
93 116