summaryrefslogtreecommitdiffstats
path: root/meta/classes/useradd-staticids.bbclass
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-17 17:14:55 +0100
commit3037e0df9b1a0e1cb5332ab8026245b61515fc33 (patch)
tree45994f0ad3d3b56d71277a661a2457dbd4c4634a /meta/classes/useradd-staticids.bbclass
parentc99750d17e7eaeaa16e5a8510d64e89cef856411 (diff)
downloadpoky-3037e0df9b1a0e1cb5332ab8026245b61515fc33.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) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/useradd-staticids.bbclass')
-rw-r--r--meta/classes/useradd-staticids.bbclass5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/useradd-staticids.bbclass b/meta/classes/useradd-staticids.bbclass
index 90835cfac2..b6e498c0ce 100644
--- a/meta/classes/useradd-staticids.bbclass
+++ b/meta/classes/useradd-staticids.bbclass
@@ -51,9 +51,12 @@ def update_useradd_static_config(d):
51 return id_table 51 return id_table
52 52
53 def handle_missing_id(id, type, pkg): 53 def handle_missing_id(id, type, pkg):
54 if d.getVar('USERADD_ERROR_DYNAMIC', True) == '1': 54 # For backwards compatibility we accept "1" in addition to "error"
55 if d.getVar('USERADD_ERROR_DYNAMIC', True) == 'error' or d.getVar('USERADD_ERROR_DYNAMIC', True) == '1':
55 #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)) 56 #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))
56 raise bb.build.FuncFailed("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id)) 57 raise bb.build.FuncFailed("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
58 elif d.getVar('USERADD_ERROR_DYNAMIC', True) == 'warn':
59 bb.warn("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
57 60
58 # We parse and rewrite the useradd components 61 # We parse and rewrite the useradd components
59 def rewrite_useradd(params): 62 def rewrite_useradd(params):