Initial unified commit for Android 12, syncing up to v400.a
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
From ed8e7d31d3d96f9ce4f30aa452038d1eb2e9b561 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 4 Sep 2019 21:11:48 +0200
|
||||
Subject: [PATCH 1/3] Panic into recovery rather than bootloader
|
||||
|
||||
Getting last_kmsg/pstore from bootloader isn't possible for other people
|
||||
than the OEM, but we have TWRP to access last_kmsg/pstore
|
||||
|
||||
Change-Id: If04bb6572dc66677d7b44f7d302b2d69ce526200
|
||||
---
|
||||
init/reboot_utils.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/init/reboot_utils.cpp b/init/reboot_utils.cpp
|
||||
index b3fa9fd3b..03b5a6f0e 100644
|
||||
--- a/init/reboot_utils.cpp
|
||||
+++ b/init/reboot_utils.cpp
|
||||
@@ -36,7 +36,7 @@
|
||||
namespace android {
|
||||
namespace init {
|
||||
|
||||
-static std::string init_fatal_reboot_target = "bootloader";
|
||||
+static std::string init_fatal_reboot_target = "recovery";
|
||||
static bool init_fatal_panic = false;
|
||||
|
||||
// this needs to read the /proc/* files directly because it is called before
|
||||
@@ -73,7 +73,7 @@ void SetFatalRebootTarget(const std::optional<std::string>& reboot_target) {
|
||||
init_fatal_reboot_target = value;
|
||||
}
|
||||
});
|
||||
- // We already default to bootloader if no setting is provided.
|
||||
+ // We already default to recovery if no setting is provided.
|
||||
} else {
|
||||
const std::string kRebootTargetStringPattern = kRebootTargetString + "=";
|
||||
start_pos += sizeof(kRebootTargetStringPattern) - 1;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
From fd8c95c473df2b62fd22ce3711b8ec7cfd2a337b Mon Sep 17 00:00:00 2001
|
||||
From: Victor Bo <bvoid@yandex.ru>
|
||||
Date: Wed, 3 Mar 2021 06:31:17 -0500
|
||||
Subject: [PATCH 2/3] Restore /sbin for Magisk compatibility
|
||||
|
||||
Squash of:
|
||||
- Revert "Do not create /sbin"
|
||||
- Revert "Remove sbin from fs_config.cpp"
|
||||
- add /sbin to the PATH
|
||||
|
||||
Change-Id: I1224c9b64ce8eb14f7d15c8441c0633a7e6a20de
|
||||
---
|
||||
CleanSpec.mk | 2 --
|
||||
libcutils/fs_config.cpp | 3 +++
|
||||
rootdir/Android.mk | 2 +-
|
||||
rootdir/init.environ.rc.in | 1 +
|
||||
4 files changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/CleanSpec.mk b/CleanSpec.mk
|
||||
index 0a534a2bd..81150a0fa 100644
|
||||
--- a/CleanSpec.mk
|
||||
+++ b/CleanSpec.mk
|
||||
@@ -80,8 +80,6 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/vndksp.libraries.txt)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/sbin/charger)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/sbin/charger)
|
||||
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/sbin)
|
||||
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/sbin)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/product_services)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/product_services.img)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/product_services)
|
||||
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
|
||||
index e9497a806..8661c1684 100644
|
||||
--- a/libcutils/fs_config.cpp
|
||||
+++ b/libcutils/fs_config.cpp
|
||||
@@ -80,6 +80,7 @@ static const struct fs_path_config android_dirs[] = {
|
||||
{ 00771, AID_SYSTEM, AID_SYSTEM, 0, "data" },
|
||||
{ 00755, AID_ROOT, AID_SYSTEM, 0, "mnt" },
|
||||
{ 00751, AID_ROOT, AID_SHELL, 0, "product/bin" },
|
||||
+ { 00750, AID_ROOT, AID_SHELL, 0, "sbin" },
|
||||
{ 00751, AID_ROOT, AID_SHELL, 0, "product/apex/*/bin" },
|
||||
{ 00777, AID_ROOT, AID_ROOT, 0, "sdcard" },
|
||||
{ 00751, AID_ROOT, AID_SDCARD_R, 0, "storage" },
|
||||
@@ -166,6 +167,7 @@ static const struct fs_path_config android_files[] = {
|
||||
{ 00600, AID_ROOT, AID_ROOT, 0, "system_ext/build.prop" },
|
||||
{ 00444, AID_ROOT, AID_ROOT, 0, system_ext_conf_dir + 1 },
|
||||
{ 00444, AID_ROOT, AID_ROOT, 0, system_ext_conf_file + 1 },
|
||||
+ { 00750, AID_ROOT, AID_SHELL, 0, "sbin/fs_mgr" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/crash_dump32" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/crash_dump64" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/debuggerd" },
|
||||
@@ -217,6 +219,7 @@ static const struct fs_path_config android_files[] = {
|
||||
{ 00750, AID_ROOT, AID_SHELL, 0, "init*" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "odm/bin/*" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "product/bin/*" },
|
||||
+ { 00750, AID_ROOT, AID_SHELL, 0, "sbin/*" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "product/apex/*bin/*" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/*" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/xbin/*" },
|
||||
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
|
||||
index 99d8f9a83..6788d2ebf 100644
|
||||
--- a/rootdir/Android.mk
|
||||
+++ b/rootdir/Android.mk
|
||||
@@ -85,7 +85,7 @@ endif
|
||||
#
|
||||
# create some directories (some are mount points) and symlinks
|
||||
LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \
|
||||
- dev proc sys system data data_mirror odm oem acct config storage mnt apex debug_ramdisk \
|
||||
+ sbin dev proc sys system data data_mirror odm oem acct config storage mnt apex debug_ramdisk \
|
||||
linkerconfig second_stage_resources postinstall $(BOARD_ROOT_EXTRA_FOLDERS)); \
|
||||
ln -sf /system/bin $(TARGET_ROOT_OUT)/bin; \
|
||||
ln -sf /system/etc $(TARGET_ROOT_OUT)/etc; \
|
||||
diff --git a/rootdir/init.environ.rc.in b/rootdir/init.environ.rc.in
|
||||
index bf6e986c4..090fa5a78 100644
|
||||
--- a/rootdir/init.environ.rc.in
|
||||
+++ b/rootdir/init.environ.rc.in
|
||||
@@ -10,6 +10,7 @@ on early-init
|
||||
export ANDROID_TZDATA_ROOT /apex/com.android.tzdata
|
||||
export EXTERNAL_STORAGE /sdcard
|
||||
export ASEC_MOUNTPOINT /mnt/asec
|
||||
+ export PATH /sbin:/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
|
||||
%EXPORT_GLOBAL_ASAN_OPTIONS%
|
||||
%EXPORT_GLOBAL_GCOV_OPTIONS%
|
||||
%EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS%
|
||||
--
|
||||
2.25.1
|
||||
|
||||
52
patches_treble/system_core/0003-fix-offline-charger-v7.patch
Normal file
52
patches_treble/system_core/0003-fix-offline-charger-v7.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From 786f091175fad5b95b27e3806f5dd775f992826b Mon Sep 17 00:00:00 2001
|
||||
From: Victor Bo <bvoid@yandex.ru>
|
||||
Date: Wed, 26 Feb 2020 07:23:44 +0200
|
||||
Subject: [PATCH 3/3] fix offline charger v7
|
||||
|
||||
modified: rootdir/init.rc
|
||||
---
|
||||
rootdir/init.rc | 13 +++++++++++--
|
||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/rootdir/init.rc b/rootdir/init.rc
|
||||
index 376a678a8..6434d06bf 100644
|
||||
--- a/rootdir/init.rc
|
||||
+++ b/rootdir/init.rc
|
||||
@@ -11,6 +11,11 @@ import /vendor/etc/init/hw/init.${ro.hardware}.rc
|
||||
import /system/etc/init/hw/init.usb.configfs.rc
|
||||
import /system/etc/init/hw/init.${ro.zygote}.rc
|
||||
|
||||
+service gsicharger /bin/charger
|
||||
+ class gsicharger
|
||||
+ user system
|
||||
+ group system shell input graphics wakelock
|
||||
+
|
||||
# Cgroups are mounted right before early-init using list from /etc/cgroups.json
|
||||
on early-init
|
||||
# Disable sysrq from keyboard
|
||||
@@ -452,7 +457,7 @@ on init
|
||||
# Healthd can trigger a full boot from charger mode by signaling this
|
||||
# property when the power button is held.
|
||||
on property:sys.boot_from_charger_mode=1
|
||||
- class_stop charger
|
||||
+ class_stop gsicharger
|
||||
trigger late-init
|
||||
|
||||
on load_persist_props_action
|
||||
@@ -1090,8 +1095,12 @@ on nonencrypted
|
||||
on property:sys.init_log_level=*
|
||||
loglevel ${sys.init_log_level}
|
||||
|
||||
+on charger && property:ro.hardware=mt*
|
||||
+ write /sys/class/leds/lcd-backlight/trigger "backlight"
|
||||
+ write /sys/class/android_usb/android0/enable 1
|
||||
+
|
||||
on charger
|
||||
- class_start charger
|
||||
+ class_start gsicharger
|
||||
|
||||
on property:vold.decrypt=trigger_load_persist_props
|
||||
load_persist_props
|
||||
--
|
||||
2.25.1
|
||||
|
||||
Reference in New Issue
Block a user