From c7e92306143a7b11b570ea110bc467d881a2528d Mon Sep 17 00:00:00 2001 From: Chirayu Desai Date: Sat, 7 Dec 2013 20:50:17 +0530 Subject: [PATCH] selinuxrelabel: Add a check for dalvik-cache Change-Id: Ic8087450756ae81458e155aa1ca22d5055547664 --- prebuilt/common/etc/init.d/50selinuxrelabel | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/prebuilt/common/etc/init.d/50selinuxrelabel b/prebuilt/common/etc/init.d/50selinuxrelabel index 2fd4a02b..9332f007 100644 --- a/prebuilt/common/etc/init.d/50selinuxrelabel +++ b/prebuilt/common/etc/init.d/50selinuxrelabel @@ -10,6 +10,7 @@ fi LABELDATA=0 LABELSYS=0 +LABELDALVIKCACHE=0 # Test /data ls -Zd /data/system | grep -q unlabeled @@ -30,6 +31,18 @@ if [ $LABELSYS = "0" -a $? -eq 0 ]; then LABELSYS=1 fi +ls -Zd /data/dalvik-cache | grep -q unlabeled +if [ $? -eq 0 ]; then + $L "dalvik-cache is unlabeled, fixing..." + LABELDALVIKCACHE=1 +fi + +ls -Zd /cache/dalvik-cache | grep -q unlabeled +if [ $? -eq 0 ]; then + $L "dalvik-cache is unlabeled, fixing..." + LABELDALVIKCACHE=1 +fi + if [ $LABELSYS = "1" ]; then busybox mount -o remount,rw /system @@ -47,3 +60,10 @@ if [ $LABELDATA = "1" ]; then restorecon -R /cache $L "/cache relabel complete" fi + +if [ $LABELDALVIKCACHE = "1" ]; then + $L "dalvik-cache relabel starting..." + restorecon -R /data/dalvik-cache + restorecon -R /cache/dalvik-cache + $L "dalvik-cache relabel complete" +fi