Commit graph

80977 commits

Author SHA1 Message Date
Daniel Zheng
233a5a162d Merge "Added forward declaration for compilation" 2023-04-19 21:13:35 +00:00
Daniel Zheng
7d67d569f3 Merge "Pointed FlashingPlan to Interface" 2023-04-19 21:13:25 +00:00
Daniel Zheng
3ac1e55e1e Merge "Adding fastboot_driver interface + mock" 2023-04-19 21:12:59 +00:00
Daniel Zheng
39b1de953f Merge "Moving FlashallTool Definition" 2023-04-19 21:12:37 +00:00
Daniel Zheng
b7d14facd2 Merge "Changing flashall to parse fastboot-info.txt" 2023-04-19 21:12:29 +00:00
Daniel Zheng
efca333730 Added forward declaration for compilation
Test: tested compilation
Change-Id: I7165e323574ef8f3f90d1540c4a2b6a991803b40
2023-04-19 12:30:38 -07:00
Daniel Zheng
bf09c61d95 Pointed FlashingPlan to Interface
Using interface for testing purposes

Bug: 194686221
Test: tested compilation
Change-Id: Ia9465c1f5673c249cdbc08a1a2432e8a603bd9cc
2023-04-19 12:30:38 -07:00
Daniel Zheng
c9e869bd9e Adding fastboot_driver interface + mock
Adding mock fastboot_driver to be used for testing

Test: tested fastboot_test
Bug: 194686221
Change-Id: I6948310d44b75c0f389cbfd194747649aaccb0b8
2023-04-19 12:30:38 -07:00
Daniel Zheng
65eb246aa2 Moving FlashallTool Definition
moved flashalltool definition to header file

Test: flashall on raven
Bug: 194686221
Change-Id: I5f726492ee5b3ae42755214e3de0269257b62ba8
2023-04-19 12:30:38 -07:00
Daniel Zheng
29a211c194 Changing flashall to parse fastboot-info.txt
Test: tested on Raven
Change-Id: I9f26bf6025a0a6318f84be929091f4e82bd87556
2023-04-19 12:30:37 -07:00
Daniel Zheng
37673f0bf5 Merge "Fixing circular dependency" 2023-04-19 00:16:13 +00:00
Maciej Żenczykowski
02a6d74b65 Merge "fix clatd permissions try 3 - this time for GSI" 2023-04-18 23:21:28 +00:00
Maciej Żenczykowski
93c9dfcd33 fix clatd permissions try 3 - this time for GSI
where stuff is apparently under /system_ext/apex/...
instead of /system/apex/...

Bug: 277646103
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I947e44af334628d82ca633546f3328319c2bac60
2023-04-18 21:09:14 +00:00
Daniel Zheng
729c159744 Merge "Moving logging include" 2023-04-18 16:26:01 +00:00
Daniel Zheng
0897526557 Fixing circular dependency
Test: tested compilation
Change-Id: Iae25cade1efb2372e5fc219fa69cbb2381b4e05c
2023-04-17 11:34:00 -07:00
Daniel Zheng
7627b54910 Moving logging include
Header file shouldn't have include of logging

Test: tested compilation
Change-Id: I02cccb66b6ee5811e5d4f2b9b72508fee640e828
2023-04-17 09:42:39 -07:00
Florian Mayer
bbcad5b6dd Merge "Expose hwasan runtime to Java apps" 2023-04-14 23:27:56 +00:00
David Anderson
657960396c Merge "snapuserd: Remove legacy xor code." 2023-04-14 23:03:39 +00:00
David Anderson
2812fd841e Merge "libsnapshot: Remove various unused components." 2023-04-14 22:42:42 +00:00
Steven Moreland
f0578771ea Merge "Explicit init .rc user." 2023-04-14 21:43:38 +00:00
Steven Moreland
2fccf5ead3 Explicit init .rc user.
Set the user explicitly.

For boringssl self-test, changed to 'nobody' since
this test doesn't require permissions.

