Commit graph

82074 commits

Author SHA1 Message Date
Snehal Koukuntla
be0539819c Merge "Change name to trusty-coverage-controller" into main am: 7cc9edd55c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2705253

Change-Id: Ib6fe43f4f69d7148443c28d1b4ffe34b9d716b87
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-16 09:45:22 +00:00
Snehal Koukuntla
7cc9edd55c Merge "Change name to trusty-coverage-controller" into main 2023-08-16 09:15:09 +00:00
Snehal
b702fddd2e Change name to trusty-coverage-controller
Test: builds and passes tests

Bug: None

Change-Id: I89eec23312f79f4da43c491ce58aa4f246c7ab34
2023-08-16 09:14:32 +00:00
Treehugger Robot
1f56fb43cf Merge "Update OWNERS." into main am: c70a336e60
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2710977

Change-Id: I20bad4aeed4670cfa33d8a82b1c3f1a15871359a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-15 23:16:52 +00:00
Treehugger Robot
c70a336e60 Merge "Update OWNERS." into main 2023-08-15 22:18:35 +00:00
David Anderson
8d9940bdaf Update OWNERS.
Change-Id: Ib069b181fd48d73e5320f44c435b8814f269d291
2023-08-15 15:14:01 -07:00
Daniel Zheng
5efbf813f3 Merge changes I3feede9f,I9194e2c6 into main am: 74295d4f10
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2700798

Change-Id: I4898de58e42dcd6c71233d23accb42d66f81c619
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-15 17:06:54 +00:00
Treehugger Robot
149b82eabb Merge "Add mikemcternan@ to OWNERS" into main am: 49dc9d1233
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2692687

Change-Id: I9e44d71bf0780986ae6e1befa21f4efcf3f1bdfe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-15 17:06:05 +00:00
Daniel Zheng
74295d4f10 Merge changes I3feede9f,I9194e2c6 into main
* changes:
  Optimize zstd compression
  Adding compressor class
2023-08-15 16:33:31 +00:00
Treehugger Robot
49dc9d1233 Merge "Add mikemcternan@ to OWNERS" into main 2023-08-15 16:21:57 +00:00
Daniel Zheng
03acfdbeb6 Optimize zstd compression
reuse the same context for zstd compression. One context should be used
per compression thread for optimal performance. Discussion and
reccomendations can be found at go/android-hw-compression-vendor

Results (level 3 compression)
full ota on raven with optimizations:  1191.304 seconds
without optimizations:  1461.854 seconds

compression ratio remains unchanged and merge time difference are
negligible ~1% delta (probably just noise)

Test: ota_from_target_files, update_device.py
Change-Id: I3feede9f1f119874e369c54b29c594475fbf7376
2023-08-14 16:07:33 -07:00
Daniel Zheng
de6e446efa Adding compressor class
Adding in compressor class to clean up code for cow_compress.cpp.
Since we are making some api changes (to zstd) that are unique to each
compression methods, these should be implementation details should be
hidden to the parent class

Test: m libsnapshot

Change-Id: I9194e2c615aefed078458f525382253228bc1b69
2023-08-14 16:07:26 -07:00
Eric Biggers
5236858bf8 Merge "Avoid two SELinux related error messages at boot time" into main am: 87d6c8a1d5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2705761

Change-Id: Idf86e98032d8f8a759ecab79e8da163d4bc52f56
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-14 18:18:13 +00:00
Eric Biggers
87d6c8a1d5 Merge "Avoid two SELinux related error messages at boot time" into main 2023-08-14 17:33:15 +00:00
Jooyung Han
00144f0aa2 Merge "Dedup apex-scanning" into main am: 5a2d8514de
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2705093

Change-Id: I508457d960904d641d1dd5e356a75d01da34ee9d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-14 09:17:20 +00:00
Jooyung Han
5a2d8514de Merge "Dedup apex-scanning" into main 2023-08-14 08:48:17 +00:00
Tomasz Wasilczyk
7b79178348 Merge "Migrate String8/16 from .string() to c_str()" into main am: 6bfa6a0231
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2703570

