summaryrefslogtreecommitdiffstats
path: root/twrp.cpp
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2013-12-06 17:55:41 +0100
committerGerrit Code Review <gerrit2@gerrit>2013-12-19 19:06:06 +0100
commit8d0eb1361e00f335c5f3b55502ed6f9b4525a565 (patch)
tree79e8f21f32219194e1d75f5c0514d5dc2df71fef /twrp.cpp
parentCreate a TWRP Disk Usage Class to retain state about a directory and whether we should skip it in other classes like twrpTar. (diff)
downloadandroid_bootable_recovery-8d0eb1361e00f335c5f3b55502ed6f9b4525a565.tar
android_bootable_recovery-8d0eb1361e00f335c5f3b55502ed6f9b4525a565.tar.gz
android_bootable_recovery-8d0eb1361e00f335c5f3b55502ed6f9b4525a565.tar.bz2
android_bootable_recovery-8d0eb1361e00f335c5f3b55502ed6f9b4525a565.tar.lz
android_bootable_recovery-8d0eb1361e00f335c5f3b55502ed6f9b4525a565.tar.xz
android_bootable_recovery-8d0eb1361e00f335c5f3b55502ed6f9b4525a565.tar.zst
android_bootable_recovery-8d0eb1361e00f335c5f3b55502ed6f9b4525a565.zip
Diffstat (limited to 'twrp.cpp')
-rw-r--r--twrp.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/twrp.cpp b/twrp.cpp
index 3e56af2d5..06532cba2 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -123,7 +123,17 @@ int main(int argc, char **argv) {
printf("SELinux contexts loaded from /file_contexts\n");
{ // Check to ensure SELinux can be supported by the kernel
char *contexts = NULL;
- lgetfilecon("/sbin/teamwin", &contexts);
+
+ if (PartitionManager.Mount_By_Path("/cache", true) && TWFunc::Path_Exists("/cache/recovery")) {
+ lgetfilecon("/cache/recovery", &contexts);
+ if (!contexts) {
+ lsetfilecon("/cache/recovery", "test");
+ lgetfilecon("/cache/recovery", &contexts);
+ }
+ } else {
+ LOGINFO("Could not check /cache/recovery SELinux contexts, using /sbin/teamwin instead which may be inaccurate.\n");
+ lgetfilecon("/sbin/teamwin", &contexts);
+ }
if (!contexts) {
gui_print("Kernel does not have support for reading SELinux contexts.\n");
} else {