Bug: 276813155
Test: boot, check can 'nobody' can still write to kmesg.
Change-Id: I32f7134e83183bd054bffbb22d412d7a2dc0ad09
2023-04-14 21:43:25 +00:00
David Anderson
3933cbeba0 libsnapshot: Remove various unused components.
PowerTest is no longer relevant with snapuserd, and was not particularly
good at rooting out dm issues anyway.

make_cow_from_ab_ota and estimate_cow_from_nonab_ota are no longer
relevant as they were mainly for estimation during VABC prototyping.

The update_metadata proto was part of the fuzzer which has since been
removed.

Bug: N/A
Test: th builds
Change-Id: Ie341e360f1824ea16794c4625817cfc8f8b8644b
2023-04-14 13:39:14 -07:00
Colin Cross
d5fc9eae52 Merge "Use android::base::Basename instead of basename" 2023-04-14 17:26:30 +00:00
David Anderson
c2f3d686e9 Merge "libsnapshot: Don't run legacy tests in VTS." 2023-04-14 15:31:31 +00:00
Colin Cross
d459ccd14e Use android::base::Basename instead of basename
basename can have different behavior based on whether the glibc
or posix version is used, and musl doens't provide the glibc version
at all.  Avoid the problem by using the one in libbase instead.

Test: m USE_HOST_MUSL=true host-native -k
Change-Id: If17c7622ed9b9cffc218567a46afb059b608d3c9
2023-04-13 21:59:58 -07:00
David Anderson
ff92fdb6d3 libsnapshot: Don't run legacy tests in VTS.
Bug: 276035159
Test: builds
Change-Id: I19bca32f636da867445c8b668d3a38ccba5c50f4
2023-04-13 16:39:02 -07:00
Treehugger Robot
04a44c1c5d Merge "libprocessgroup: Add sendSignalToProcessGroup" 2023-04-13 23:11:01 +00:00
Treehugger Robot
b083eb3611 Merge "Revert "Revert "libprocessgroup: Add support for SetUserProfiles""" 2023-04-13 23:00:21 +00:00
T.J. Mercier
5ed5e1bb9f Revert "Revert "libprocessgroup: Add support for SetUserProfiles""
This reverts commit aee11b0a3d.

This change was originally reverted because its only user was reverted
under b/243096961 at ag/19679188. We bring it back now with a fixed user.

Bug: 236708592
Bug: 148425913
Ignore-AOSP-First: Topic with AMS changes which is developed on git_master

Change-Id: I2a8ae0d9faabe7950b758a09870d128889be4d0a
Merged-In: I2a8ae0d9faabe7950b758a09870d128889be4d0a
2023-04-13 22:05:31 +00:00
T.J. Mercier
22006bf004 libprocessgroup: Add sendSignalToProcessGroup
Add a function which sends signals to all members of a process group,
but does not wait for the processes to exit, or for the associated
cgroup to be removed.

Bug: 274646058
Ignore-AOSP-First: Dependency of ActivityManager change which developed on interal git_master
Test: Force-stop of chrome with 15 tabs completes ~500ms faster
Test: Full Play store update causes no ANR
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d87b6018d25cbbd33b345dc58c634718bf5d0def)
Merged-In: I37dbdecb3394101abbee8495e71f6912b3c031f5
Change-Id: I37dbdecb3394101abbee8495e71f6912b3c031f5

NOTE FOR REVIEWERS - original patch and result patch are not identical.
PLEASE REVIEW CAREFULLY.
Diffs between the patches:
37,6 +537,15 @@
     return KillProcessGroup(uid, initialPid, signal, 0 /*retries*/, max_processes);
 }
 
