summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2016-06-17 16:59:02 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-29 19:36:02 +0100
commitba29029581eaa4534d85c090d6924d24e4386dbc (patch)
tree0b2ab7b5d31f48d21e0732fd79bfbdf3b7ee3e80 /meta
parenta4d74c100d8dfbbc8d682e223c91573a2acca8e3 (diff)
downloadpoky-ba29029581eaa4534d85c090d6924d24e4386dbc.tar.gz
useradd-staticids.bbclass: Allow missing UIDs/GIDs to generate warnings
Previously when USERADD_ERROR_DYNAMIC was set to "1", an exception was raised if no numeric UID/GID could be determined for a user/group. Now it is possible to set it to either "error", which results in the old behavior, or "warn" in which case a warning is issued instead. For backwards compatibility reasons, it is still possible to set USERADD_ERROR_DYNAMIC to "1" and get an exception in case of failure. (From OE-Core rev: 58c82f79efee8e68fa63b96a32f54660afb15769) (From OE-Core rev: 5a37852e4ab3a7438cab372b288663535ecdfee1) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3037e0df9b1a0e1cb5332ab8026245b61515fc33) Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/useradd-staticids.bbclass5
-rw-r--r--meta/conf/documentation.conf2
2 files changed, 5 insertions, 2 deletions
diff --git a/meta/classes/useradd-staticids.bbclass b/meta/classes/useradd-staticids.bbclass
index 50a7481a60..92b290c186 100644
--- a/meta/classes/useradd-staticids.bbclass
+++ b/meta/classes/useradd-staticids.bbclass
@@ -47,9 +47,12 @@ def update_useradd_static_config(d):
47 return id_table 47 return id_table
48 48
49 def handle_missing_id(id, type, pkg): 49 def handle_missing_id(id, type, pkg):
50 if d.getVar('USERADD_ERROR_DYNAMIC', True) == '1': 50 # For backwards compatibility we accept "1" in addition to "error"
51 if d.getVar('USERADD_ERROR_DYNAMIC', True) == 'error' or d.getVar('USERADD_ERROR_DYNAMIC', True) == '1':
51 #bb.error("Skipping recipe %s, package %s which adds %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id)) 52 #bb.error("Skipping recipe %s, package %s which adds %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
52 raise bb.build.FuncFailed("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id)) 53 raise bb.build.FuncFailed("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
54 elif d.getVar('USERADD_ERROR_DYNAMIC', True) == 'warn':
55 bb.warn("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
53 56
54 # We parse and rewrite the useradd components 57 # We parse and rewrite the useradd components
55 def rewrite_useradd(params): 58 def rewrite_useradd(params):
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
index b288536466..fc66b3b784 100644
--- a/meta/conf/documentation.conf
+++ b/meta/conf/documentation.conf
@@ -451,7 +451,7 @@ UBOOT_SUFFIX[doc] = "Points to the generated U-Boot extension."
451UBOOT_TARGET[doc] = "Specifies the target used for building U-Boot." 451UBOOT_TARGET[doc] = "Specifies the target used for building U-Boot."
452USE_DEVFS[doc] = "When building images, specifies to populate or not /dev. This variable defaults to '1' (leave directory empty, surely because devtmpfs do the job). Set it to '0' to use makedevs (or consider using a custom file with IMAGE_DEVICE_TABLES)." 452USE_DEVFS[doc] = "When building images, specifies to populate or not /dev. This variable defaults to '1' (leave directory empty, surely because devtmpfs do the job). Set it to '0' to use makedevs (or consider using a custom file with IMAGE_DEVICE_TABLES)."
453USER_CLASSES[doc] = "List of additional classes to use when building images that enable extra features." 453USER_CLASSES[doc] = "List of additional classes to use when building images that enable extra features."
454USERADD_ERROR_DYNAMIC[doc] = "Forces the OpenEmbedded build system to produce an error if the user identification (uid) and group identification (gid) values are not defined in any of the files listed in USERADD_UID_TABLES and USERADD_GID_TABLES." 454USERADD_ERROR_DYNAMIC[doc] = "If set to 'error', forces the OpenEmbedded build system to produce an error if the user identification (uid) and group identification (gid) values are not defined in any of the files listed in USERADD_UID_TABLES and USERADD_GID_TABLES. If set to 'warn', a warning will be issued instead."
455USERADD_GID_TABLES[doc] = "Specifies a password file to use for obtaining static group identification (gid) values when the OpenEmbedded build system adds a group to the system during package installation." 455USERADD_GID_TABLES[doc] = "Specifies a password file to use for obtaining static group identification (gid) values when the OpenEmbedded build system adds a group to the system during package installation."
456USERADD_PACKAGES[doc] = "When a recipe inherits the useradd class, this variable specifies the individual packages within the recipe that require users and/or groups to be added." 456USERADD_PACKAGES[doc] = "When a recipe inherits the useradd class, this variable specifies the individual packages within the recipe that require users and/or groups to be added."
457USERADD_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should be passed to the useradd command if you wish to add a user to the system when the package is installed." 457USERADD_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should be passed to the useradd command if you wish to add a user to the system when the package is installed."