libpam: split /etc/environment into pam-plugin-env package
PATCH 1/1 libpam: split /etc/environment into pam-plugin-env package
Since systemd-v255, pam-plugin-umask is pulled in by by the logind package config for systemd. This causes /etc/environment to by installed as part of libpam-runtime. In our case, this broke do_rootfs for our image, because /etc/environment is already provided another (custom) recipe.
Fix this by making the /etc/environment file part of the pam-plugin-env package, which isn't automatically pulled in by systemd-logind. It also happens to be the where it should be, as the file is installed as by the pam_env plugin.
--- meta/recipes-extended/pam/libpam_1.5.3.bb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
meta/recipes-extended/pam/libpam_1.5.3.bb +6 -1
@@ -51,9 +51,14 @@ PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db," PACKAGES += "${PN}-runtime ${PN}-xtests" FILES:${PN} = "${base_libdir}/lib*${SOLIBS}" FILES:${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}" -FILES:${PN}-runtime = "${sysconfdir} ${sbindir} ${systemd_system_unitdir}" +FILES:${PN}-runtime = "${sysconfdir}/pam.d ${sysconfdir}/security ${sysconfdir}/tmpfiles.d ${sbindir} ${systemd_system_unitdir}" FILES:${PN}-xtests = "${datadir}/Linux-PAM/xtests" +# libpam installs /etc/environment for use with the pam_env plugin. Make sure it is +# packaged with the pam-plugin-env package to avoid breaking installations which +# install that file via other packages +FILES:pam-plugin-env = "/etc/environment" + PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*" def get_multilib_bit(d):
Signature · 1 line
2.42.0
Quoted 9 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Martin Hundeb?ll
Sent: den 24 november 2023 15:12
To: [email protected]
Cc: Martin Hundebøll <[email protected]>
Subject: [OE-core] [PATCH] libpam: split/etc/environmentinto pam-plugin-env packageSince systemd-v255, pam-plugin-umask is pulled in by by the logind package config for systemd. This causes
/etc/environmentto by installed
Change "by" to "be".
Quoted 2 lines
as part of libpam-runtime. In our case, this broke
do_rootfsfor our image, because/etc/environmentis already provided another (custom)
Change "another" to "by another".
Quoted 17 lines
recipe.
Fix this by making the
/etc/environmentfile part of the pam-plugin-env package, which isn't automatically pulled in by systemd-logind. It also happens to be the where it should be, as the file is installed as by thepam_envplugin.Signed-off-by Martin Hundebøll <[email protected]>--- meta/recipes-extended/pam/libpam_1.5.3.bb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)meta/recipes-extended/pam/libpam_1.5.3.bb +0
-0
meta/recipes-extended/pam/libpam_1.5.3.bb PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db," · line 54
Quoted 5 lines
meta/recipes-extended/pam/libpam_1.5.3.bb +1
-1@@ -51,9 +51,14 @@ PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db," PACKAGES += "${PN}-runtime ${PN}-xtests" FILES:${PN} = "${base_libdir}/lib*${SOLIBS}" FILES:${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}" -FILES:${PN}-runtime = "${sysconfdir} ${sbindir} ${systemd_system_unitdir}" +FILES:${PN}-runtime = "${sysconfdir}/pam.d ${sysconfdir}/security ${sysconfdir}/tmpfiles.d ${sbindir} ${systemd_system_unitdir}"
This is prone to errors if libpam adds anything else to /etc in the future. If you instead add prepend=True as argument to the do_split_packages() call that creates the pam-plugin packages, this should not be needed.
meta/recipes-extended/pam/libpam_1.5.3.bb PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db," · line 60
Quoted 6 lines
meta/recipes-extended/pam/libpam_1.5.3.bb +4
-0FILES:${PN}-xtests = "${datadir}/Linux-PAM/xtests" +# libpam installs /etc/environment for use with the pam_env plugin. Make sure it is +# packaged with the pam-plugin-env package to avoid breaking installations which +# install that file via other packages +FILES:pam-plugin-env = "/etc/environment"
Change /etc to ${sysconfir}.
Quoted 6 lines
meta/recipes-extended/pam/libpam_1.5.3.bb +1
-1+ PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*" def get_multilib_bit(d): --2.42.0
//Peter