]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: rebuild wic-tools if its sysroot doesn't exist
authorEd Bartosh <ed.bartosh@linux.intel.com>
Thu, 19 Jan 2017 14:01:34 +0000 (16:01 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 23 Jan 2017 12:03:52 +0000 (12:03 +0000)
Rebuild wic-tools if its native sysroot doesn't exist to ensure
that all required tools are available.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
scripts/wic

index f09dbc2e00269910918b16ed1b0ce51d3eb31c1d..8918cb485319fac8f694d3e36fdeef715c929c99 100755 (executable)
@@ -175,11 +175,23 @@ def wic_create_subcommand(args, usage_str):
 
         rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", options.image_name)
         kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE", options.image_name)
-        native_sysroot = os.path.join(get_bitbake_var("RECIPE_SYSROOT_NATIVE", "wic-tools"))
+        native_sysroot = get_bitbake_var("RECIPE_SYSROOT_NATIVE",
+                                         "wic-tools", cache=False)
     else:
         if options.build_rootfs:
             print("Image name is not specified, exiting. (Use -e/--image-name to specify it)\n")
             sys.exit(1)
+        native_sysroot = options.native_sysroot
+
+    if not native_sysroot or not os.path.isdir(native_sysroot):
+        print("Building wic-tools...\n")
+        if bitbake_main(BitBakeConfigParameters("bitbake wic-tools".split()),
+                        cookerdata.CookerConfiguration()):
+            sys.exit(1)
+        native_sysroot = get_bitbake_var("RECIPE_SYSROOT_NATIVE", "wic-tools")
+        if not native_sysroot:
+            print("Unable to find the location of the native tools sysroot to use\n")
+            sys.exit(1)
 
     wks_file = args[0]