Merge "recovery: deprecate check for ro.build.system_root_image"
am: a67e9424c3
Change-Id: If63275e0112889b25668ad29b0429b4b3c27dfb2
This commit is contained in:
@@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
static constexpr const char* SYSTEM_E2FSCK_BIN = "/system/bin/e2fsck_static";
|
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* TMP_E2FSCK_BIN = "/tmp/e2fsck.bin";
|
||||||
|
static constexpr const char* SYSTEM_ROOT = "/system";
|
||||||
|
|
||||||
static bool copy_file(const char* source, const char* dest) {
|
static bool copy_file(const char* source, const char* dest) {
|
||||||
android::base::unique_fd source_fd(open(source, O_RDONLY));
|
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.
|
// 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 (volume_for_mount_point(SYSTEM_ROOT) == nullptr) {
|
||||||
mounted = ensure_path_mounted_at("/", "/mnt/system") != -1;
|
mounted = ensure_path_mounted_at("/", "/mnt/system") != -1;
|
||||||
partitions.push_back("/");
|
partitions.push_back("/");
|
||||||
} else {
|
} else {
|
||||||
mounted = ensure_path_mounted_at("/system", "/mnt/system") != -1;
|
mounted = ensure_path_mounted_at(SYSTEM_ROOT, "/mnt/system") != -1;
|
||||||
partitions.push_back("/system");
|
partitions.push_back(SYSTEM_ROOT);
|
||||||
}
|
}
|
||||||
if (!mounted) {
|
if (!mounted) {
|
||||||
LOG(ERROR) << "Failed to mount system image.";
|
LOG(ERROR) << "Failed to mount system image.";
|
||||||
|
|||||||
+3
-2
@@ -78,6 +78,7 @@ static constexpr const char* CACHE_ROOT = "/cache";
|
|||||||
static constexpr const char* DATA_ROOT = "/data";
|
static constexpr const char* DATA_ROOT = "/data";
|
||||||
static constexpr const char* METADATA_ROOT = "/metadata";
|
static constexpr const char* METADATA_ROOT = "/metadata";
|
||||||
static constexpr const char* SDCARD_ROOT = "/sdcard";
|
static constexpr const char* SDCARD_ROOT = "/sdcard";
|
||||||
|
static constexpr const char* SYSTEM_ROOT = "/system";
|
||||||
|
|
||||||
// We define RECOVERY_API_VERSION in Android.mk, which will be picked up by build system and packed
|
// We define RECOVERY_API_VERSION in Android.mk, which will be picked up by build system and packed
|
||||||
// into target_files.zip. Assert the version defined in code and in Android.mk are consistent.
|
// into target_files.zip. Assert the version defined in code and in Android.mk are consistent.
|
||||||
@@ -852,12 +853,12 @@ static Device::BuiltinAction prompt_and_wait(Device* device, int status) {
|
|||||||
}
|
}
|
||||||
case Device::MOUNT_SYSTEM:
|
case Device::MOUNT_SYSTEM:
|
||||||
// the system partition is mounted at /mnt/system
|
// the system partition is mounted at /mnt/system
|
||||||
if (android::base::GetBoolProperty("ro.build.system_root_image", false)) {
|
if (volume_for_mount_point(SYSTEM_ROOT) == nullptr) {
|
||||||
if (ensure_path_mounted_at("/", "/mnt/system") != -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_at("/system", "/mnt/system") != -1) {
|
if (ensure_path_mounted_at(SYSTEM_ROOT, "/mnt/system") != -1) {
|
||||||
ui->Print("Mounted /system.\n");
|
ui->Print("Mounted /system.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user