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
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
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
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
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
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
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
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>
If ro.zygote is zygote64, don't bother running 32-bit test.
Otherwise abilist{32,64} decides what tests to run.
Bug: 291874369
Test: make gsi_arm64-user; Check /system/etc/init/hw
Change-Id: Id10b2242606d6400acc29c3174f713581d6cce2e
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
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
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
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
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
Also add the missing `.size` directives to all the assembler functions
for slightly improved backtraces.
Test: crasher64 pac; crasher64 bti
Change-Id: I8e0c127cbff56c33637e6ca8f1d927b971951807
* 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.
cleaning up a bit of code for consistency + adding in zstd to
FromString() function
Test: m libsnapshot
Change-Id: Ic8b7243c5a5ee25326a46e944c13578136f27078
There is no easy way to override fs_mgr_get_slot_suffix for testing or
for simulating slot switches. It relies on global properties, and
since fstab is usually a static library, linked multiple times, we can't
just stick a global variable in fs_mgr_slotselect.
libfs_avb already takes slot suffix arguments in various places. This CL
extends that by adding arguments to AvbHandle and FsManagerAvbOps.
Bug: N/A
Test: snapshotctl
Change-Id: Ide7f052b38249d6bc79a6a2c124baf8ca08bcc3b
* 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.
This greatly reduces the runtime of snapuserd_test, from 4 minutes to
about 1.5 minutes.
Bug: 269361087
Test: snapuserd_test
Change-Id: Ic18443d4e4318f6ef6adadeabd47ccceeeb19b6f
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
These tests are for real bugs that were previously not testable.
Bug: 288273605
Test: snapuserd_test
Change-Id: I9e9af999e4f5f988f4538750eba109f6b2fe448c