summaryrefslogtreecommitdiffstats
path: root/otautil/roots.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-05-15 22:59:39 +0200
committerTianjie Xu <xunchang@google.com>2019-07-24 20:36:03 +0200
commit164c60a4f3de934bab7035114546e9500cd8f232 (patch)
tree0311dd6f33655ae9b5f1aec1847405bcd54673fb /otautil/roots.cpp
parentMerge "Add command line parser for simulator" (diff)
downloadandroid_bootable_recovery-164c60a4f3de934bab7035114546e9500cd8f232.tar
android_bootable_recovery-164c60a4f3de934bab7035114546e9500cd8f232.tar.gz
android_bootable_recovery-164c60a4f3de934bab7035114546e9500cd8f232.tar.bz2
android_bootable_recovery-164c60a4f3de934bab7035114546e9500cd8f232.tar.lz
android_bootable_recovery-164c60a4f3de934bab7035114546e9500cd8f232.tar.xz
android_bootable_recovery-164c60a4f3de934bab7035114546e9500cd8f232.tar.zst
android_bootable_recovery-164c60a4f3de934bab7035114546e9500cd8f232.zip
Diffstat (limited to '')
-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;
+}