]> code.ossystems Code Review - openembedded-core.git/commitdiff
useradd-staticids.bbclass: trigger reparsing when table files change
authorPatrick Ohly <patrick.ohly@intel.com>
Thu, 28 Jul 2016 09:43:02 +0000 (11:43 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 1 Aug 2016 10:46:37 +0000 (11:46 +0100)
This addresses (among others) the following problem:
- USERADD_ERROR_DYNAMIC=error causes a recipe to get skipped
  because a static ID entry is missing
- the entry gets added to the file
- using the recipe still fails with the same error as before
  because the recipe gets loaded from the cache instead
  of re-parsing it with the new table content

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/useradd-staticids.bbclass

index 149245b292a932b47c4dacce4c131753a4afb3a9..46d4a4b3da3c4a2c795f11b1a605b7a7877ff038 100644 (file)
@@ -285,6 +285,19 @@ def update_useradd_static_config(d):
 
         return ";".join(newparams).strip()
 
+    # The parsing of the current recipe depends on the content of
+    # the files listed in USERADD_UID/GID_TABLES. We need to tell bitbake
+    # about that explicitly to trigger re-parsing and thus re-execution of
+    # this code when the files change.
+    bbpath = d.getVar('BBPATH', True)
+    for varname, default in (('USERADD_UID_TABLES', 'files/passwd'),
+                             ('USERADD_GID_TABLES', 'files/group')):
+        tables = d.getVar(varname, True)
+        if not tables:
+            tables = default
+        for conf_file in tables.split():
+            bb.parse.mark_dependency(d, bb.utils.which(bbpath, conf_file))
+
     # Load and process the users and groups, rewriting the adduser/addgroup params
     useradd_packages = d.getVar('USERADD_PACKAGES', True)