Skip to contentSkip to conversation

libpam: split /etc/environment into pam-plugin-env package

PATCH Superseded Martin Hundebøll 2 participants 2 messages Nov 24, 2023 – Nov 26, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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
index 1aa307af4d..c2ba1e6899 100644
@@ -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
#1 lore raw
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/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

Change "by" to "be".

Quoted 2 lines

as part of libpam-runtime. In our case, this broke do_rootfs for our image, because /etc/environment is already provided another (custom)

Change "another" to "by another".

Quoted 17 lines

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 +0 -0
index 1aa307af4d..c2ba1e6899 100644

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 -0
 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"

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