Skip to contentSkip to conversation

autorelabel: only selinux-autorelabel need autorelabel file

PATCH New Christophe PRIOUZEAU 1 participant 1 message Nov 5, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 autorelabel: only selinux-autorelabel need autorelabel file

With previous implementation, several packages provided
.autorelabel file while only selinux-autorelabel manage it.
If there is several packages which try to install .autorelabel file, an issue occur during installation of packagegroup-core-selinux.

---
 recipes-security/selinux/selinux-autorelabel_0.1.bb | 9 +++++++++
 recipes-security/selinux/selinux-initsh.inc         | 7 -------
 2 files changed, 9 insertions(+), 7 deletions(-)
recipes-security/selinux/selinux-autorelabel_0.1.bb +9 -0
index 4eb2b4e..7e7d08c 100644
@@ -18,3 +18,12 @@ SRC_URI = "file://${BPN}.sh \
 INITSCRIPT_PARAMS = "start 01 S ."
 
 require selinux-initsh.inc
+
+do_install_append() {
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		install -d ${D}${bindir}
+		install -m 0755 ${WORKDIR}/${SELINUX_SCRIPT_SRC}.sh ${D}${bindir}
+		sed -i -e '/.*HERE$/d' ${D}${bindir}/${SELINUX_SCRIPT_SRC}.sh
+		echo "# first boot relabelling" > ${D}/.autorelabel
+	fi
+}
recipes-security/selinux/selinux-initsh.inc +0 -7
index 8e31cda..6084762 100644
@@ -29,13 +29,6 @@ do_install () {
 
 	install -d ${D}${systemd_unitdir}/system
 	install -m 0644 ${WORKDIR}/${SELINUX_SCRIPT_SRC}.service ${D}${systemd_unitdir}/system
-
-	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-		install -d ${D}${bindir}
-		install -m 0755 ${WORKDIR}/${SELINUX_SCRIPT_SRC}.sh ${D}${bindir}
-		sed -i -e '/.*HERE$/d' ${D}${bindir}/${SELINUX_SCRIPT_SRC}.sh
-		echo "# first boot relabelling" > ${D}/.autorelabel
-	fi
 }
 
 sysroot_stage_all_append () {
Signature · 1 line
2.17.1