aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/base-passwd
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2011-10-20 21:20:43 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-10-24 17:27:15 +0100
commitb0dae14eee78e94c7e0577b146a3897a8cb382ad (patch)
tree1d635b532dec4b110c4cb49a76d11917fff223ce /meta/recipes-core/base-passwd
parent5ea680a7f441f468f95a14d5cec1d2a9754fde2f (diff)
downloadopenembedded-core-contrib-b0dae14eee78e94c7e0577b146a3897a8cb382ad.tar.gz
base-passwd: move initial criation of group and passwd to preinst
To allow use and manipulation of users and groups at rootfs building time, the '/etc/passwd' and '/etc/group' needs to be available as soon as possible. (From OE-Core rev: 0395eba96d6f37f323f5b76564809a44d7ceb103) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/base-passwd')
-rw-r--r--meta/recipes-core/base-passwd/base-passwd_3.5.22.bb19
1 files changed, 18 insertions, 1 deletions
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
index 137512dc3c..aa90a6d925 100644
--- a/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
@@ -1,7 +1,7 @@
SUMMARY = "Base system master password/group files."
DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group). The update-passwd tool is also provided to keep the system databases synchronized with these master files."
SECTION = "base"
-PR = "r3"
+PR = "r4"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
@@ -37,6 +37,23 @@ do_install () {
install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/
}
+pkg_preinst_${PN} () {
+ set -e
+
+ # Used for rootfs generation. On in-target install this will be run
+ # before the unpack so the files won't be available
+
+ if [ ! -e $D${sysconfdir}/passwd ] && [ -e $D${datadir}/base-passwd/passwd.master ]; then
+ cp $D${datadir}/base-passwd/passwd.master $D${sysconfdir}/passwd
+ fi
+
+ if [ ! -e $D${sysconfdir}/group ] && [ -e $D${datadir}/base-passwd/group.master ]; then
+ cp $D${datadir}/base-passwd/group.master $D${sysconfdir}/group
+ fi
+
+ exit 0
+}
+
pkg_postinst_${PN} () {
set -e