Change-Id: I18160135a4dd29528e7723553054d17586b74e01
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-11 23:33:13 +00:00
Tomasz Wasilczyk
6bfa6a0231 Merge "Migrate String8/16 from .string() to c_str()" into main 2023-08-11 22:56:43 +00:00
Tomasz Wasilczyk
31d682b379 Merge "Add String16::c_str and start using it." into main am: 067dbcc110
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2704555

Change-Id: I5e9a0c633b67038cedbe2144f5f0c479c8de9e0b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-11 22:27:14 +00:00
Tomasz Wasilczyk
067dbcc110 Merge "Add String16::c_str and start using it." into main 2023-08-11 21:39:31 +00:00
Eric Biggers
141c6a886c Avoid two SELinux related error messages at boot time
It is expected that /metadata/ota/rollback-indicator and /metadata/gsi
don't always exist, so don't call selinux_android_restorecon() on them
when they don't exist.  This eliminates the following error messages:

0     0 E selinux : SELinux: Could not get canonical path for /metadata/ota/rollback-indicator restorecon: No such file or directory.
0     0 E selinux : SELinux:  Could not stat /metadata/gsi: No such file or directory.

Test: Booted Cuttlefish and verified the error messages are gone
Change-Id: I94c998556c85adde5f11f134178219ba7880c2be
2023-08-11 21:12:16 +00:00
Tomasz Wasilczyk
18b746188c Migrate String8/16 from .string() to c_str()
This will align usage with std::string.

Bug: 295394788
Test: make checkbuild
Change-Id: Ic5c215b011197950dcbcb0339f44cc68fefc65a1
2023-08-11 19:53:20 +00:00
Wei Li
e2ceb9e168 Merge "Track root directory symlinks created by LOCAL_POST_INSTALL_CMD in ALL_ROOTDIR_SYMLINKS and add them to ALL_DEFAULT_INSTALLED_MODULES, so they can be included in product SBOMs properly." into main am: 55aed3f908
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2704873

Change-Id: I58e4a1de02483a05d17e67f5ea86c9f438374132
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-11 19:44:56 +00:00
Tomasz Wasilczyk
90af4157c5 Add String16::c_str and start using it.
This is for parity with String8::c_str and in general the first step
in transition from String8|16.string() - to make it more similar to
std::string.

Bug: 295394788
Test: mma -j
Change-Id: I6c1411bef07c761fb2fb3fb38c27801ac4cffc57
2023-08-11 19:40:34 +00:00
Wei Li
55aed3f908 Merge "Track root directory symlinks created by LOCAL_POST_INSTALL_CMD in ALL_ROOTDIR_SYMLINKS and add them to ALL_DEFAULT_INSTALLED_MODULES, so they can be included in product SBOMs properly." into main 2023-08-11 18:38:12 +00:00
David Drysdale
2d04aaf068 Merge "KeyMint HAL: process destroyAttestationIds" into main am: 2f6bd6fa43
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2700896

Change-Id: Ibc14dd77cf1779ccec9d0307118cc158de90c059
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-11 10:09:48 +00:00
David Drysdale
2f6bd6fa43 Merge "KeyMint HAL: process destroyAttestationIds" into main 2023-08-11 09:26:12 +00:00
Treehugger Robot
35f325002c Merge changes from topic "read-bootstrap-apex" into main am: 236dbc30fc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2702894

Change-Id: Idfcc5e774412109fbfc02f0eb5d1327541238bb4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-11 05:18:46 +00:00
Jooyung Han
2982f09d57 Dedup apex-scanning
create_apex_data_dirs() now uses GetApexListFrom(dir) in
apex_init_util.cpp.

This is essentially a refactoring, but there are a few behavioral
changes, which I think make more sense.
- Emits no error when opendir(/apex) fails.
- Emits errors when mkdir fails for each apex.
- Does not abort `perform_apex_config` even though create_apex_data_dirs
  fails.