+int sendSignalToProcessGroup(uid_t uid, int initialPid, int signal) {
+    std::string hierarchy_root_path;
+    if (CgroupsAvailable()) {
+        CgroupGetControllerPath(CGROUPV2_CONTROLLER_NAME, &hierarchy_root_path);
+    }
+    const char* cgroup = hierarchy_root_path.c_str();
+    return DoKillProcessGroupOnce(cgroup, uid, initialPid, signal);
+}
+
 static int createProcessGroupInternal(uid_t uid, int initialPid, std::string cgroup,
                                       bool activate_controllers) {
     auto uid_path = ConvertUidToPath(cgroup.c_str(), uid);

Original patch:
From d87b6018d2 Mon Sep 17 00:00:00 2001
From: T.J. Mercier <tjmercier@google.com>
Date: Tue, 04 Apr 2023 18:41:13 +0000
Subject: [PATCH] libprocessgroup: Add sendSignalToProcessGroup

Add a function which sends signals to all members of a process group,
but does not wait for the processes to exit, or for the associated
cgroup to be removed.

Bug: 274646058
Ignore-AOSP-First: Dependency of ActivityManager change which developed on interal git_master
Test: Force-stop of chrome with 15 tabs completes ~500ms faster
Test: Full Play store update causes no ANR
Change-Id: I37dbdecb3394101abbee8495e71f6912b3c031f5
---

diff --git a/libprocessgroup/include/processgroup/processgroup.h b/libprocessgroup/include/processgroup/processgroup.h
index 8fa9fd5..48bc0b7 100644
--- a/libprocessgroup/include/processgroup/processgroup.h
+++ b/libprocessgroup/include/processgroup/processgroup.h
@@ -76,6 +76,11 @@
 // that it only returns 0 in the case that the cgroup exists and it contains no processes.
 int killProcessGroupOnce(uid_t uid, int initialPid, int signal, int* max_processes = nullptr);
 
+// Sends the provided signal to all members of a process group, but does not wait for processes to
+// exit, or for the cgroup to be removed. Callers should also ensure that killProcessGroup is called
+// later to ensure the cgroup is fully removed, otherwise system resources may leak.
+int sendSignalToProcessGroup(uid_t uid, int initialPid, int signal);
+
 int createProcessGroup(uid_t uid, int initialPid, bool memControl = false);
 
 // Set various properties of a process group. For these functions to work, the process group must

Change-Id: Ie479348dee8e8092b1959927a1143009632d3914
2023-04-13 21:48:55 +00:00
Daniel Zheng
0a785083bb Merge "Cleaning up main code" 2023-04-13 20:44:31 +00:00
Yifan Hong
203d8316c6 Merge "remove healthd.rc" 2023-04-13 19:37:54 +00:00
David Anderson
07f6f239ee Merge "RESTRICT AUTOMERGE: snapuserd: Run snapuserd threads in-process." 2023-04-13 17:55:40 +00:00
David Anderson
daae43c95a Merge "snapuserd_daemon: Modify incorrect print information" 2023-04-13 16:49:41 +00:00
mingzhu.wang
44d88ca703 snapuserd_daemon: Modify incorrect print information
StartServerForUserspaceSnapshots function, if the child resulting from
the separation parameter number is not equal to 4, will be print
Malformed message: expected four sub-arguments, but at present there is
print three

Change-Id: Idc240714a65bc3eeb1e2b9958354de98ca4b329e
2023-04-13 17:55:47 +08:00
David Anderson
82c43e8b92 Merge "dmctl: add repalce command to usage list" 2023-04-13 03:15:23 +00:00
Steven Moreland
165e086a1a remove healthd.rc
no longer used

Bug: 276813155
Test: N/A
Change-Id: Iae206540b07b61fa799ce6fcce4032879f02d8b3
2023-04-12 23:00:09 +00:00
Treehugger Robot
253f33aac5 Merge "libprocessgroup: fix task_profile_test to correctly detect cgroup v2" 2023-04-12 22:20:20 +00:00
Suren Baghdasaryan
d09713fe40 libprocessgroup: fix task_profile_test to correctly detect cgroup v2
Use correct attribute of the mntent to check for cgroup v2 entry.

Bug: 277233783
Change-Id: Ie34b89b610117b8ce043f2f18947273d75618fef
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-04-12 21:07:50 +00:00
Treehugger Robot
6c0ff3bdd0 Merge "flattened apex: fix clatd mode also for inprocess tethering" 2023-04-12 19:21:44 +00:00
Satoshi Niwa
d385506465 flattened apex: fix clatd mode also for inprocess tethering
This is a follow-on CL for aosp/2528043

/system/apex/com.android.tethering.inprocess/bin/for-system/clatd
is bind mounted as /apex/com.android.tethering/bin/for-system/clatd
when using inprocess tethering.

Bug: 273821347
Test: `ls -l /apex/com.android.tethering/bin/for-system/clatd` on bertha
Test: Also see aosp/2528043 for how it is tested
Change-Id: Ia20165663e4ff6d9266fe601d25395816792a3f7
2023-04-12 14:35:31 +09:00
Treehugger Robot
db01225c70 Merge "flattened apex: fix /apex/com.android.tethering/bin/for-system{,/clatd} mode" 2023-04-11 15:58:45 +00:00
Maciej Żenczykowski
1ba94402f2 flattened apex: fix /apex/com.android.tethering/bin/for-system{,/clatd} mode
from packages/modules/Connectivity/Tethering/apex/canned_fs_config
   /bin/for-system 0 1000 0750
   /bin/for-system/clatd 1029 1029 06755
the Tethering apex mounts at /apex/com.android.tethering,
but that's a bind mount, it really lives at /system/...
in the flattened fs image.

Testing via:

aosp$ export OVERRIDE_TARGET_FLATTEN_APEX=true
aosp$ a_make_target aosp_cf_x86_phone-userdebug

$ sudo mkdir /mnt/point && sudo mount -o loop,ro /aosp/out/target/product/vsoc_x86/system.img /mnt/point && egrep /mnt/point /proc/mounts && sudo ls -dlnZ /mnt/point/system/apex/com.android.tethering/bin/for-system{,/clatd} && sudo umount /mnt/point && sudo rmdir /mnt/point

/dev/loop0 /mnt/point erofs ro,relatime,user_xattr,acl,cache_strategy=readaround 0 0

drwxr-x---. 2 0 1000 u:object_r:system_file:s0 44 Apr 11 03:12 /mnt/point/system/apex/com.android.tethering/bin/for-system
-rwsr-sr-x. 1 1029 1029 u:object_r:clatd_exec:s0 18876 Apr 11 03:12 /mnt/point/system/apex/com.android.tethering/bin/for-system/clatd

while without this patch it showed:

drwxr-x--x. 2 0 2000 u:object_r:system_file:s0 44 Apr 11 01:53 /mnt/point/system/apex/com.android.tethering/bin/for-system
-rwxr-xr-x. 1 0 2000 u:object_r:clatd_exec:s0 18876 Apr 11 01:53 /mnt/point/system/apex/com.android.tethering/bin/for-system/clatd

Test: TreeHugger
Bug: 273821347
Bug: 277646103
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9714b1e935afbe27c2eb4be3f96a9742eb752e92
2023-04-11 10:29:16 +00:00
Daniel Rosenberg
76607e5b07 Merge "Require root for StartConsole Test" 2023-04-11 01:14:17 +00:00
Florian Mayer
152de539df Merge "Print number of frames" 2023-04-10 20:59:18 +00:00
Daniel Zheng
83800601f6 Merge "Adding const to task constructors" 2023-04-10 19:44:31 +00:00
Daniel Zheng
23631b9be7 Merge "Cleaned up slot logic" 2023-04-10 18:02:05 +00:00
Daniel Zheng
dddb5fa80b Merge "Correcting Reboot Task Functionality" 2023-04-10 17:46:03 +00:00
Daniel Zheng
e6dbd4f194 Adding const to task constructors
Adding const decorator to class constructor to ensure Flashing Plan
isn't modified during task construction

Bug: 194686221
Test: tested Flashall on raven
Change-Id: I99b71b2b756beaf871a31a1a035545d754d128e8
2023-04-10 09:53:08 -07:00
Daniel Zheng
1e6456b011 Cleaned up slot logic
Updating old clean up slot logic change. Some devices don't know current
slot so we can't always just call get_current_slot()

Test: tested flashall on raven
Change-Id: Id655f1c1ee0b1ff09331f0d91d77412836d0af8d
2023-04-10 09:35:48 -07:00