[oe-commits] Richard Purdie : useradd.bbclass: Ensure pseudo can load in the pseudo unloaded case

git at git.openembedded.org git at git.openembedded.org
Wed May 30 16:59:29 UTC 2012


Module: openembedded-core.git
Branch: 2011-1
Commit: 6f25ede827ee469464ca2db72bf05c75fa7c11f3
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=6f25ede827ee469464ca2db72bf05c75fa7c11f3

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Thu Jan 26 12:51:04 2012 +0000

useradd.bbclass: Ensure pseudo can load in the pseudo unloaded case

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.

(From OE-Core rev: 76345cd61c9523ce6755ef8e923dec37800b7a98)

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Signed-off-by: Joshua Lock <josh at linux.intel.com>

---

 meta/classes/useradd.bbclass |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 27647cb..195c8cc 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -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





More information about the Openembedded-commits mailing list