Merge "init: manually restorecon mke2fs tools on ramdisk" am: e2629c5682 am: 06c1500a14 am: 2ce5eb91c0
am: 6cfade736d
Change-Id: Ibeaad1051f46537debb696b69c12acdd460cb336
diff --git a/init/init.cpp b/init/init.cpp
index 3e64c38..e7d01f4 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -882,9 +882,9 @@
}
}
-// The files and directories that were created before initial sepolicy load
-// need to have their security context restored to the proper value.
-// This must happen before /dev is populated by ueventd.
+// The files and directories that were created before initial sepolicy load or
+// files on ramdisk need to have their security context restored to the proper
+// value. This must happen before /dev is populated by ueventd.
static void selinux_restore_context() {
LOG(INFO) << "Running restorecon...";
restorecon("/dev");
@@ -914,6 +914,9 @@
restorecon("/sys", SELINUX_ANDROID_RESTORECON_RECURSE);
restorecon("/dev/block", SELINUX_ANDROID_RESTORECON_RECURSE);
restorecon("/dev/device-mapper");
+
+ restorecon("/sbin/mke2fs");
+ restorecon("/sbin/e2fsdroid");
}
// Set the UDC controller for the ConfigFS USB Gadgets.