summaryrefslogtreecommitdiffstats
path: root/meta/classes/useradd.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/useradd.bbclass')
-rw-r--r--meta/classes/useradd.bbclass22
1 files changed, 11 insertions, 11 deletions
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 3cff08e00d..fd59969986 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -168,13 +168,13 @@ USERADDSETSCENEDEPS = ""
168 168
169# Recipe parse-time sanity checks 169# Recipe parse-time sanity checks
170def update_useradd_after_parse(d): 170def update_useradd_after_parse(d):
171 useradd_packages = d.getVar('USERADD_PACKAGES', True) 171 useradd_packages = d.getVar('USERADD_PACKAGES')
172 172
173 if not useradd_packages: 173 if not useradd_packages:
174 bb.fatal("%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE', False)) 174 bb.fatal("%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE', False))
175 175
176 for pkg in useradd_packages.split(): 176 for pkg in useradd_packages.split():
177 if not d.getVar('USERADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPMEMS_PARAM_%s' % pkg, True): 177 if not d.getVar('USERADD_PARAM_%s' % pkg) and not d.getVar('GROUPADD_PARAM_%s' % pkg) and not d.getVar('GROUPMEMS_PARAM_%s' % pkg):
178 bb.fatal("%s inherits useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or GROUPMEMS_PARAM for package %s" % (d.getVar('FILE', False), pkg)) 178 bb.fatal("%s inherits useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or GROUPMEMS_PARAM for package %s" % (d.getVar('FILE', False), pkg))
179 179
180python __anonymous() { 180python __anonymous() {
@@ -191,9 +191,9 @@ def get_all_cmd_params(d, cmd_type):
191 param_type = cmd_type.upper() + "_PARAM_%s" 191 param_type = cmd_type.upper() + "_PARAM_%s"
192 params = [] 192 params = []
193 193
194 useradd_packages = d.getVar('USERADD_PACKAGES', True) or "" 194 useradd_packages = d.getVar('USERADD_PACKAGES') or ""
195 for pkg in useradd_packages.split(): 195 for pkg in useradd_packages.split():
196 param = d.getVar(param_type % pkg, True) 196 param = d.getVar(param_type % pkg)
197 if param: 197 if param:
198 params.append(param.rstrip(" ;")) 198 params.append(param.rstrip(" ;"))
199 199
@@ -209,20 +209,20 @@ fakeroot python populate_packages_prepend () {
209 required to execute on the target. Not doing so may cause 209 required to execute on the target. Not doing so may cause
210 useradd preinst to be invoked twice, causing unwanted warnings. 210 useradd preinst to be invoked twice, causing unwanted warnings.
211 """ 211 """
212 preinst = d.getVar('pkg_preinst_%s' % pkg, True) or d.getVar('pkg_preinst', True) 212 preinst = d.getVar('pkg_preinst_%s' % pkg) or d.getVar('pkg_preinst')
213 if not preinst: 213 if not preinst:
214 preinst = '#!/bin/sh\n' 214 preinst = '#!/bin/sh\n'
215 preinst += 'bbnote () {\n\techo "NOTE: $*"\n}\n' 215 preinst += 'bbnote () {\n\techo "NOTE: $*"\n}\n'
216 preinst += 'bbwarn () {\n\techo "WARNING: $*"\n}\n' 216 preinst += 'bbwarn () {\n\techo "WARNING: $*"\n}\n'
217 preinst += 'bbfatal () {\n\techo "ERROR: $*"\n\texit 1\n}\n' 217 preinst += 'bbfatal () {\n\techo "ERROR: $*"\n\texit 1\n}\n'
218 preinst += 'perform_groupadd () {\n%s}\n' % d.getVar('perform_groupadd', True) 218 preinst += 'perform_groupadd () {\n%s}\n' % d.getVar('perform_groupadd')
219 preinst += 'perform_useradd () {\n%s}\n' % d.getVar('perform_useradd', True) 219 preinst += 'perform_useradd () {\n%s}\n' % d.getVar('perform_useradd')
220 preinst += 'perform_groupmems () {\n%s}\n' % d.getVar('perform_groupmems', True) 220 preinst += 'perform_groupmems () {\n%s}\n' % d.getVar('perform_groupmems')
221 preinst += d.getVar('useradd_preinst', True) 221 preinst += d.getVar('useradd_preinst')
222 d.setVar('pkg_preinst_%s' % pkg, preinst) 222 d.setVar('pkg_preinst_%s' % pkg, preinst)
223 223
224 # RDEPENDS setup 224 # RDEPENDS setup
225 rdepends = d.getVar("RDEPENDS_%s" % pkg, True) or "" 225 rdepends = d.getVar("RDEPENDS_%s" % pkg) or ""
226 rdepends += ' ' + d.getVar('MLPREFIX', False) + 'base-passwd' 226 rdepends += ' ' + d.getVar('MLPREFIX', False) + 'base-passwd'
227 rdepends += ' ' + d.getVar('MLPREFIX', False) + 'shadow' 227 rdepends += ' ' + d.getVar('MLPREFIX', False) + 'shadow'
228 # base-files is where the default /etc/skel is packaged 228 # base-files is where the default /etc/skel is packaged
@@ -233,7 +233,7 @@ fakeroot python populate_packages_prepend () {
233 # to packages specified by USERADD_PACKAGES 233 # to packages specified by USERADD_PACKAGES
234 if not bb.data.inherits_class('nativesdk', d) \ 234 if not bb.data.inherits_class('nativesdk', d) \
235 and not bb.data.inherits_class('native', d): 235 and not bb.data.inherits_class('native', d):
236 useradd_packages = d.getVar('USERADD_PACKAGES', True) or "" 236 useradd_packages = d.getVar('USERADD_PACKAGES') or ""
237 for pkg in useradd_packages.split(): 237 for pkg in useradd_packages.split():
238 update_useradd_package(pkg) 238 update_useradd_package(pkg)
239} 239}