]> code.ossystems Code Review - openembedded-core.git/commitdiff
useradd-staticids: Fix groupadd
authorDavid Vincent <freesilicon@gmail.com>
Mon, 23 Jan 2017 13:55:40 +0000 (14:55 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Jan 2017 10:41:10 +0000 (10:41 +0000)
When a group name is duplicated between USERADD_PARAM and
GROUPADD_PARAM, this class tries to add it twice which results in
failure of the groupadd command.

Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/useradd-staticids.bbclass

index f7f6057ac37d82d860e56a017bea2755ae33f76b..a309b8873dea404fca23b572995a1ef3c4994e1c 100644 (file)
@@ -165,7 +165,9 @@ def update_useradd_static_config(d):
                 if newgroup and is_pkg:
                     groupadd = d.getVar("GROUPADD_PARAM_%s" % pkg)
                     if groupadd:
-                        d.setVar("GROUPADD_PARAM_%s" % pkg, "%s; %s" % (groupadd, newgroup))
+                        # Only add the group if not already specified
+                        if not uaargs.groupname in groupadd:
+                            d.setVar("GROUPADD_PARAM_%s" % pkg, "%s; %s" % (groupadd, newgroup))
                     else:
                         d.setVar("GROUPADD_PARAM_%s" % pkg, newgroup)