summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/base-passwd/base-passwd_3.5.29.bb')
-rw-r--r--meta/recipes-core/base-passwd/base-passwd_3.5.29.bb97
1 files changed, 97 insertions, 0 deletions
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
new file mode 100644
index 0000000..59bd413
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -0,0 +1,97 @@
1SUMMARY = "Base system master password/group files"
2DESCRIPTION = "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."
3SECTION = "base"
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
6
7SRC_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \
8 file://add_shutdown.patch \
9 file://nobash.patch \
10 file://noshadow.patch \
11 file://input.patch \
12 file://disable-docs.patch \
13 "
14
15SRC_URI[md5sum] = "6beccac48083fe8ae5048acd062e5421"
16SRC_URI[sha256sum] = "f0b66388b2c8e49c15692439d2bee63bcdd4bbbf7a782c7f64accc55986b6a36"
17
18inherit autotools
19
20SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst"
21
22do_install () {
23 install -d -m 755 ${D}${sbindir}
24 install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/
25 install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8
26 install -p -m 644 ${S}/man/update-passwd.8 ${D}${mandir}/man8/
27 install -p -m 644 ${S}/man/update-passwd.pl.8 \
28 ${D}${mandir}/pl/man8/update-passwd.8
29 gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/*
30 install -d -m 755 ${D}${datadir}/base-passwd
31 install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/
32 sed -i 's#:/root:#:${ROOT_HOME}:#' ${D}${datadir}/base-passwd/passwd.master
33 install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/
34
35 install -d -m 755 ${D}${docdir}/${BPN}
36 install -p -m 644 ${S}/debian/changelog ${D}${docdir}/${BPN}/
37 gzip -9 ${D}${docdir}/${BPN}/*
38 install -p -m 644 ${S}/README ${D}${docdir}/${BPN}/
39 install -p -m 644 ${S}/debian/copyright ${D}${docdir}/${BPN}/
40}
41
42base_passwd_sstate_postinst() {
43 if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
44 then
45 # Staging does not copy ${sysconfdir} files into the
46 # target sysroot, so we need to do so manually. We
47 # put these files in the target sysroot so they can
48 # be used by recipes which use custom user/group
49 # permissions.
50 install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
51 install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/passwd.master ${STAGING_DIR_TARGET}${sysconfdir}/passwd
52 install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/group.master ${STAGING_DIR_TARGET}${sysconfdir}/group
53 fi
54}
55
56python populate_packages_prepend() {
57 # Add in the preinst function for ${PN}
58 # We have to do this here as prior to this, passwd/group.master
59 # would be unavailable. We need to create these files at preinst
60 # time before the files from the package may be available, hence
61 # storing the data from the files in the preinst directly.
62
63 f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r')
64 passwd = "".join(f.readlines())
65 f.close()
66 f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r')
67 group = "".join(f.readlines())
68 f.close()
69
70 preinst = """#!/bin/sh
71mkdir -p $D${sysconfdir}
72if [ ! -e $D${sysconfdir}/passwd ]; then
73\tcat << EOF > $D${sysconfdir}/passwd
74""" + passwd + """EOF
75fi
76if [ ! -e $D${sysconfdir}/group ]; then
77\tcat << EOF > $D${sysconfdir}/group
78""" + group + """EOF
79fi
80"""
81 d.setVar('pkg_preinst_${PN}', preinst)
82}
83
84addtask do_package after do_populate_sysroot
85
86ALLOW_EMPTY_${PN} = "1"
87
88PACKAGES =+ "${PN}-update"
89FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}"
90
91pkg_postinst_${PN}-update () {
92#!/bin/sh
93if [ -n "$D" ]; then
94 exit 0
95fi
96${sbindir}/update-passwd
97}