AB Cache dir: If device doesn't have /data/cache for FBE, we should

try /persist if in the fstab.

Change-Id: I70dd19538b7f9b8cf61c46f6c8167057eec3342b
This commit is contained in:
bigbiff bigbiff
2019-03-23 18:33:17 -04:00
committed by Dees Troy
parent 794e364e08
commit e4bdb15a5f
4 changed files with 24 additions and 4 deletions
+6 -1
View File
@@ -1043,6 +1043,11 @@ void DataManager::Output_Version(void)
char version[255];
std::string cacheDir = TWFunc::get_cache_dir();
if (cacheDir.empty()) {
LOGINFO("Unable to find cache directory\n");
return;
}
std::string recoveryCacheDir = cacheDir + "recovery/";
if (cacheDir == NON_AB_CACHE_DIR) {
@@ -1053,7 +1058,7 @@ void DataManager::Output_Version(void)
}
if (!TWFunc::Path_Exists(recoveryCacheDir)) {
LOGINFO("Recreating %s folder.\n", recoveryCacheDir.c_str());
if (mkdir(recoveryCacheDir.c_str(), S_IRWXU | S_IRWXG | S_IWGRP | S_IXGRP) != 0) {
if (!TWFunc::Create_Dir_Recursive(recoveryCacheDir.c_str(), S_IRWXU | S_IRWXG | S_IWGRP | S_IXGRP, 0, 0)) {
LOGERR("DataManager::Output_Version -- Unable to make %s: %s\n", recoveryCacheDir.c_str(), strerror(errno));
return;
}