]> code.ossystems Code Review - openembedded-core.git/commitdiff
useradd.bbclass: Ensure pseudo can load in the pseudo unloaded case
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Jan 2012 12:51:04 +0000 (12:51 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 27 Jan 2012 09:38:45 +0000 (09:38 +0000)
In the do_populate_sysroot_setscene case, pseudo has been unloaded and we need
to reload it. This code change ensures all the pseudo options are specified
so pseudo loads correctly.

It also improves some of the comments so all the different contexts are listed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/useradd.bbclass

index 2cffbfa12cb4f2cfdb24243846f73808b4d3b5b1..6ee575e4cab230f10202f342637e85bb77d37da2 100644 (file)
@@ -6,9 +6,13 @@ USERADDDEPENDS = " base-passwd shadow-native shadow-sysroot shadow"
 USERADDDEPENDS_virtclass-native = ""
 USERADDDEPENDS_virtclass-nativesdk = ""
 
-# This preinstall function will be run in two contexts: once for the
-# native sysroot (as invoked by the useradd_sysroot() wrapper), and
-# also as the preinst script in the target package.
+# This preinstall function can be run in four different contexts:
+#
+# a) Before do_install
+# b) At do_populate_sysroot_setscene when installing from sstate packages
+# c) As the preinst script in the target package at do_rootfs time
+# d) As the preinst script in the target package on device as a package upgrade
+#
 useradd_preinst () {
 OPT=""
 SYSROOT=""
@@ -80,8 +84,10 @@ fi
 }
 
 useradd_sysroot () {
-       export PSEUDO="${STAGING_DIR_NATIVE}${bindir}/pseudo"
-       export PSEUDO_LOCALSTATEDIR="${STAGING_DIR_TARGET}${localstatedir}/pseudo"
+       # Pseudo may (do_install) or may not (do_populate_sysroot_setscene) be running 
+       # at this point so we're explicit about the environment so pseudo can load if 
+       # not already present.
+       export PSEUDO="${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${STAGING_DIR_TARGET}${localstatedir}/pseudo ${STAGING_DIR_NATIVE}${bindir}/pseudo"
 
        # Explicitly set $D since it isn't set to anything
        # before do_install