diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-08-03 16:51:48 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-09 00:12:47 -0700 |
commit | 1274379c91ee8e2fb9fbb34a6445cd5767eb4a35 (patch) | |
tree | b85f405f9cddade48e47907e7ace3133c175b797 /scripts/lib | |
parent | 68d391eaf4fe9fc37e3278255d5da170f98b8763 (diff) | |
download | openembedded-core-1274379c91ee8e2fb9fbb34a6445cd5767eb4a35.tar.gz openembedded-core-1274379c91ee8e2fb9fbb34a6445cd5767eb4a35.tar.bz2 openembedded-core-1274379c91ee8e2fb9fbb34a6445cd5767eb4a35.zip |
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]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/wic/utils/oe/misc.py | 29 |
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 from wic import msger from wic.utils import runner +# executable -> recipe pairs for exec_native_cmd +NATIVE_RECIPES = {"mcopy": "mtools", + "mkdosfs": "dosfstools", + "mkfs.btrfs": "btrfs-tools", + "mkfs.ext2": "e2fsprogs", + "mkfs.ext3": "e2fsprogs", + "mkfs.ext4": "e2fsprogs", + "mkfs.vfat": "dosfstools", + "mksquashfs": "squashfs-tools", + "mkswqp": "util-linux", + "parted": "parted", + "sgdisk": "gptfdisk", + "syslinux": "syslinux" + } + def __exec_cmd(cmd_and_args, as_shell=False, catch=3): """ Execute command, catching stderr, stdout @@ -85,9 +100,17 @@ def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): rc, out = __exec_cmd(native_cmd_and_args, True, catch) if rc == 127: # shell command-not-found - msger.error("A native program %s required to build the image " - "was not found (see details above). Please make sure " - "it's installed and try again." % args[0]) + prog = args[0] + msg = "A native program %s required to build the image "\ + "was not found (see details above).\n\n" % prog + recipe = NATIVE_RECIPES.get(prog) + if recipe: + msg += "Please bake it with 'bitbake %s-native' "\ + "and try again.\n" % recipe + else: + msg += "Wic failed to find a recipe to build native %s. Please "\ + "file a bug against wic.\n" % prog + msger.error(msg) if out: msger.debug('"%s" output: %s' % (args[0], out)) |