Skip to contentSkip to conversation

initscripts/checkroot.sh: restore file contexts for /run

PATCH Applied [email protected] 2 participants 2 messages May 9, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 initscripts/checkroot.sh: restore file contexts for /run

From: Jackie Huang <[email protected]>

The file contexts for /run is incorrect while running checkroot.sh in boot time which causes mount fail to create new dir and file in /run, so restore the security contexts in it.

---
 recipes-core/initscripts/initscripts_1.0.bbappend |    2 ++
 1 file changed, 2 insertions(+)
recipes-core/initscripts/initscripts_1.0.bbappend +2 -0
index 7ec66ea..367cd6b 100644
@@ -5,4 +5,6 @@ do_install_append () {
 touch /var/log/lastlog
 test ! -x /sbin/restorecon || /sbin/restorecon -RF /var/volatile/ /var/lib /run
 EOF
+	sed -i '/mount -n -o remount,$rootmode/i\test ! -x /sbin/restorecon || /sbin/restorecon -RF /run' \
+	    ${D}${sysconfdir}/init.d/checkroot.sh
 }
Signature · 1 line
1.7.9.5
#1 lore raw

Merged, thanks Jackie.

-J.

Quoted 25 lines · [[yocto] [meta-selinux][PATCH] initscripts/checkroot.sh: restore file contexts…

From: Jackie Huang <[email protected]>

The file contexts for /run is incorrect while running checkroot.sh in boot time which causes mount fail to create new dir and file in /run, so restore the security contexts in it.

---
 recipes-core/initscripts/initscripts_1.0.bbappend |    2 ++
 1 file changed, 2 insertions(+)
recipes-core/initscripts/initscripts_1.0.bbappend +2 -0
index 7ec66ea..367cd6b 100644
@@ -5,4 +5,6 @@ do_install_append () {
 touch /var/log/lastlog
 test ! -x /sbin/restorecon || /sbin/restorecon -RF /var/volatile/ /var/lib /run
 EOF
+	sed -i '/mount -n -o remount,$rootmode/i\test ! -x /sbin/restorecon || /sbin/restorecon -RF /run' \
+	    ${D}${sysconfdir}/init.d/checkroot.sh
 }
Signature · 1 line
1.7.9.5
Signature · 2 lines
-Joe MacDonald.
:wq