Merge "Recovery image is self-contained"

This commit is contained in:
Treehugger Robot
2018-06-13 23:14:29 +00:00
committed by Gerrit Code Review
3 changed files with 8 additions and 17 deletions
+2 -1
View File
@@ -22,6 +22,7 @@ on init
mkdir /data mkdir /data
mkdir /cache mkdir /cache
mkdir /sideload mkdir /sideload
mkdir /mnt/system
mount tmpfs tmpfs /tmp mount tmpfs tmpfs /tmp
chown root shell /tmp chown root shell /tmp
@@ -87,7 +88,7 @@ service charger /charger -r
service recovery /sbin/recovery service recovery /sbin/recovery
seclabel u:r:recovery:s0 seclabel u:r:recovery:s0
service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery service adbd /system/bin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
disabled disabled
socket adbd stream 660 system system socket adbd stream 660 system system
seclabel u:r:adbd:s0 seclabel u:r:adbd:s0
+3 -11
View File
@@ -115,14 +115,6 @@ static bool run_e2fsck(const std::string& partition) {
return true; 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() { bool do_fsck_unshare_blocks() {
// List of partitions we will try to e2fsck -E unshare_blocks. // List of partitions we will try to e2fsck -E unshare_blocks.
std::vector<std::string> partitions = { "/odm", "/oem", "/product", "/vendor" }; std::vector<std::string> partitions = { "/odm", "/oem", "/product", "/vendor" };
@@ -130,10 +122,10 @@ bool do_fsck_unshare_blocks() {
// Temporarily mount system so we can copy e2fsck_static. // Temporarily mount system so we can copy e2fsck_static.
bool mounted = false; bool mounted = false;
if (android::base::GetBoolProperty("ro.build.system_root_image", 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("/"); partitions.push_back("/");
} else { } else {
mounted = ensure_path_mounted("/system") != -1; mounted = ensure_path_mounted_at("/system", "/mnt/system") != -1;
partitions.push_back("/system"); partitions.push_back("/system");
} }
if (!mounted) { if (!mounted) {
@@ -144,7 +136,7 @@ bool do_fsck_unshare_blocks() {
LOG(ERROR) << "Could not copy e2fsck to /tmp."; LOG(ERROR) << "Could not copy e2fsck to /tmp.";
return false; return false;
} }
if (umount(get_system_root()) < 0) { if (umount("/mnt/system") < 0) {
PLOG(ERROR) << "umount failed"; PLOG(ERROR) << "umount failed";
return false; return false;
} }
+3 -5
View File
@@ -820,15 +820,13 @@ static Device::BuiltinAction prompt_and_wait(Device* device, int status) {
break; break;
} }
case Device::MOUNT_SYSTEM: case Device::MOUNT_SYSTEM:
// For a system image built with the root directory (i.e. system_root_image == "true"), we // the system partition is mounted at /mnt/system
// 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 (android::base::GetBoolProperty("ro.build.system_root_image", false)) { if (android::base::GetBoolProperty("ro.build.system_root_image", false)) {
if (ensure_path_mounted_at("/", "/system_root") != -1) { if (ensure_path_mounted_at("/", "/mnt/system") != -1) {
ui->Print("Mounted /system.\n"); ui->Print("Mounted /system.\n");
} }
} else { } else {
if (ensure_path_mounted("/system") != -1) { if (ensure_path_mounted_at("/system", "/mnt/system") != -1) {
ui->Print("Mounted /system.\n"); ui->Print("Mounted /system.\n");
} }
} }