All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libpam: make volatile files created successfully
@ 2021-04-20  8:22 Changqing Li
  0 siblings, 0 replies; only message in thread
From: Changqing Li @ 2021-04-20  8:22 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 .../pam/libpam/pam-volatiles.conf             |  1 +
 meta/recipes-extended/pam/libpam_1.5.1.bb     | 21 +++++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-extended/pam/libpam/pam-volatiles.conf

diff --git a/meta/recipes-extended/pam/libpam/pam-volatiles.conf b/meta/recipes-extended/pam/libpam/pam-volatiles.conf
new file mode 100644
index 0000000000..d8b8259a93
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/pam-volatiles.conf
@@ -0,0 +1 @@
+d /var/run/sepermit 0755 root root - -
diff --git a/meta/recipes-extended/pam/libpam_1.5.1.bb b/meta/recipes-extended/pam/libpam_1.5.1.bb
index f225487688..4363e16b9b 100644
--- a/meta/recipes-extended/pam/libpam_1.5.1.bb
+++ b/meta/recipes-extended/pam/libpam_1.5.1.bb
@@ -24,6 +24,7 @@ SRC_URI = "https://github.com/linux-pam/linux-pam/releases/download/v${PV}/Linux
            file://0001-modules-pam_namespace-Makefile.am-correctly-install-.patch \
            file://0001-Makefile.am-support-usrmage.patch \
            file://run-ptest \
+           file://pam-volatiles.conf \
            "
 
 SRC_URI[sha256sum] = "201d40730b1135b1b3cdea09f2c28ac634d73181ccd0172ceddee3649c5792fc"
@@ -125,8 +126,18 @@ do_install() {
 
 	# don't install /var/run when populating rootfs. Do it through volatile
 	rm -rf ${D}${localstatedir}
-	install -d ${D}${sysconfdir}/default/volatiles
-	install -m 0644 ${WORKDIR}/99_pam ${D}${sysconfdir}/default/volatiles
+
+        if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
+            rm -rf ${D}${sysconfdir}/init.d/
+            rm -rf ${D}${sysconfdir}/rc*
+            install -d ${D}${sysconfdir}/tmpfiles.d
+            install -m 0644 ${WORKDIR}/pam-volatiles.conf \
+                    ${D}${sysconfdir}/tmpfiles.d/pam.conf
+        else
+            install -d ${D}${sysconfdir}/default/volatiles
+            install -m 0644 ${WORKDIR}/99_pam \
+                    ${D}${sysconfdir}/default/volatiles/
+        fi
 
 	install -d ${D}${sysconfdir}/pam.d/
 	install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
@@ -146,6 +157,12 @@ do_install_ptest() {
     fi
 }
 
+pkg_postinst_${PN}() {
+         if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
+                 /etc/init.d/populate-volatile.sh update
+         fi
+}
+
 inherit features_check
 REQUIRED_DISTRO_FEATURES = "pam"
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-20  8:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20  8:22 [PATCH] libpam: make volatile files created successfully Changqing Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.