factory reset: restore ext4 policy on /data/cache
If ext4 policy is not restored, system won't boot properly
after a factory reset.
When /data is formatted by the user, we need to make sure we
do not create the /data/cache directory so that Android can
create it with the new policy for /data.
This also removes extraneous umount calls, and places them
in the specific wipe function for each filesystem.
Change-Id: I71ff39d8660fbf4aa6fe8a8309e291166359da72
diff --git a/partitions.hpp b/partitions.hpp
old mode 100644
new mode 100755
index 92970d9..5a52fa3
--- a/partitions.hpp
+++ b/partitions.hpp
@@ -26,6 +26,7 @@
#include "exclude.hpp"
#include "tw_atomic.hpp"
#include "progresstracking.hpp"
+#include "ext4crypt_tar.h"
#define MAX_FSTAB_LINE_LENGTH 2048
@@ -207,6 +208,7 @@
bool Wipe_NTFS(); // Uses mkntfs to wipe
bool Wipe_Data_Without_Wiping_Media(); // Uses rm -rf to wipe but does not wipe /data/media
bool Wipe_Data_Without_Wiping_Media_Func(const string& parent); // Uses rm -rf to wipe but does not wipe /data/media
+ bool Recreate_AB_Cache_Dir(const ext4_encryption_policy &policy); // Recreate AB_CACHE_DIR after wipe
void Wipe_Crypto_Key(); // Wipe crypto key from either footer or block device
bool Backup_Tar(PartitionSettings *part_settings, pid_t *tar_fork_pid); // Backs up using tar for file systems
bool Backup_Image(PartitionSettings *part_settings); // Backs up using raw read/write for emmc memory types
@@ -281,7 +283,7 @@
bool SlotSelect; // Partition has A/B slots
TWExclude backup_exclusions; // Exclusions for file based backups
TWExclude wipe_exclusions; // Exclusions for file based wipes (data/media devices only)
- string Key_Directory; // Metadata key directory needed for mounting FBE encrypted data partitions using metadata encryption
+ string Key_Directory; // Metadata key directory needed for mounting FBE encrypted data partitions using metadata encryption
struct partition_fs_flags_struct { // This struct is used to store mount flags and options for different file systems for the same partition
string File_System;