summaryrefslogtreecommitdiffstats
path: root/fsck_unshare_blocks.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-10-14 05:18:37 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-10-14 05:18:37 +0200
commit1275be463c719e58910286765f1a72b6041df949 (patch)
tree82752ee3ec39d98c17b822b88c380da118ae8ee7 /fsck_unshare_blocks.cpp
parentSnap for 5054090 from 10db3854bb1ea79f1a165b178b78f380e93a944b to qt-release (diff)
parentMerge "Use a host java program to generate the background text" am: e4e929ce53 am: a74581a635 (diff)
downloadandroid_bootable_recovery-1275be463c719e58910286765f1a72b6041df949.tar
android_bootable_recovery-1275be463c719e58910286765f1a72b6041df949.tar.gz
android_bootable_recovery-1275be463c719e58910286765f1a72b6041df949.tar.bz2
android_bootable_recovery-1275be463c719e58910286765f1a72b6041df949.tar.lz
android_bootable_recovery-1275be463c719e58910286765f1a72b6041df949.tar.xz
android_bootable_recovery-1275be463c719e58910286765f1a72b6041df949.tar.zst
android_bootable_recovery-1275be463c719e58910286765f1a72b6041df949.zip
Diffstat (limited to 'fsck_unshare_blocks.cpp')
-rw-r--r--fsck_unshare_blocks.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/fsck_unshare_blocks.cpp b/fsck_unshare_blocks.cpp
index 2e6b5b807..684958e38 100644
--- a/fsck_unshare_blocks.cpp
+++ b/fsck_unshare_blocks.cpp
@@ -40,6 +40,7 @@
static constexpr const char* SYSTEM_E2FSCK_BIN = "/system/bin/e2fsck_static";
static constexpr const char* TMP_E2FSCK_BIN = "/tmp/e2fsck.bin";
+static constexpr const char* SYSTEM_ROOT = "/system";
static bool copy_file(const char* source, const char* dest) {
android::base::unique_fd source_fd(open(source, O_RDONLY));
@@ -121,12 +122,12 @@ bool do_fsck_unshare_blocks() {
// Temporarily mount system so we can copy e2fsck_static.
bool mounted = false;
- if (android::base::GetBoolProperty("ro.build.system_root_image", false)) {
+ if (volume_for_mount_point(SYSTEM_ROOT) == nullptr) {
mounted = ensure_path_mounted_at("/", "/mnt/system") != -1;
partitions.push_back("/");
} else {
- mounted = ensure_path_mounted_at("/system", "/mnt/system") != -1;
- partitions.push_back("/system");
+ mounted = ensure_path_mounted_at(SYSTEM_ROOT, "/mnt/system") != -1;
+ partitions.push_back(SYSTEM_ROOT);
}
if (!mounted) {
LOG(ERROR) << "Failed to mount system image.";