Commit graph

82043 commits

Author SHA1 Message Date
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
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
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
Daniel Zheng
50cc4a61c4 Merge "libsnapshot: take in compression_level" into main am: 73846d68cf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2692962

Change-Id: I9fe1f805dd5c380a5f647a5ed2e2e632cf6a0f3c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-09 20:28:16 +00:00
Daniel Zheng
86f037c245 Merge "decompressor maintenence" into main 2023-08-09 20:04:07 +00:00
Daniel Zheng
dc3c5292c7 Merge "Moving includes" into main 2023-08-09 20:04:00 +00:00
Daniel Zheng
73846d68cf Merge "libsnapshot: take in compression_level" into main 2023-08-09 20:03:44 +00:00
Daniel Zheng
727f70145a Merge "Adding flag to flash only static partitions" into main am: 720007ba43
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2662999

Change-Id: Ic5d28eb01ab6fa311d264eb3b354ebe56e404454
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-09 18:55:37 +00:00
Daniel Zheng
720007ba43 Merge "Adding flag to flash only static partitions" into main 2023-08-09 18:09:00 +00:00
Daniel Zheng
376b70423d Adding force_flash functionality
aosp/2452605 might've accidentally omitted force flash functionality
from fastboot. Some users need to flash dynamic partitions from
bootloader, so we are readding this feature back into fastboot

Test: adb reboot bootloader, fastboot flash system --force

Change-Id: I37a51ebbe38b27ed428c38068d30c0febd7db09c
2023-08-09 10:54:14 -07:00
Treehugger Robot
bf51390ab1 Merge "Remove sub-includes from libcutils/threads.h" into main am: a981d58972
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2675702

Change-Id: I68ba5ace85f7c0a6a6232ece57364049d194f7a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-09 17:26:56 +00:00
Treehugger Robot
a981d58972 Merge "Remove sub-includes from libcutils/threads.h" into main 2023-08-09 16:43:32 +00:00
Jooyung Han
566c65239f Use /bootstrap-apex for bootstrap APEXes
This new directory is bind-mounted to /apex in the bootstrap mount
namespace so that apexd-bootstrap mounts bootstrap APEXes there via
/apex.

The directory is shared between two mount namespaces, hence visible
in the default mount namespace.

Bug: 290148078
Test: VendorApexHostTestCases
Change-Id: I841480e41be8def5a4c6a4aa874c4e21465a71d3
2023-08-09 17:27:39 +09:00
Treehugger Robot
95503ac488 Merge "snapuserd: Remove host_supported from snapuserd_test until it passes." into main am: 790c6315c3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2699873

Change-Id: I31c54e1ad824d81b262577a3594745c228072211
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-09 01:19:17 +00:00
Treehugger Robot
790c6315c3 Merge "snapuserd: Remove host_supported from snapuserd_test until it passes." into main 2023-08-09 00:44:39 +00:00
Treehugger Robot
095a784d07 Merge "crasher: add pac and bti crashes." into main am: 8f5fab42df
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2699774

Change-Id: I12b812799837ded94cb4ab7795047680927072ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-08 23:50:24 +00:00
Daniel Zheng
1f0b04a3d8 Merge "Adding struct to hold compresion parameters" into main am: 5061a1cef8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2697599

Change-Id: Ia38cfb1edaba1c8108b50da9aa2f9a15956abc34
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-08 23:49:59 +00:00
Treehugger Robot
8f5fab42df Merge "crasher: add pac and bti crashes." into main 2023-08-08 23:47:21 +00:00
David Anderson
8665b5f9df snapuserd: Remove host_supported from snapuserd_test until it passes.
Bug: 295074841
Test: snapuserd_test
Change-Id: Ie51263ec6971f9806bcfa2b522e5ed24da5d65cf
2023-08-08 16:34:19 -07:00
Daniel Zheng
5061a1cef8 Merge "Adding struct to hold compresion parameters" into main 2023-08-08 23:08:03 +00:00
Elliott Hughes
1b13b14758 crasher: add pac and bti crashes.
Also add the missing `.size` directives to all the assembler functions
for slightly improved backtraces.

