Initial unified commit for Android 14, with "light" GSI target

This commit is contained in:
Andy CrossGate Yan
2024-02-17 16:48:27 +08:00
commit ea765d3ff5
117 changed files with 15033 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
From cd56da986fdf17fc6d5d82d6cb553a8444093099 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 26 Sep 2022 14:41:41 +0000
Subject: [PATCH 1/4] Make xbin and su executable by other
Needed by PHH-SU
Change-Id: I5304b787ce4602036904a373a409bb08f8f969de
---
libcutils/fs_config.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index f90a1bc3c..ef35e0588 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -87,7 +87,7 @@ static const struct fs_path_config android_dirs[] = {
{ 00751, AID_ROOT, AID_SHELL, 0, "system/bin" },
{ 00755, AID_ROOT, AID_ROOT, 0, "system/etc/ppp" },
{ 00755, AID_ROOT, AID_SHELL, 0, "system/vendor" },
- { 00750, AID_ROOT, AID_SHELL, 0, "system/xbin" },
+ { 00755, AID_ROOT, AID_SHELL, 0, "system/xbin" },
{ 00751, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin" },
{ 00750, AID_ROOT, AID_SYSTEM, 0, "system_ext/apex/com.android.tethering/bin/for-system" },
{ 00751, AID_ROOT, AID_SHELL, 0, "system_ext/bin" },
@@ -192,7 +192,7 @@ static const struct fs_path_config android_files[] = {
// the following two files are INTENTIONALLY set-uid, but they
// are NOT included on user builds.
{ 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procmem" },
- { 04750, AID_ROOT, AID_SHELL, 0, "system/xbin/su" },
+ { 04755, AID_ROOT, AID_SHELL, 0, "system/xbin/su" },
// the following files have enhanced capabilities and ARE included
// in user builds.
--
2.34.1

View File

@@ -0,0 +1,87 @@
From 4d4585b2f4f0f7dd1b6ae28cae77b8340d9e0bae 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/4] 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 ef35e0588..76174ce1c 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" },
@@ -168,6 +169,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" },
@@ -222,6 +224,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 3362872c0..1b686c38f 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -91,7 +91,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.34.1

View File

@@ -0,0 +1,31 @@
From 0cf9d044459a3e0259917dca782103126b0c2d42 Mon Sep 17 00:00:00 2001
From: Isaac Chen <tingyi364@gmail.com>
Date: Wed, 23 Jun 2021 13:07:30 +0800
Subject: [PATCH 3/4] init: Do not start console service when debuggable
Google added a check for this in R, when it's running it will show a
notification about that performance is impacted.
Signed-off-by: Isaac Chen <tingyi364@gmail.com>
Change-Id: I34cfd6b42d3b9aee4b3e63181480cfb8b1255f29
---
rootdir/init.rc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 1e6918d00..8b48a9c87 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -1312,9 +1312,6 @@ on property:ro.debuggable=1
# Give reads to anyone for the accessibility trace folder on debug builds.
chmod 0775 /data/misc/a11ytrace
-on init && property:ro.debuggable=1
- start console
-
on userspace-reboot-requested
# TODO(b/135984674): reset all necessary properties here.
setprop sys.boot_completed ""
--
2.34.1

View File

@@ -0,0 +1,35 @@
From a27092d9b56b807b66f121321e9242a9a4db834f Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 18 Oct 2020 18:14:47 +0200
Subject: [PATCH 4/4] Don't abandon creating property tree if there is a
conflict, and hope for the best
Change-Id: I194c815fdd58bfb84aaf7db02b8f0d00b4db21e8
---
.../libpropertyinfoserializer/property_info_serializer.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/property_service/libpropertyinfoserializer/property_info_serializer.cpp b/property_service/libpropertyinfoserializer/property_info_serializer.cpp
index 803657ab8..ecdd0be20 100644
--- a/property_service/libpropertyinfoserializer/property_info_serializer.cpp
+++ b/property_service/libpropertyinfoserializer/property_info_serializer.cpp
@@ -19,6 +19,7 @@
#include "property_info_parser/property_info_parser.h"
#include <set>
+#include <iostream>
#include "trie_builder.h"
#include "trie_serializer.h"
@@ -34,7 +35,7 @@ bool BuildTrie(const std::vector<PropertyInfoEntry>& property_info,
for (const auto& [name, context, type, is_exact] : property_info) {
if (!trie_builder.AddToTrie(name, context, type, is_exact, error)) {
- return false;
+ std::cerr << "Failed adding " << name << " to property trie... let's hope for the best" << std::endl;
}
}
--
2.34.1