aboutsummaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-07-30 14:43:27 -0700
committerSteve Kondik <steve@cyngn.com>2015-11-07 19:02:26 -0800
commita6ef5d0e71f81cc8697328e7f64f841943cba0dc (patch)
tree1641525a09906697f371e317bd086ca565033102 /recovery.cpp
parenta0b7a8b4c77f764b564b9bd4283c61662f16e37d (diff)
downloadbootable_recovery-a6ef5d0e71f81cc8697328e7f64f841943cba0dc.zip
bootable_recovery-a6ef5d0e71f81cc8697328e7f64f841943cba0dc.tar.gz
bootable_recovery-a6ef5d0e71f81cc8697328e7f64f841943cba0dc.tar.bz2
recovery: Allow "Mount /system" for system_root_image.
When system images contain the root directory, there is no entry of "/system" in the fstab. Change it to look for "/" instead if ro.build.system_root_image is true. We actually mount the partition to /system_root instead, and create a symlink to /system_root/system for /system. This allows "adb shell" to work properly. Bug: 22855115 Change-Id: Ibac493a5a9320c98ee3b60bd2cc635b925f5454a
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/recovery.cpp b/recovery.cpp
index d5b0157..b7f1e4a 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -863,9 +863,24 @@ prompt_and_wait(Device* device, int status) {
break;
case Device::MOUNT_SYSTEM:
- if (ensure_path_mounted("/system") != -1) {
- ui->Print("Mounted /system.\n");
+ char system_root_image[PROPERTY_VALUE_MAX];
+ property_get("ro.build.system_root_image", system_root_image, "");
+
+ // For a system image built with the root directory (i.e.
+ // system_root_image == "true"), we mount it to /system_root, and symlink /system
+ // to /system_root/system to make adb shell work (the symlink is created through
+ // the build system).
+ // Bug: 22855115
+ if (strcmp(system_root_image, "true") == 0) {
+ if (ensure_path_mounted_at("/", "/system_root") != -1) {
+ ui->Print("Mounted /system.\n");
+ }
+ } else {
+ if (ensure_path_mounted("/system") != -1) {
+ ui->Print("Mounted /system.\n");
+ }
}
+
break;
}
}