Bug: 293546778
Test: check /data/misc/apexdata/ after boot
Change-Id: I9d1a9710a6a626eec087c8c0fb1768667ffb036e
2023-08-11 14:14:37 +09:00
Treehugger Robot
236dbc30fc Merge changes from topic "read-bootstrap-apex" into main
* changes:
  Skip bootstrap APEX RC files for the second round
  Read .rc files from bootstrap apexes
2023-08-11 04:48:28 +00:00
Wei Li
d8a270698d Track root directory symlinks created by LOCAL_POST_INSTALL_CMD in
ALL_ROOTDIR_SYMLINKS and add them to ALL_DEFAULT_INSTALLED_MODULES,
so they can be included in product SBOMs properly.

Bug: 272358980
Test: CIs and build/soong/tests/sbom_test.sh
Change-Id: I73dfb34156d681786c013912e59a0d0c0c48ecc7
2023-08-10 18:18:36 -07:00
Jooyung Han
55ef3d6104 Skip bootstrap APEX RC files for the second round
Reading .rc files from bootstrap APEXes causes "double loading".
This works for services because init just ignores duplicates. But it
emits error logs, which can mislead even though there's no actual
errors. Besides, for actions, duplicates can cause a problem when
commands are not idempotent.

So, when loading RC files from APEXes for the second time, we'd better
skip those bootstrap APEXes.

Bug: 290148081
Test: VendorApexHostTestCases
Change-Id: Ia630dbd14046064b5e5c612c01ebacf57091c8d4
2023-08-11 10:02:08 +09:00
Christopher Ferris
ffd2acb324 Merge "Fix potential miscellaneous debuggerd issues." into main am: 9f32fba6d3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2681535

Change-Id: I945ed8fa2539d5992926f4da1a2c55986c5b422c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-10 20:38:57 +00:00
Christopher Ferris
9f32fba6d3 Merge "Fix potential miscellaneous debuggerd issues." into main 2023-08-10 19:53:19 +00:00
Treehugger Robot
8ef208f7a1 Merge "libsnapshot: Check for valid snapshots based on current slot" into main am: acdc4848e0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2701654

Change-Id: Ia9abf433765b28a9f590f01c2fbf3d1be9f3a696
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-10 18:21:10 +00:00
Treehugger Robot
acdc4848e0 Merge "libsnapshot: Check for valid snapshots based on current slot" into main 2023-08-10 17:29:46 +00:00
Akilesh Kailash
3983f9aa6e libsnapshot: Check for valid snapshots based on current slot
We may have snapshot files in /metadata/ota/snapshot/ which ends with
.tmp such as system_a.tmp - This happens if the device
reboots just before `rename` in `WriteStringToFileAtomic`. This
can lead to spurious merge failures.

Log the error and skip these snapshot files. It is ok to skip
as we will still have original snapshot status files since
we are already in the merge path. Additionally, try to remove
these files when snapshot is deleted.

Bug: 292198189
Test: OTA
Change-Id: I5db3dbd5a919b263ae577185de3e7f79a5e9b89a
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-08-10 09:36:35 -07:00
Jooyung Han
5c4217cf6e Read .rc files from bootstrap apexes
To start an early_hal service from a bootstrap vendor apex, init now
reads .rc files from bootstrap apexes as well.

In this change, perform_apex_config command is re-purposed to support
bootstrap mode. Now we have some similarity between two apexd calls:

- for bootstrap apexes (in the bootstrap mount namespace):

  exec_start apexd-bootstrap
  perform_apex_config --bootstrap

- for normal apexes (in the default mount namespace):

  restart apexd
  ...
  wait_for_prop apexd.status activated
  perform_apex_config

Note that some tasks in perform_apex_config are not needed in the
bootstrap.  For example, we don't need to create apexdata directories
for bootstrap apexes.

