Recovery image is self-contained
Now recovery mode is self-contained, which means we don't need to mount
system.img to run shell, etc. What is needed in recovery mode is all in
the recovery ramdisk image.
Since we no longer use /system as the mount point for the system.img,
this allows us to have identical filesystem layout as the system.img.
Executables and libs are installed to /system/bin and /system/lib.
Right now, we only have adbd, sh, toybox in /system/bin but will move
static executables from /sbin to /system/bin as soon as they are
converted to dynamic executables.
system.img is mounted to /mnt/system instead.
Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: `adb root && adb shell` and then
$ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
the /lib directory.
Change-Id: I801ebd18f3e0a112db3d9a11e4fbb4e49181652a
diff --git a/fsck_unshare_blocks.cpp b/fsck_unshare_blocks.cpp
index a100368..2e6b5b8 100644
--- a/fsck_unshare_blocks.cpp
+++ b/fsck_unshare_blocks.cpp
@@ -115,14 +115,6 @@
return true;
}
-static const char* get_system_root() {
- if (android::base::GetBoolProperty("ro.build.system_root_image", false)) {
- return "/system_root";
- } else {
- return "/system";
- }
-}
-
bool do_fsck_unshare_blocks() {
// List of partitions we will try to e2fsck -E unshare_blocks.
std::vector<std::string> partitions = { "/odm", "/oem", "/product", "/vendor" };
@@ -130,10 +122,10 @@
// Temporarily mount system so we can copy e2fsck_static.
bool mounted = false;
if (android::base::GetBoolProperty("ro.build.system_root_image", false)) {
- mounted = ensure_path_mounted_at("/", "/system_root") != -1;
+ mounted = ensure_path_mounted_at("/", "/mnt/system") != -1;
partitions.push_back("/");
} else {
- mounted = ensure_path_mounted("/system") != -1;
+ mounted = ensure_path_mounted_at("/system", "/mnt/system") != -1;
partitions.push_back("/system");
}
if (!mounted) {
@@ -144,7 +136,7 @@
LOG(ERROR) << "Could not copy e2fsck to /tmp.";
return false;
}
- if (umount(get_system_root()) < 0) {
+ if (umount("/mnt/system") < 0) {
PLOG(ERROR) << "umount failed";
return false;
}