Commit graph

90255 commits

Author SHA1 Message Date
Maciej Żenczykowski
e60b760e74 start netd earlier
In this change we're moving the asynchronous netd startup ahead of
the async statd and *synchronous* update_verifier.

This is desirable as we want a netd failure (which could
happen due to some mainline incompatibility wrt. bpf
or mainline shipped shared libs: resolver or netd updatable)
to be considered a signal for a bad boot.

It's still asynchronous though, so it's not ideal.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib3e252f085f569864feddaf20ac80858a3bb969d
2024-09-23 21:15:01 +00:00
Shengsong Tan
752112003d Merge "Remove usage of base/string/* in libfs_avb" into main 2024-09-18 11:15:16 +00:00
Jerry Chang
2f84febec1 Merge "Add input event profile to mitigate input latency of input threads" into main 2024-09-18 10:36:32 +00:00
Jerry Chang
72b0186a38 Add input event profile to mitigate input latency of input threads
Bug: 347122505
Test: manual dump Perfetto

Change-Id: I224fa31a7358fcd32dfb1c3fa9dec35101e97163
2024-09-18 08:18:42 +00:00
Shengsong Tan
b5d9d909c5 Remove usage of base/string/* in libfs_avb
As part of the effort to uprev libchrome in Android, we are
removing Android dependencies to libchrome utility functions
that are not strictly required.

This CL remove the usage of base/string/* and replace by
android-base/string*

Bug: 360917504
Change-Id: I89e7bdd66bdf8f565f6b2084a70335616a644069
Test: atest libfs_avb_internal_test
2024-09-18 02:11:43 +00:00
Treehugger Robot
c8e38c0f64 Merge "Add getFdStateDebug to access Looper's callbacks" into main 2024-09-17 20:45:05 +00:00
Paul Ramirez
7d9c9af946 Add getFdStateDebug to access Looper's callbacks
Added getFdStateDebug to access Looper's internal state.

Flag: EXEMPT testing
Test: TEST=libutils_test; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST --gtest_filter="LooperTest.getFdStateDebug*"
Change-Id: I253ed4a6fa1040053117dcea3be80e55eef9a9b0
2024-09-17 17:40:11 +00:00
Shengsong Tan
e322d54337 Merge "Remove usage of base/logging.h in libfs_avb" into main 2024-09-17 11:14:50 +00:00
Treehugger Robot
007f95d721 Merge "libsnapshot: CHECK -> CHECK_EQ" into main 2024-09-16 21:04:49 +00:00
Steven Moreland
7b577cf43c libsnapshot: CHECK -> CHECK_EQ
This will print the values of the strings which are not equal
so that we can debug.

Bug: 366531882
Test: build, TH
Change-Id: I36a2b8d3fbda145e07cd8ccb01152a3a3adf21b0
2024-09-16 17:24:25 +00:00
Treehugger Robot
511a1733ec Merge "Define linker.config.json as a filegroup" into main 2024-09-13 03:25:02 +00:00
Christopher Ferris
bd66ab0a2b Merge "Remove unused variable." into main 2024-09-12 23:54:54 +00:00
Justin Yun
807ab25891 Define linker.config.json as a filegroup
The linker.config.json file is required for soong to generate a
system image.

Bug: 365670526
Test: lunch aosp_cf_x86_64_phone_soong_system-trunk_staging-userdebug
      && m
Change-Id: I86389e4143cd2fc08b812d50962bf7ec007894ab
2024-09-12 18:32:47 +09:00
Shengsong Tan
26d10f1584 Remove usage of base/logging.h in libfs_avb
As part of the effort to uprev libchrome in Android, we are
removing Android dependencies to libchrome utility functions
that are not strictly required.

This CL remove the usage of base/logging.h and replace by
android-base/logging.h

Bug: 360917504
Test: atest libfs_avb_internal_test

Change-Id: Ibcc476aebcff2fe5cfc2e3a3cd04168c02bc05f5
2024-09-12 06:44:20 +00:00
Elliott Hughes
354bd064a1 Merge "debuggerd: recognize jumps to non-executable memory." into main 2024-09-11 18:54:46 +00:00
Elliott Hughes
b17d7be2e5 debuggerd: recognize jumps to non-executable memory.
We have fairly fancy detection of stack pointer issues, but nothing for the program counter...

Bug: https://issuetracker.google.com/365602121
Change-Id: I7e7061a1b473089a0f31438df5ebc65b283475bc
2024-09-11 16:23:18 +00:00
Elliott Hughes
293b394508 Merge "Remind the reader that they'll need to modify CTS too." into main 2024-09-11 15:12:22 +00:00
Treehugger Robot
1024225b62 Merge "Rename system/core/rootdir/Android.mk to create_root_structure.mk" into main 2024-09-11 01:01:40 +00:00
Terry Guan
b9f6c12b4d Merge "init: add a swapoff built-in command" into main 2024-09-10 16:59:46 +00:00
Elliott Hughes
0bec59c496 Remind the reader that they'll need to modify CTS too.
Also duplicate the warning to the other set of updatable ids.

Bug: http://b/364993041
Change-Id: I128ddeb468c1f2f872772c9f2505a29f7537eb8a
2024-09-10 15:47:46 +00:00
Nelson Li
c1ad204f85 Rename system/core/rootdir/Android.mk to create_root_structure.mk
Since Soong currently doesn't support the `install_directory`
functionality, this file cannot be directly converted to Android.bp.
Moreover, the main content of `system/core/rootdir/Android.mk` is to
create directories and symlinks for the root file system. Therefore,
we'll first rename it and move it to build/core/main.mk for handling.

In addition, consolidate the handling of `meta-lic` related parts into
build/core/tasks/meta-lic.mk.

Bug: 353642907
Test: m -j init.environ.rc
Change-Id: I356c4b05c56b02b0243c12dbeddd4653ba4e137c
2024-09-10 06:50:19 +00:00
Armelle Laine
9ec007acf4 Merge "trusty: keymint/gatekeeper: Pass device name from init scripts" into main 2024-09-10 04:00:28 +00:00
Arve Hjønnevåg
ced57af116 trusty: keymint/gatekeeper: Pass device name from init scripts
If the ro.hardware.trusty_ipc_dev.gatekeeper (respectively .keymint) property is set, pass it as the device name to the gatekeeper (respectively keymint) HALs.

Test: "setprop ro.hardware.trusty_ipc_dev VSOCK:2048:1" and restart HALs
Change-Id: I0947e532ac70ce1821cec49897f21ca10e1af03e
2024-09-10 04:00:09 +00:00
Christopher Ferris
133fc74fa4 Remove unused variable.
Test: Builds with -Wunused-variable
Change-Id: Ibe6c28c8dd510303450f8400ba7d721fd5c44fc3
2024-09-09 19:59:06 +00:00
Treehugger Robot
e57d3f2110 Merge "trusty: Add host build for rpmb_dev" into main 2024-09-09 19:45:16 +00:00
Aditya Kumar
c908a97068 Merge "Fix type of android_thread_func typedef" into main 2024-09-09 17:55:50 +00:00
Xin Li
ef85e60f5a Merge "Merge 24Q3 to AOSP main" into main 2024-09-07 01:11:50 +00:00
Aditya Kumar
be2cc9f930 Fix type of android_thread_func typedef
Found the error with latest clang: https://android-build.corp.google.com/artifact/pending/P80448506/art-host-x86_64/latest/view/logs%2Fbuild_error.log

```
out/soong/.intermediates/system/core/libutils/libutils/linux_glibc_x86_64_static/obj/system/core/libutils/Threads.o system/core/libutils/Threads.cpp
system/core/libutils/Threads.cpp:149:21: error: cast from 'android_thread_func_t' (aka 'int (*)(void *)') to 'android_pthread_entry' (aka 'void *(*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
  149 |                     (android_pthread_entry)entryFunction, userData);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```

Change-Id: Ie2423a568483c975a36a1fa0b06a3f93a27be5aa
2024-09-06 15:33:08 -07:00
terryguan
4399754035 init: add a swapoff built-in command
Enables a method for swapping off certain block devices or files. This
will be used before hibernation occurs.

Bug: 339688542
Test: Manual, verified that calling swapoff from a init file swapsoff
location that is specified

Change-Id: I212a6f303a023c3e440b557caae82ad3904ac9c9
2024-09-06 08:49:04 -07:00
Treehugger Robot
06e832372a Merge "Reland Skip F2FS formatting for dev option enabled devices" into main 2024-09-06 06:01:03 +00:00
Treehugger Robot
536aa62490 Merge "snapshotctl: Check device for -img path" into main 2024-09-06 01:15:02 +00:00
Xin Li
c25884678a Merge 24Q3 to AOSP main
Bug: 357762254
Merged-In: I8458f223fc35fcfa042588e67a30c5bb273b0277
Change-Id: I2d2f964a53fdf9160d2897e81ea762b3a754def0
2024-09-05 17:03:07 -07:00
Tim Van Patten
18f03b6d55 Merge "Add AID for CrOS EC" into main am: e2a5fb23fe
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3222366

Change-Id: I78c9482f251f40b9bc9f057d0c24dc0c1421444a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-05 22:59:25 +00:00
Kelvin Zhang
dfca1f129e Reland Skip F2FS formatting for dev option enabled devices
F2FS does not support page_size!=block_size configuration, and
dev option devices need to toggle between 4K/16K mode, hence F2FS
requires a data wipe every time page size changes. This is inconveinent,
skip F2FS formatting instead.

The original CL had a bug where `iter->blk_device` is accessed before
checking if `iter` is out of bounds. Fixed by flipping order of two
conditions in an && operator.

Test: th
Bug: 353436188

This reverts commit 642a98e2a7.

Change-Id: I89551f219efc44bad29a190edff5412a5cc67840
2024-09-05 15:57:03 -07:00
Tim Van Patten
e2a5fb23fe Merge "Add AID for CrOS EC" into main 2024-09-05 22:55:25 +00:00
Akilesh Kailash
81c5e02b50 snapshotctl: Check device for -img path
If the device exists only on /data, then the image path should
be checked with -img.

Bug: 330744468
Test: snapshotctl apply-update
Change-Id: I64ff7d803fdaaa02d2d6929994ad1124bfffab8b
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-09-05 13:54:12 -07:00
Treehugger Robot
b699da6217 Merge "[km] Include non-secure KM HAL with Trusty VM in /system_ext" into main am: 5b6fbdea70
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3250843

Change-Id: I62cabeaca7826ae15525f1cf5247871699ea36d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-05 20:31:29 +00:00
Treehugger Robot
5b6fbdea70 Merge "[km] Include non-secure KM HAL with Trusty VM in /system_ext" into main 2024-09-05 20:19:43 +00:00
Treehugger Robot
473aa1de75 Merge "fs_mgr: Add support for MS_LAZYTIME." into main am: 33a742028e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3253877

Change-Id: I806ec7dd0d5454b050f730c61d66fdce21bf47d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-05 19:46:50 +00:00
Treehugger Robot
33a742028e Merge "fs_mgr: Add support for MS_LAZYTIME." into main 2024-09-05 19:32:47 +00:00
Ryan Prichard
5f3461e40a Merge "[fastboot+init] avoid std::allocator<const T>" into main am: 2deb758b9b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3256156

Change-Id: I737435e5948f9275d32ebb2296825a9fba6c3364
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-05 18:49:37 +00:00
Ryan Prichard
2deb758b9b Merge "[fastboot+init] avoid std::allocator<const T>" into main 2024-09-05 18:34:28 +00:00
Ryan Prichard
4f13b13aac [fastboot+init] avoid std::allocator<const T>
std::vector<const T> uses std::allocator<const T>, which is an
undocumented libc++ extension to the C++ standard library. The extension
was removed in llvm.org/PR96319. Use an ordinary non-const T instead.

Bug: http://b/349681543
Test: m fuzzy_fastboot CtsInitTestCases
Test: m MODULES-IN-system-core
Flag: EXEMPT, refactor to fix build failure
Change-Id: Ia98a2f090e87541fd35a89bd75bf9638bc7dc711
2024-09-04 17:45:14 -07:00
David Anderson
3217fa2158 fs_mgr: Add support for MS_LAZYTIME.
"lazytime" as a mount option was removed recently in favor of
MS_LAZYTIME.  This is causing mount failures when calling
IVold::commitChanges.

Bug: 329657783
Test: cuttlefish on android-mainline
Change-Id: Id01c1e5bbd0c82e07126be65f638e16600c058e3
2024-09-04 16:05:25 -07:00
Christopher Ferris
20e4d8acad Merge "Use fallback linker allocator in trace_handler." into main am: f62078fa17
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3243900

Change-Id: Ie901e17a08a6acd68b459e0ac5a2d756ddaca996
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 17:25:05 +00:00
Christopher Ferris
f62078fa17 Merge "Use fallback linker allocator in trace_handler." into main 2024-09-04 17:16:39 +00:00
Alice Wang
d694b61591 [km] Include non-secure KM HAL with Trusty VM in /system_ext
Bug: 355194622
Test: launch_cvd --noresume --console=true \
     --extra_kernel_cmdline='androidboot.selinux=permissive' \
     --secure_hals=guest_keymint_trusty_insecure
Change-Id: I1ecdca049cfd6d33caf98f95d1260083bed2c155
2024-09-04 09:29:00 +00:00
Christopher Ferris
469b62a334 Use fallback linker allocator in trace_handler.
There is more than one function that can allocate in the fallback
path. Therefore, make sure that all functions that can allocate have
switched to the fallback linker allocator before allocating. This
is mostly a problem for the trace_handler function call, which iterates
over all known threads and gets backtraces for them.

Add a ScopedUseFallbackAllocator class to do the switching to make it
easier to have the same code everywhere.

Add two tests to verify that no allocations are occuring during
a tombstone or backtrace on the fallback path. These tests are not
comprehensive since they can't verify that the linker allocator is
using the fallback allocator, but they are better than nothing.

Remove the debuggerd_fallback_tombstone() function since it only
enables the linker callback and then calls engrave_tombstone_ucontext().
The enabling is now done with the ScopedUseLinkerAllocator.

Restructure the case where sending the signal to a thread fails so
that the fallback allocator can be enabled properly.

Bug: 359692763

Test: Ran debuggerd -b <PID> and debuggerd <PID> on a process that
Test: goes throught the fallback path.
Test: Unit tests pass along with two new tests.
Test: Forced a fallback process to crash and verified tombstone generated.
Test: Instrumented the linker allocator and verified that the trace_handler
Test: function never calls the normal linker allocator as it runs.
Change-Id: I2710921076634eac97f41bec8c3a29c1d75ae5ec
2024-09-04 01:13:04 +00:00
Steven Moreland
8ace884a6d Merge "Remove NDK exports" into main am: a852b4ff8e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3253755

Change-Id: I5531137b486a8ac8d5f61660b62c295c610c1b4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 00:49:24 +00:00
Steven Moreland
a852b4ff8e Merge "Remove NDK exports" into main 2024-09-04 00:13:46 +00:00