summaryrefslogtreecommitdiffstats
path: root/recipes-core/initscripts/initscripts-1.0_selinux.inc
blob: 6d912cd8d2955172170983935d3d58d7a1843b39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

restore_context() {
	cat <<-EOF >> ${D}${sysconfdir}/init.d/populate-volatile.sh
touch /var/log/lastlog
test ! -x /sbin/restorecon || /sbin/restorecon -iRF /var/volatile/ /var/lib /run \
    /etc/resolv.conf /etc/adjtime /tmp /var/tmp /var/log /var/lock /var/run
EOF
	sed -i '/mount -n -o remount,$rootmode/i\test ! -x /sbin/restorecon || /sbin/restorecon -iRF /run' \
	    ${D}${sysconfdir}/init.d/checkroot.sh
}

do_install[postfuncs] += "${@'' if 'read-only-rootfs' in d.getVar('IMAGE_FEATURES') else 'restore_context'}"