diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2014-02-06 17:37:23 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-08 21:02:25 +0000 |
commit | 99fd0f14fd774c9194f62795e6023880e3aa5612 (patch) | |
tree | 0e2ced8e5d1632482a7ab3d43d1e382c49524d1d /meta | |
parent | c38f943c7fbb1fc077c875099dce8f73f41043b9 (diff) | |
download | openembedded-core-99fd0f14fd774c9194f62795e6023880e3aa5612.tar.gz openembedded-core-99fd0f14fd774c9194f62795e6023880e3aa5612.tar.bz2 openembedded-core-99fd0f14fd774c9194f62795e6023880e3aa5612.zip |
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.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/useradd.bbclass | 21 |
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 # Installing into a sysroot SYSROOT="$D" OPT="--root $D" +fi - # Add groups and users defined for all recipe packages - GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}" - USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}" - GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}" -else +# If we're not doing a special SSTATE/SYSROOT install +# then set the values, otherwise use the environment +if test "x$UA_SYSROOT" = "x"; then # Installing onto a target # Add groups and users defined only for this package GROUPADD_PARAM="${GROUPADD_PARAM}" @@ -97,6 +96,15 @@ useradd_sysroot () { # Explicitly set $D since it isn't set to anything # before do_install D=${STAGING_DIR_TARGET} + + # Add groups and users defined for all recipe packages + GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}" + USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}" + GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}" + + # Tell the system to use the environment vars + UA_SYSROOT=1 + useradd_preinst } @@ -137,7 +145,8 @@ def update_useradd_after_parse(d): bb.fatal("%s inherits useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or GROUPMEMS_PARAM for package %s" % (d.getVar('FILE'), pkg)) python __anonymous() { - update_useradd_after_parse(d) + if not bb.data.inherits_class('nativesdk', d): + update_useradd_after_parse(d) } # Return a single [GROUP|USER]ADD_PARAM formatted string which includes the |