summaryrefslogtreecommitdiffstats
path: root/otautil/roots.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'otautil/roots.cpp')
-rw-r--r--otautil/roots.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/otautil/roots.cpp b/otautil/roots.cpp
index a778e05ff..431551785 100644
--- a/otautil/roots.cpp
+++ b/otautil/roots.cpp
@@ -51,6 +51,8 @@ using android::fs_mgr::ReadDefaultFstab;
static Fstab fstab;
+constexpr const char* CACHE_ROOT = "/cache";
+
void load_volume_table() {
if (!ReadDefaultFstab(&fstab)) {
LOG(ERROR) << "Failed to read default fstab";
@@ -275,3 +277,9 @@ int setup_install_mounts() {
}
return 0;
}
+
+bool HasCache() {
+ CHECK(!fstab.empty());
+ static bool has_cache = volume_for_mount_point(CACHE_ROOT) != nullptr;
+ return has_cache;
+}