persist: contexts for lost+found not found when running e2fsdroid
When running e2fsdroid on persist, lost+found doesn't have any
entries in file_contexts. We are removing the lost+found directory
after a wipe now, and before the restore of the tar.
Change-Id: If5db0971884e296fae0211ff4806f3e16e394632
Change-Id: I9fa51dc9ef558cd82445df9a8fa377b1feda11aa
diff --git a/partition.cpp b/partition.cpp
index 650ec15..ed0e3fd 100755
--- a/partition.cpp
+++ b/partition.cpp
@@ -2159,6 +2159,11 @@
LOGINFO("Cannot lookup security context for '%s'\n", Mount_Point.c_str());
} else {
// Execute e2fsdroid to initialize selinux context
+ if (Mount_Point == "/persist") {
+ Mount(true);
+ TWFunc::removeDir("/persist/lost+found", false);
+ UnMount(true);
+ }
Command = "e2fsdroid -e -S /file_contexts -a " + File_Contexts_Entry + " " + Actual_Block_Device;
LOGINFO("e2fsdroid command: %s\n", Command.c_str());
ret = TWFunc::Exec_Cmd(Command);