diff options
-rw-r--r-- | etc/init.rc | 3 | ||||
-rw-r--r-- | recovery.cpp | 17 | ||||
-rw-r--r-- | recovery_main.cpp | 2 | ||||
-rw-r--r-- | recovery_ui/device.cpp | 2 | ||||
-rw-r--r-- | recovery_ui/include/recovery_ui/screen_ui.h | 2 | ||||
-rw-r--r-- | recovery_utils/include/recovery_utils/roots.h | 2 | ||||
-rw-r--r-- | recovery_utils/roots.cpp | 17 |
7 files changed, 35 insertions, 10 deletions
diff --git a/etc/init.rc b/etc/init.rc index e4afecff..8999915e 100644 --- a/etc/init.rc +++ b/etc/init.rc @@ -49,6 +49,9 @@ on init # Start essential services start servicemanager + # pstore/ramoops previous console log + mount pstore pstore /sys/fs/pstore + on boot ifup lo hostname localhost diff --git a/recovery.cpp b/recovery.cpp index eeecd6a7..2f87f07b 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -803,8 +803,13 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri } std::vector<std::string> title_lines = - android::base::Split(android::base::GetProperty("ro.build.fingerprint", ""), ":"); - title_lines.insert(std::begin(title_lines), "Android Recovery"); + android::base::Split(android::base::GetProperty("ro.ice.version", ""), ":"); + title_lines.insert(std::begin(title_lines), "Project ICE Recovery"); + if (android::base::GetBoolProperty("ro.build.ab_update", false)) { + std::string slot = android::base::GetProperty("ro.boot.slot_suffix", ""); + if (android::base::StartsWith(slot, "_")) slot.erase(0, 1); + title_lines.push_back("Active slot: " + slot); + } ui->SetTitle(title_lines); ui->ResetKeyInterruptStatus(); @@ -941,12 +946,10 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri status = ApplyFromAdb(device, true /* rescue_mode */, &next_action); ui->Print("\nInstall from ADB complete (status: %d).\n", status); } else if (!just_exit) { - // If this is an eng or userdebug build, automatically turn on the text display if no command - // is specified. Note that this should be called before setting the background to avoid + // Always show menu if no command is specified. + // Note that this should be called before setting the background to avoid // flickering the background image. - if (IsRoDebuggable()) { - ui->ShowText(true); - } + ui->ShowText(true); status = INSTALL_NONE; // No command specified ui->SetBackground(RecoveryUI::NO_COMMAND); } diff --git a/recovery_main.cpp b/recovery_main.cpp index 9a358aba..b0eda510 100644 --- a/recovery_main.cpp +++ b/recovery_main.cpp @@ -538,7 +538,7 @@ int main(int argc, char** argv) { } case Device::ENTER_FASTBOOT: - if (android::fs_mgr::LogicalPartitionsMapped()) { + if (logical_partitions_mapped()) { ui->Print("Partitions may be mounted - rebooting to enter fastboot."); Reboot("fastboot"); } else { diff --git a/recovery_ui/device.cpp b/recovery_ui/device.cpp index d46df92d..85bf1134 100644 --- a/recovery_ui/device.cpp +++ b/recovery_ui/device.cpp @@ -29,9 +29,9 @@ static std::vector<std::pair<std::string, Device::BuiltinAction>> g_menu_actions{ { "Reboot system now", Device::REBOOT }, { "Reboot to bootloader", Device::REBOOT_BOOTLOADER }, + { "Reboot to recovery", Device::REBOOT_RECOVERY }, { "Enter fastboot", Device::ENTER_FASTBOOT }, { "Apply update from ADB", Device::APPLY_ADB_SIDELOAD }, - { "Apply update from SD card", Device::APPLY_SDCARD }, { "Wipe data/factory reset", Device::WIPE_DATA }, { "Wipe cache partition", Device::WIPE_CACHE }, { "Mount /system", Device::MOUNT_SYSTEM }, diff --git a/recovery_ui/include/recovery_ui/screen_ui.h b/recovery_ui/include/recovery_ui/screen_ui.h index 99ad5342..def1fe25 100644 --- a/recovery_ui/include/recovery_ui/screen_ui.h +++ b/recovery_ui/include/recovery_ui/screen_ui.h @@ -127,7 +127,7 @@ class TextMenu : public Menu { size_t MenuEnd() const; // Menu example: - // info: Android Recovery + // info: Project ICE Recovery // .... // help messages: Swipe up/down to move // Swipe left/right to select diff --git a/recovery_utils/include/recovery_utils/roots.h b/recovery_utils/include/recovery_utils/roots.h index 92ee756f..bd6dbea0 100644 --- a/recovery_utils/include/recovery_utils/roots.h +++ b/recovery_utils/include/recovery_utils/roots.h @@ -56,3 +56,5 @@ int setup_install_mounts(); // Returns true if there is /cache in the volumes. bool HasCache(); + +bool logical_partitions_mapped();
\ No newline at end of file diff --git a/recovery_utils/roots.cpp b/recovery_utils/roots.cpp index 62ccdb6a..5eaa7e94 100644 --- a/recovery_utils/roots.cpp +++ b/recovery_utils/roots.cpp @@ -37,6 +37,7 @@ #include <ext4_utils/wipe.h> #include <fs_mgr.h> #include <fs_mgr/roots.h> +#include <fs_mgr_dm_linear.h> #include "otautil/sysutil.h" @@ -293,6 +294,8 @@ int format_volume(const std::string& volume) { return format_volume(volume, ""); } +static bool logical_partitions_auto_mapped = false; + int setup_install_mounts() { if (fstab.empty()) { LOG(ERROR) << "can't set up install mounts: no fstab loaded"; @@ -317,6 +320,16 @@ int setup_install_mounts() { } } } + // Map logical partitions + if (android::base::GetBoolProperty("ro.boot.dynamic_partitions", false) && + !logical_partitions_mapped()) { + std::string super_name = fs_mgr_get_super_partition_name(); + if (!android::fs_mgr::CreateLogicalPartitions("/dev/block/by-name/" + super_name)) { + LOG(ERROR) << "Failed to map logical partitions"; + } else { + logical_partitions_auto_mapped = true; + } + } return 0; } @@ -325,3 +338,7 @@ bool HasCache() { static bool has_cache = volume_for_mount_point(CACHE_ROOT) != nullptr; return has_cache; } + +bool logical_partitions_mapped() { + return android::fs_mgr::LogicalPartitionsMapped() || logical_partitions_auto_mapped; +} |