summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2014-02-06 17:37:23 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-09 09:40:01 +0000
commit72288dd499d236071a5216c9a9e3b6bd66c3888a (patch)
treef70d1d9ac0ebb1d4d8f91e03d83afbbbbd752dc4 /meta/classes
parentac656fb21beb7de9e11f5268f67be3434a3aec74 (diff)
downloadpoky-72288dd499d236071a5216c9a9e3b6bd66c3888a.tar.gz
useradd.bbclass: Fix build time install issues
When the system attempts to populate the sysroot's passwd/group files, it does so in a single block. However, with the way it was previously implemented, the system would always run through the code necessary to populate the sysroot, even in the case of target packages. This had the side effect that a cross-installed filesystem may not match a target installed filesystem. The code was slightly reorganized to ensure that the cross/target installed pre-install script behavior is the same. It also moves the block that configures the sysroot parameters to the sysroot specific section of the code. Also some minor validation was occuring even on nativesdk packages. Nativesdk packages should be skipped when processing useradd ops. (From OE-Core rev: 99fd0f14fd774c9194f62795e6023880e3aa5612) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/useradd.bbclass21
1 files changed, 15 insertions, 6 deletions
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index a2ad648938..ad6f61a3d4 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -24,12 +24,11 @@ if test "x$D" != "x"; then
24 # Installing into a sysroot 24 # Installing into a sysroot
25 SYSROOT="$D" 25 SYSROOT="$D"
26 OPT="--root $D" 26 OPT="--root $D"
27fi
27 28
28 # Add groups and users defined for all recipe packages 29# If we're not doing a special SSTATE/SYSROOT install
29 GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}" 30# then set the values, otherwise use the environment
30 USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}" 31if test "x$UA_SYSROOT" = "x"; then
31 GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}"
32else
33 # Installing onto a target 32 # Installing onto a target
34 # Add groups and users defined only for this package 33 # Add groups and users defined only for this package
35 GROUPADD_PARAM="${GROUPADD_PARAM}" 34 GROUPADD_PARAM="${GROUPADD_PARAM}"
@@ -97,6 +96,15 @@ useradd_sysroot () {
97 # Explicitly set $D since it isn't set to anything 96 # Explicitly set $D since it isn't set to anything
98 # before do_install 97 # before do_install
99 D=${STAGING_DIR_TARGET} 98 D=${STAGING_DIR_TARGET}
99
100 # Add groups and users defined for all recipe packages
101 GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}"
102 USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}"
103 GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}"
104
105 # Tell the system to use the environment vars
106 UA_SYSROOT=1
107
100 useradd_preinst 108 useradd_preinst
101} 109}
102 110
@@ -137,7 +145,8 @@ def update_useradd_after_parse(d):
137 bb.fatal("%s inherits useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or GROUPMEMS_PARAM for package %s" % (d.getVar('FILE'), pkg)) 145 bb.fatal("%s inherits useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or GROUPMEMS_PARAM for package %s" % (d.getVar('FILE'), pkg))
138 146
139python __anonymous() { 147python __anonymous() {
140 update_useradd_after_parse(d) 148 if not bb.data.inherits_class('nativesdk', d):
149 update_useradd_after_parse(d)
141} 150}
142 151
143# Return a single [GROUP|USER]ADD_PARAM formatted string which includes the 152# Return a single [GROUP|USER]ADD_PARAM formatted string which includes the