summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/init.rc3
-rw-r--r--recovery.cpp17
-rw-r--r--recovery_main.cpp2
-rw-r--r--recovery_ui/device.cpp2
-rw-r--r--recovery_ui/include/recovery_ui/screen_ui.h2
-rw-r--r--recovery_utils/include/recovery_utils/roots.h2
-rw-r--r--recovery_utils/roots.cpp17
7 files changed, 35 insertions, 10 deletions
diff --git a/etc/init.rc b/etc/init.rc
index 5cacb8bd..4306b701 100644
--- a/etc/init.rc
+++ b/etc/init.rc
@@ -38,6 +38,9 @@ on init
write /proc/sys/kernel/panic_on_oops 1
write /proc/sys/vm/max_map_count 1000000
+ # 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 134a80d7..4bf5f129 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -794,8 +794,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();
@@ -933,12 +938,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 80cba61d..b7cf0574 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 92b3c254..26d65448 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 52eae384..0de61ae8 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"
@@ -290,6 +291,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";
@@ -314,6 +317,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;
}
@@ -322,3 +335,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;
+}