Test: crasher64 pac; crasher64 bti
Change-Id: I8e0c127cbff56c33637e6ca8f1d927b971951807
2023-08-08 16:06:24 -07:00
David Anderson
fc3b122231 Merge changes Ic18443d4,I9e9af999,I10e099fe,I00cf6ec9,Ia1ea4ba7 into main am: 7bd9162b14
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2695353

Change-Id: If3042ba391fa3e876ae59deff138d622d64f3b7a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-08 22:44:46 +00:00
David Anderson
7bd9162b14 Merge changes Ic18443d4,I9e9af999,I10e099fe,I00cf6ec9,Ia1ea4ba7 into main
* changes:
  snapuserd: Reduce size of COWs in tests.
  snapuserd: Add unit tests for ReadWorker::ReadAlignedSector.
  snapuesrd: Build snapuserd_test on host.
  snapuserd: Add an ITestHarness implementation for hosts.
  snapuserd: Don't specify a path to TemporaryFile.
2023-08-08 22:11:35 +00:00
Daniel Zheng
ad5df32560 decompressor maintenence
cleaning up a bit of code for consistency + adding in zstd to
FromString() function

Test: m libsnapshot
Change-Id: Ic8b7243c5a5ee25326a46e944c13578136f27078
2023-08-08 13:49:27 -07:00
David Anderson
9b306bab11 Merge changes Ib33dc593,I6550682f,Ic0681cbf,Iaaf96a37,I89b15492 into main am: 9c525ff0ed
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2695350

Change-Id: I309c8307fe7515011ed16890480f00998bf87181
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-08 20:31:37 +00:00
David Anderson
9c525ff0ed Merge changes Ib33dc593,I6550682f,Ic0681cbf,Iaaf96a37,I89b15492 into main
* changes:
  snapuserd: Factor a base class out of tests.
  snapuserd: Add error propagation to tests.
  snapuserd: Add diagnostics for debugging races.
  snapuserd: Fix race condition in HandleManager shutdown.
  snapuserd: Remove test dependence on LoopDevice.
2023-08-08 19:46:53 +00:00
Daniel Zheng
fe6c1d55f7 Moving includes
Removing unused includes + moving includes to file that uses them

Test: m libsnapshot
Change-Id: Iacb1d1d0d17cf9059583443e9a17fdc1007bc399
2023-08-08 12:29:14 -07:00
Daniel Zheng
50460fa3ac libsnapshot: take in compression_level
Changing libsnapshot to have configurable compression_level

Test: ota_from_target_files
Change-Id: I4c050a2c83cc0fa9079f94dd2d9009f291358740
2023-08-08 12:29:12 -07:00
David Anderson
891671852c Merge changes Ifddb5cb8,I8735ef6c,Ifd33c28e into main am: 1cf0e90409
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2693470

Change-Id: I1f97c22cb28f4a0850630e010a1e8e06f23d26ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-08 17:53:33 +00:00
David Anderson
1333d87bfe snapuserd: Reduce size of COWs in tests.
This greatly reduces the runtime of snapuserd_test, from 4 minutes to
about 1.5 minutes.

Bug: 269361087
Test: snapuserd_test
Change-Id: Ic18443d4e4318f6ef6adadeabd47ccceeeb19b6f
2023-08-08 10:41:56 -07:00
David Anderson
dbda1300ae snapuserd: Factor a base class out of tests.
This factors a lighter weight class out of SnapuserdTest, so we can
construct tests without needing a HandlerManager/daemon.

Bug: 288273605
Test: snapuserd_test
Change-Id: Ib33dc593a5b3d3df86853e73f245918ef36fd9fa
2023-08-08 10:41:56 -07:00
David Anderson
6aec095d68 snapuserd: Add unit tests for ReadWorker::ReadAlignedSector.
These tests are for real bugs that were previously not testable.

Bug: 288273605
Test: snapuserd_test
Change-Id: I9e9af999e4f5f988f4538750eba109f6b2fe448c
2023-08-08 10:41:56 -07:00