From cae5f245304fe11e86323aa7f6f4c25e898bf36b Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Tue, 31 Dec 2013 17:59:54 +0000 Subject: [PATCH] selinuxrelabel: Remove attempts to relabel /system These are a no-op due to the additional block-device protection from https://android.googlesource.com/platform/system/core/+/e18c0d508a6d8b4376c6f0b8c22600e5aca37f69 so get rid of them entirely. Any installing recovery (or equivalent installation process) should handle the labeling of system components on its own. Change-Id: I14c50f08efa6f05b03fad4fbc404219cc504e1ff TBD: Do we still want to label unlabeled files? --- prebuilt/common/etc/init.d/50selinuxrelabel | 25 ++------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/prebuilt/common/etc/init.d/50selinuxrelabel b/prebuilt/common/etc/init.d/50selinuxrelabel index d46c23ff..dfa576d5 100644 --- a/prebuilt/common/etc/init.d/50selinuxrelabel +++ b/prebuilt/common/etc/init.d/50selinuxrelabel @@ -9,7 +9,6 @@ if [ ! -f /file_contexts ]; then fi LABELDATA=0 -LABELSYS=0 LABELDALVIKCACHE=0 # Test /data @@ -19,25 +18,13 @@ if [ $? -eq 0 ]; then LABELDATA=1 fi -# Recheck other files under /data +# Double-check other files under /data ls -Z /data/misc/wifi/wpa_supplicant.conf | grep -q "wifi_" if [ $? -eq 1 ]; then - $L "data is unlabeled, fixing..." + $L "data is mis-labeled, fixing..." LABELDATA=1 fi -ls -Z /system/bin/surfaceflinger | grep -q unlabeled -if [ $? -eq 0 ]; then - $L "system is unlabeled, fixing... (You really should update your recovery)" - LABELSYS=1 -fi - -ls -Z /system/priv-app/GoogleServicesFramework.apk | grep -q unlabeled -if [ $LABELSYS = "0" -a $? -eq 0 ]; then - $L "Found unlabeled Google framework, fixing..." - LABELSYS=1 -fi - ls -Zd /data/dalvik-cache | grep -q unlabeled if [ $? -eq 0 ]; then $L "dalvik-cache is unlabeled, fixing..." @@ -51,14 +38,6 @@ if [ $? -eq 0 ]; then fi -if [ $LABELSYS = "1" ]; then - busybox mount -o remount,rw /system - $L "/system relabel starting..." - restorecon -R /system - $L "/system relabel complete" - busybox mount -o remount,ro /system -fi - if [ $LABELDATA = "1" ]; then $L "/data relabel starting..." restorecon -R /data