summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
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