]> code.ossystems Code Review - openembedded-core.git/commitdiff
image.bbclass: add do_rootfs vardeps for {COMPRESS, IMAGE}_CMD_*
authorChristopher Larson <chris_larson@mentor.com>
Tue, 15 Sep 2015 00:10:37 +0000 (17:10 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 16 Sep 2015 20:38:22 +0000 (21:38 +0100)
We want do_rootfs to rerun if the fstype or compression commands or
dependencies change for any of our configured fstypes (IMAGE_FSTYPES).
IMAGE_TYPEDEP isn't explicitly handled, as it's traversed already, so the end
result will change if it does, and we only really care about the results, not
how we got there. This uses oe.image.Image()._get_image_types() to get the
info about the image and compression types in use.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/image.bbclass

index fc7d64d7e56e00acdb7459d28f9ea5048d62d7cf..86a98bb11dc58339e234d7832581f2fb19994f43 100644 (file)
@@ -106,14 +106,30 @@ python () {
             d.setVarFlag(var, 'func', '1')
 }
 
+def fstype_variables(d):
+    import oe.image
+
+    image = oe.image.Image(d)
+    alltypes, fstype_groups, cimages = image._get_image_types()
+    fstype_vars = set()
+    for fstype_group in fstype_groups:
+        for fstype in fstype_group:
+            fstype_vars.add('IMAGE_CMD_' + fstype)
+            if fstype in cimages:
+                for ctype in cimages[fstype]:
+                    fstype_vars.add('COMPRESS_CMD_' + ctype)
+
+    return sorted(fstype_vars)
+
 def rootfs_variables(d):
     from oe.rootfs import variable_depends
-    variables = ['IMAGE_DEVICE_TABLES','BUILD_IMAGES_FROM_FEEDS','IMAGE_TYPEDEP_','IMAGE_TYPES_MASKED','IMAGE_ROOTFS_ALIGNMENT','IMAGE_OVERHEAD_FACTOR','IMAGE_ROOTFS_SIZE','IMAGE_ROOTFS_EXTRA_SPACE',
+    variables = ['IMAGE_DEVICE_TABLES','BUILD_IMAGES_FROM_FEEDS','IMAGE_TYPES_MASKED','IMAGE_ROOTFS_ALIGNMENT','IMAGE_OVERHEAD_FACTOR','IMAGE_ROOTFS_SIZE','IMAGE_ROOTFS_EXTRA_SPACE',
                  'IMAGE_ROOTFS_MAXSIZE','IMAGE_NAME','IMAGE_LINK_NAME','IMAGE_MANIFEST','DEPLOY_DIR_IMAGE','RM_OLD_IMAGE','IMAGE_FSTYPES','IMAGE_INSTALL_COMPLEMENTARY','IMAGE_LINGUAS','SDK_OS',
                  'SDK_OUTPUT','SDKPATHNATIVE','SDKTARGETSYSROOT','SDK_DIR','SDK_VENDOR','SDKIMAGE_INSTALL_COMPLEMENTARY','SDK_PACKAGE_ARCHS','SDK_OUTPUT','SDKTARGETSYSROOT','MULTILIBRE_ALLOW_REP',
                  'MULTILIB_TEMP_ROOTFS','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS','PACKAGE_ARCHS',
                  'PACKAGE_CLASSES','TARGET_VENDOR','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','OVERRIDES','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI','INTERCEPT_DIR','USE_DEVFS',
                  'COMPRESSIONTYPES', 'IMAGE_GEN_DEBUGFS']
+    variables.extend(fstype_variables(d))
     variables.extend(command_variables(d))
     variables.extend(variable_depends(d))
     return " ".join(variables)