diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2022-10-02 19:56:36 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-10-26 12:28:37 +0100 |
commit | 95cf9e6f2e0e76e1a47f49f33ef9098639b13517 (patch) | |
tree | d8db1400b44ab76cbe55ad14069ea674a7721169 /meta/recipes-core/base-passwd/base-passwd_3.6.1.bb | |
parent | f70cd330e3ae5860bf9619c1343b4fbb7c82f589 (diff) | |
download | poky-95cf9e6f2e0e76e1a47f49f33ef9098639b13517.tar.gz |
base-passwd: Update to 3.6.1
Add a patch to support configuring whether SELinux is enabled or not.
Also add a PACKAGECONFIG for SELinux support and enable it if the
"selinux" distro feature is enabled.
Remove two patches that have been applied upstream.
Changes since 3.5.52:
* 5928e85: German (thanks, Helge Kreutzmann)
* 72cb6a6: Remove constraints unnecessary since buster
* 2f71444: Merge branch 'scrub-obsolete' into 'master'
* 5a578e7: Drop Build-Depends: dpkg
* 44f28e1: Apply wrap-and-sort -at
* 1fe0338: Upgrade to debhelper v13
* d77d38c: Simplify some debhelper overrides slightly
* 2143651: Implement SELinux awareness when updating
/etc/{passwd,group,shadow}
* 0b824ad: improve enforcing handling
* e2f0c03: update-passwd.c: use raw selinux labeles
* 8d45264: selinux_prepare_create_file: return error from
setfscreatecon_raw
* 2f23448: selinux_after_create_file: save errno
* 6953dd1: update-passwd.c: replace goto error handling
* 32fbf59: cleanup
* 3c3eb67: fixup goto
* 585126f: implement feedback
* 02a366b: users-and-groups: Update copyright years
* 7849c61: users-and-groups: Rename ssh group to _ssh
* 06ed6f4: update-passwd.c: set walk to walk->next before removing
* ef6baea: users-and-groups: Document libvirt group
* 68e02a3: Stop creating the gnats user and group on new installations
* cb6e2a9: Restore Build-Depends sorting
* 0e1afc1: Tidy up whitespace
* 6005a06: Merge branch 'selinux' into 'master'
* 24046cb: Bump version to 3.6.0
* c72aa5d: Make it possible to build without debconf support
* 2a6d16e: Make it possible to disable the generation of the
documentation
* 60ece0c: Merge branch 'master' into 'master'
* 63d0f94: Add changelog entry
* cbae4a5: update-passwd: add format attribute
* b71eb04: update-passwd: use strict prototypes
* df48ea8: update-passwd: silence potential null dereference
* cddc9df: update-passwd: print filename on fclose error
* d05f8a3: update-passwd: use correct filename in copy_filemodes
* 11e6466: update-passwd: drop t flag from fopen
* 347aeb6: update-passwd: open temporary file exclusively
* a697493: d/salsa-ci.yml: add standard salsa ci configuration
* 2f622f4: configure: replace obsolete macro
* 43ebe64: Add changelog entry
* e1a186b: frozen the group id for crontab, in order to fix #1012622
* 5ce7773: frozen the group id for crontab, closes: #1012622
* 670c2be: Revert "frozen the group id for crontab, closes: #1012622"
* bc1ad19: Revert "Revert "frozen the group id for crontab, closes:
#1012622""
* 12122c6: Revert "frozen the group id for crontab, in order to fix
#1012622"
* 0145e8a: Revert "frozen the group id for crontab, closes: #1012622"
* c8125ff: releasing package base-passwd version 3.6.0
* dc157c6: passwd.master: Add _apt user
* e50024c: Merge branch 'misc' into 'master'
* 7fb5ad8: debian/postinst: Fix several shellcheck issues
* 8f07b66: releasing package base-passwd version 3.6.1
(From OE-Core rev: 41a9eb6c3afc6de000eaeb0fbe0c691b6c8d1285)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/base-passwd/base-passwd_3.6.1.bb')
-rw-r--r-- | meta/recipes-core/base-passwd/base-passwd_3.6.1.bb | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.6.1.bb b/meta/recipes-core/base-passwd/base-passwd_3.6.1.bb new file mode 100644 index 0000000000..853717176d --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd_3.6.1.bb | |||
@@ -0,0 +1,124 @@ | |||
1 | SUMMARY = "Base system master password/group files" | ||
2 | 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." | ||
3 | HOMEPAGE = "https://launchpad.net/base-passwd" | ||
4 | SECTION = "base" | ||
5 | LICENSE = "GPL-2.0-only" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a" | ||
7 | |||
8 | SRC_URI = "https://launchpad.net/debian/+archive/primary/+files/${BPN}_${PV}.tar.xz \ | ||
9 | file://0001-Add-a-shutdown-group.patch \ | ||
10 | file://0002-Use-bin-sh-instead-of-bin-bash-for-the-root-user.patch \ | ||
11 | file://0003-Remove-for-root-since-we-do-not-have-an-etc-shadow.patch \ | ||
12 | file://0004-Add-an-input-group-for-the-dev-input-devices.patch \ | ||
13 | file://0005-Add-kvm-group.patch \ | ||
14 | file://0006-Make-it-possible-to-configure-whether-to-use-SELinux.patch \ | ||
15 | " | ||
16 | |||
17 | SRC_URI[sha256sum] = "6ff369be59d586ba63c0c5fcb00f75f9953fe49db88bc6c6428f2c92866f79af" | ||
18 | |||
19 | # the package is taken from launchpad; that source is static and goes stale | ||
20 | # so we check the latest upstream from a directory that does get updated | ||
21 | UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/" | ||
22 | |||
23 | S = "${WORKDIR}/work" | ||
24 | |||
25 | PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}" | ||
26 | PACKAGECONFIG[selinux] = "--enable-selinux, --disable-selinux, libselinux" | ||
27 | |||
28 | inherit autotools | ||
29 | |||
30 | EXTRA_OECONF += "--disable-debconf --disable-docs" | ||
31 | |||
32 | NOLOGIN ?= "${base_sbindir}/nologin" | ||
33 | |||
34 | do_install () { | ||
35 | install -d -m 755 ${D}${sbindir} | ||
36 | install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/ | ||
37 | install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8 | ||
38 | install -p -m 644 ${S}/man/update-passwd.8 ${D}${mandir}/man8/ | ||
39 | install -p -m 644 ${S}/man/update-passwd.pl.8 \ | ||
40 | ${D}${mandir}/pl/man8/update-passwd.8 | ||
41 | gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/* | ||
42 | install -d -m 755 ${D}${datadir}/base-passwd | ||
43 | install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/ | ||
44 | sed -i 's#:/root:#:${ROOT_HOME}:#' ${D}${datadir}/base-passwd/passwd.master | ||
45 | sed -i 's#/usr/sbin/nologin#${NOLOGIN}#' ${D}${datadir}/base-passwd/passwd.master | ||
46 | install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/ | ||
47 | |||
48 | install -d -m 755 ${D}${docdir}/${BPN} | ||
49 | install -p -m 644 ${S}/debian/changelog ${D}${docdir}/${BPN}/ | ||
50 | gzip -9 ${D}${docdir}/${BPN}/* | ||
51 | install -p -m 644 ${S}/README ${D}${docdir}/${BPN}/ | ||
52 | install -p -m 644 ${S}/debian/copyright ${D}${docdir}/${BPN}/ | ||
53 | } | ||
54 | |||
55 | basepasswd_sysroot_postinst() { | ||
56 | #!/bin/sh | ||
57 | |||
58 | # Install passwd.master and group.master to sysconfdir | ||
59 | install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir} | ||
60 | for i in passwd group; do | ||
61 | install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/\$i.master \ | ||
62 | ${STAGING_DIR_TARGET}${sysconfdir}/\$i | ||
63 | done | ||
64 | |||
65 | # Run any useradd postinsts | ||
66 | for script in ${STAGING_DIR_TARGET}${bindir}/postinst-useradd-*; do | ||
67 | if [ -f \$script ]; then | ||
68 | \$script | ||
69 | fi | ||
70 | done | ||
71 | } | ||
72 | |||
73 | SYSROOT_DIRS += "${sysconfdir}" | ||
74 | SYSROOT_PREPROCESS_FUNCS += "base_passwd_tweaksysroot" | ||
75 | |||
76 | base_passwd_tweaksysroot () { | ||
77 | mkdir -p ${SYSROOT_DESTDIR}${bindir} | ||
78 | dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN} | ||
79 | echo "${basepasswd_sysroot_postinst}" > $dest | ||
80 | chmod 0755 $dest | ||
81 | } | ||
82 | |||
83 | python populate_packages:prepend() { | ||
84 | # Add in the preinst function for ${PN} | ||
85 | # We have to do this here as prior to this, passwd/group.master | ||
86 | # would be unavailable. We need to create these files at preinst | ||
87 | # time before the files from the package may be available, hence | ||
88 | # storing the data from the files in the preinst directly. | ||
89 | |||
90 | f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r') | ||
91 | passwd = "".join(f.readlines()) | ||
92 | f.close() | ||
93 | f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r') | ||
94 | group = "".join(f.readlines()) | ||
95 | f.close() | ||
96 | |||
97 | preinst = """#!/bin/sh | ||
98 | mkdir -p $D${sysconfdir} | ||
99 | if [ ! -e $D${sysconfdir}/passwd ]; then | ||
100 | \tcat << 'EOF' > $D${sysconfdir}/passwd | ||
101 | """ + passwd + """EOF | ||
102 | fi | ||
103 | if [ ! -e $D${sysconfdir}/group ]; then | ||
104 | \tcat << 'EOF' > $D${sysconfdir}/group | ||
105 | """ + group + """EOF | ||
106 | fi | ||
107 | """ | ||
108 | d.setVar(d.expand('pkg_preinst:${PN}'), preinst) | ||
109 | } | ||
110 | |||
111 | addtask do_package after do_populate_sysroot | ||
112 | |||
113 | ALLOW_EMPTY:${PN} = "1" | ||
114 | |||
115 | PACKAGES =+ "${PN}-update" | ||
116 | FILES:${PN}-update = "${sbindir}/* ${datadir}/${PN}" | ||
117 | |||
118 | pkg_postinst:${PN}-update () { | ||
119 | #!/bin/sh | ||
120 | if [ -n "$D" ]; then | ||
121 | exit 0 | ||
122 | fi | ||
123 | ${sbindir}/update-passwd | ||
124 | } | ||