From 44eca61ab95b304d4cf6a2cc89b2fb4ce1d5aa29 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Wed, 4 Dec 2024 23:23:22 +0000 Subject: [PATCH 1/3] Replace partition-specific toybox make module with soong modules toybox no longer sets recovery_available property, thus this make module is no longer generated. Thus, replace the entry with the soong modules to prevent missing dependencies make error. This change also specifies `recovery` property in shell_and_utilities_recovery to allow soong generated recovery partition to correctly install the dependencies of the phony module. Test: m nothing Bug: 381888358 Change-Id: I314e8031d23a9f579101ca1d5499969af4e3a9d3 --- shell_and_utilities/Android.bp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell_and_utilities/Android.bp b/shell_and_utilities/Android.bp index 1f5c1795c..0a1f7c5a2 100644 --- a/shell_and_utilities/Android.bp +++ b/shell_and_utilities/Android.bp @@ -43,9 +43,10 @@ phony { required: [ "sh.recovery", "toolbox.recovery", - "toybox.recovery", + "toybox_recovery", "ziptool.recovery", ], + recovery: true, } phony { From 09e7cea7c1b611dd1fffc2d2d3fec94bee4e5218 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Fri, 6 Dec 2024 01:51:35 +0000 Subject: [PATCH 2/3] Define toolbox.recovery By removing `recovery_available` property from "toolbox" and defining a dedicated recovery-specific module for "toolbox". `recovery_available` property should be used to allow the reverse dependencies recovery modules to depend on the module, not to install the module to the recovery partition. Test: m soong_generated_recovery_filesystem_test Bug: 381888358 Change-Id: I8e1bbf56aaf5ba4a761d84e60afa420ba6f825b9 --- toolbox/Android.bp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/toolbox/Android.bp b/toolbox/Android.bp index 120cc6e16..314254298 100644 --- a/toolbox/Android.bp +++ b/toolbox/Android.bp @@ -68,10 +68,16 @@ cc_defaults { cc_binary { name: "toolbox", defaults: ["toolbox_binary_defaults"], - recovery_available: true, vendor_ramdisk_available: true, } +cc_binary { + name: "toolbox.recovery", + defaults: ["toolbox_binary_defaults"], + recovery: true, + stem: "toolbox", +} + cc_binary { name: "toolbox_vendor", stem: "toolbox", From fdd861ef7e3490ab3c0fa9766ca12a5ce2c7376e Mon Sep 17 00:00:00 2001 From: "T.J. Mercier" Date: Fri, 6 Dec 2024 17:52:29 +0000 Subject: [PATCH 3/3] debuggerd: Use libprocessgroup to unfreeze Cgroup v2 paths are owned by libprocessgroup. Those paths can change based on build flags, so paths generated outside of libprocessgroup may not always be correct. Bug: 382693152 Test: adb shell debuggerd -b Change-Id: I7e486ab6f4068d0fae1be033a91b9a307f54ed42 --- debuggerd/Android.bp | 1 + debuggerd/debuggerd.cpp | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/debuggerd/Android.bp b/debuggerd/Android.bp index 3257a2c50..0e62ceb8f 100644 --- a/debuggerd/Android.bp +++ b/debuggerd/Android.bp @@ -505,6 +505,7 @@ cc_binary { "libbase", "libdebuggerd_client", "liblog", + "libprocessgroup", "libprocinfo", ], diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp index 0d4b91f75..7a2500c60 100644 --- a/debuggerd/debuggerd.cpp +++ b/debuggerd/debuggerd.cpp @@ -23,11 +23,11 @@ #include #include -#include #include #include #include #include +#include #include #include "util.h" @@ -92,13 +92,8 @@ int main(int argc, char* argv[]) { } // unfreeze if pid is frozen. - const std::string freeze_file = android::base::StringPrintf( - "/sys/fs/cgroup/uid_%d/pid_%d/cgroup.freeze", proc_info.uid, proc_info.pid); - if (std::string freeze_status; - android::base::ReadFileToString(freeze_file, &freeze_status) && freeze_status[0] == '1') { - android::base::WriteStringToFile("0", freeze_file); - // we don't restore the frozen state as this is considered a benign change. - } + SetProcessProfiles(proc_info.uid, proc_info.pid, {"Unfrozen"}); + // we don't restore the frozen state as this is considered a benign change. unique_fd output_fd(fcntl(STDOUT_FILENO, F_DUPFD_CLOEXEC, 0)); if (output_fd.get() == -1) {