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.bb102
1 files changed, 102 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 0000000000..ec8f2afb22
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -0,0 +1,102 @@
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 passwd.master and group.master to sysconfdir and mv
51 # them to make sure they are atomically install.
52 install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
53 for i in passwd group; do
54 install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/$i.master \
55 ${STAGING_DIR_TARGET}${sysconfdir}/
56 mv ${STAGING_DIR_TARGET}${sysconfdir}/$i.master ${STAGING_DIR_TARGET}${sysconfdir}/$i
57 done
58 fi
59}
60
61python populate_packages_prepend() {
62 # Add in the preinst function for ${PN}
63 # We have to do this here as prior to this, passwd/group.master
64 # would be unavailable. We need to create these files at preinst
65 # time before the files from the package may be available, hence
66 # storing the data from the files in the preinst directly.
67
68 f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r')
69 passwd = "".join(f.readlines())
70 f.close()
71 f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r')
72 group = "".join(f.readlines())
73 f.close()
74
75 preinst = """#!/bin/sh
76mkdir -p $D${sysconfdir}
77if [ ! -e $D${sysconfdir}/passwd ]; then
78\tcat << EOF > $D${sysconfdir}/passwd
79""" + passwd + """EOF
80fi
81if [ ! -e $D${sysconfdir}/group ]; then
82\tcat << EOF > $D${sysconfdir}/group
83""" + group + """EOF
84fi
85"""
86 d.setVar('pkg_preinst_${PN}', preinst)
87}
88
89addtask do_package after do_populate_sysroot
90
91ALLOW_EMPTY_${PN} = "1"
92
93PACKAGES =+ "${PN}-update"
94FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}"
95
96pkg_postinst_${PN}-update () {
97#!/bin/sh
98if [ -n "$D" ]; then
99 exit 0
100fi
101${sbindir}/update-passwd
102}