From 19e8461ff77da36da5c182b655f57943cf4563cf Mon Sep 17 00:00:00 2001 From: dianlujitao Date: Mon, 22 Apr 2019 17:55:11 +0800 Subject: Pass file_contexts path to e2fsdroid * Otherwise no context will be initialized but existing context will be erased and lead to unexpected behavior, e.g., device no longer boots after restoring a system backup due to missing valid seclabel of the system partition. Change-Id: I60c62fdc699714bb906a40ce5e1f40299681f72a --- partition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partition.cpp b/partition.cpp index edf344f5c..88c2cd3a5 100644 --- a/partition.cpp +++ b/partition.cpp @@ -2081,7 +2081,7 @@ bool TWPartition::Wipe_EXTFS(string File_System) { if (TWFunc::Path_Exists("/sbin/e2fsdroid")) { // Execute e2fsdroid to initialize selinux context - Command = "e2fsdroid -e -a " + Mount_Point + " " + Actual_Block_Device; + Command = "e2fsdroid -e -S /file_contexts -a " + Mount_Point + " " + Actual_Block_Device; LOGINFO("e2fsdroid command: %s\n", Command.c_str()); ret = TWFunc::Exec_Cmd(Command); if (ret) { -- cgit v1.2.3