initscripts: fix contexts for /etc/resolv.conf, adjtime

Restore contexts for /etc/{resolv.conf, adjtime}, they are created
dynamically and the incorrect contexts maybe prevent some programs
from valid accessing.

  /etc/resolv.conf: etc_t:SystemHigh -> etc_t:SystemLow
  /etc/adjtime:     etc_t:SystemHigh -> adjtime_t:SystemLow

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
This commit is contained in:
Wenzong Fan 2015-07-09 15:59:23 +08:00 committed by Joe MacDonald
parent c8018efc6a
commit 614b7a78e7

View File

@ -5,7 +5,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
do_install_append () {
cat <<-EOF >> ${D}${sysconfdir}/init.d/populate-volatile.sh
touch /var/log/lastlog
test ! -x /sbin/restorecon || /sbin/restorecon -RF /var/volatile/ /var/lib /run
test ! -x /sbin/restorecon || /sbin/restorecon -RF /var/volatile/ /var/lib /run \
/etc/resolv.conf /etc/adjtime
EOF
sed -i '/mount -n -o remount,$rootmode/i\test ! -x /sbin/restorecon || /sbin/restorecon -RF /run' \
${D}${sysconfdir}/init.d/checkroot.sh