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