Bug: 290148081
Test: VendorApexHostTestCases
Change-Id: I8f683a4dcd7cd9a2466a4b1b417d84c025c37761
2023-08-10 15:40:06 +09:00
Treehugger Robot
26af0ec2d7 Merge "Remove gettid symbol from cutils" into main am: 0c0dafae8d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2681176

Change-Id: I4c44ab32cf585e89e06a2d343317a721cf0a63de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-10 05:01:51 +00:00
Treehugger Robot
0c0dafae8d Merge "Remove gettid symbol from cutils" into main 2023-08-10 04:13:24 +00:00
Jooyung Han
ef8229fb0b Merge "Use /bootstrap-apex for bootstrap APEXes" into main am: 370ee1bbda
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2700774

Change-Id: I98404432e5d8a6d355388728200133e84a469ebb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-10 03:11:15 +00:00
Jooyung Han
370ee1bbda Merge "Use /bootstrap-apex for bootstrap APEXes" into main 2023-08-10 02:38:30 +00:00
Christopher Ferris
3a0833c9cd Fix potential miscellaneous debuggerd issues.
Check for the log opening failing.

Add the ability to put error messages in the log and tombstone so
that it's clear if the log reading failed in some way.

Adjust test so that if there is a log or if no log exists, the test
will still pass.

Print an <unknown> if the command line is unreadable instead of nothing.

Test: Ran unit tests.
Test: Induced error and verified error message is save in tombstone.
Change-Id: I2fce8078573b40b9fed3cd453235f3824cadb5e3
2023-08-09 17:31:55 -07:00
Treehugger Robot
611837f4f3 Merge "debuggerd: fix passing of fdsan_table to crash_dump" into main am: cf32fd18d4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2701913

Change-Id: Ieb0fb13cc1a8519497595dc24517bd9ca5adbaff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-09 23:46:19 +00:00
Treehugger Robot
cf32fd18d4 Merge "debuggerd: fix passing of fdsan_table to crash_dump" into main 2023-08-09 23:15:06 +00:00
Tomislav Novak
24a7df5d38 debuggerd: fix passing of fdsan_table to crash_dump
Commit aosp/1259140 moved fdsan_table into debugger_process_info, which
is populated conditionally. This introduced a bug where the process that
receives BIONIC_SIGNAL_DEBUGGER (35) does not propagate the fdsan_table
pointer to crash_dump:

  $ adb shell kill -SIG35 <pid>
  $ adb logcat -s DEBUG
  E DEBUG   : failed to read fdsan table entry 0: I/O error

Fdsan in warn-only mode uses BIONIC_SIGNAL_DEBUGGER[1], so the generated
tombstones don't have any fd ownership info.

Fix it by calling get_process_info() irrespective of the signal being
handled, taking care to preserve the previous behavior of not showing
abort messages set by applications in non-fatal dumps.

Test: debuggerd_test
Test: send SIG35 to arbitrary process and inspect the log and tombstone
Test: crasher fdsan_file

[1] 20ad9129e7/libc/bionic/fdsan.cpp (166)

Change-Id: I76931ca4825e846fc99f26fa590c045130abb850
2023-08-09 15:19:51 -07:00
Keith Mok
c5e5e488b8 Merge "Adding force_flash functionality" into main am: eb2165079a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2700958

Change-Id: I1835f087e3724654806c0ac0cbe6ee6d005177dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-09 20:51:43 +00:00
Daniel Zheng
76a163f279 Merge "decompressor maintenence" into main am: 86f037c245
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2699453

Change-Id: Id59be4eb265d33cf66ea756031e2b50eddd99ac2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-09 20:50:58 +00:00
Daniel Zheng
0789550612 Merge "Moving includes" into main am: dc3c5292c7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2697600

Change-Id: I8dcb1f2f357fb9c708abb64e799e72d20e2dfc66
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-09 20:49:40 +00:00
Keith Mok
eb2165079a Merge "Adding force_flash functionality" into main 2023-08-09 20:45:24 +00:00