Updated FuzzedDataProvider value ranges to avoid Abort due to division by zero.
exec/s: 14786
Test: ./liblp_builder_fuzzer clusterfuzz-testcase-minimized-liblp_builder_fuzzer-5371251289292800
Bug: 328948968
Change-Id: I2568bd104b5fb09744baf42ffca6aabd24797b12
This adds a new metadata header flag to the super partition. This flag
is set when "adb remount" is used, and is implicitly cleared when
flashing.
If there is a scratch partition present on /data, we require that the
flag be set in order to proceed using overlays. If not set, scratch is
not mapped in first-stage init, and scratch images are removed later
during startup.
Bug: 297923468
Test: adb remount -R, touch file in out/, sync, flashall
Change-Id: I9cc411a1632101b5fc043193b38db8ffb9c20e7f
GCC 14 starts to no longer include <algorithm> by default, resulting in
it needing to be explicitly declared.
Test: Recompiled with GCC 14 and succeeded
Change-Id: Ifc5dd58b7476ba728ae604cd2924cb68fbcab701
Signed-off-by: Christopher Fore <csfore@posteo.net>
Added a check to avoid possible NPD when duplicate partitions are created and changed slot value range which is being fetched using FuzzedDataProvider.
exec/s: 16440
Test: ./liblp_builder_fuzzer
exec/s: 26412
Test: ./liblp_super_layout_builder_fuzzer
exec/s: 9178
Test: ./liblp_apis_fuzzer
Bug: 307978015
Change-Id: I63abc828cc3f4c44c1dd89a01acfb33dc08813b8
There are a few places where an index is randomly generated, but the
max is incorrectly set to the size of the value not one less than
the size.
All of these occurrences have been fixed.
Bug: 306230574
Test: Ran fuzzer instance that failed, no longer fails.
Change-Id: I20dfbc19a0df9cb160f8c861e072f083e24a4fab
We have seen multiple OTA failures with invalid geometry magic
signature. Make partition metadata write atomic by writing to a tmpfile
first and then do a rename.
Test: th
Bug: 303770065
Bug: 298149189
Change-Id: Id1d565de73439b95b665144c2f02fc97273d341c
Added TestPartitionOpener_group for test_partition_opener.cpp, as this
file shall be used by liblp_apis_fuzzer and liblp_test_defaults
Test: make TestPartitionOpener_group
Bug: 285829660
Change-Id: I01da0a6896409af99af9e89092f6e1e3760cf4c2
* changes:
fastboot: Move some helpers into util.h/.cpp.
fastboot: Allow using LOG().
fastboot: Use RAII for sparse_file objects.
liblp: Add a helper class for building sparse-compatible super image layouts.
This class helps export a list of regions comprising a super partition,
and what the contents of those regions should be. It is very similar to
ImageBuilder, except that it does not require actual partition image
files, nor does it actually write an image file to disk.
The goal is to support building an in-memory super image that uses as
little memory and backing storage as possible. For example, fastboot can
use this to upload a super image without having to read and write
gigabytes of unnecessary data.
Since the goal is to optimize fastboot, we've taken some shortcuts here.
Retrofit devices and other edge-casey behavior are safely rejected. We
also don't rely on libsparse behavior here, and attempt to make the
translation to sparse records as trivial as possible, by explicitly
declaring where fill/dontcare gaps are, and only exporting 4KB aligned
regions. Hopefully this will allow the code to be portable to
non-fastboot consumers.
Bug: 266982466
Test: liblp_test
Change-Id: I1b41d233bc4512c4b62e19603e8e77bc5867cfab
This is but a cosmetic change. Before:
> [libfs_mgr]__mount(...
After:
> [libfs_mgr] __mount(...
Also change liblp, libfs_avb and libvbmeta.
Bug: 241688845
Test: Presubmit
Change-Id: I7d408a94a7fe279d9b65d699e22159b167f34526
Test options for the api levels are moved to test_options.
test_min_api_level property will be removed with this change.
Bug: 187258404
Test: build
Change-Id: Id943566de2ac693b5955bd84a8463e5013a8bb0f
Each VTS module is required to have OWNERS file. The ownership is based on
go/vts-owners. For more information about ownership policy, please visit
go/xts-owners-policy.
Test: Tree Hugger
Bug: 143903671
Change-Id: I685d6fda211c9bce445d9fea351442b29541e639
adb_debug.prop is migrated too. And ramdisk_available is added to all
dependencies.
Bug: 187196593
Test: boot
Change-Id: I59cd149e0021211b8fd59c44b93bbf18dc8637bf
Two tests in VtsKernelLiblpTest
require dynamci partion which is not
mandatory for Automotive in Android Q:
VtsKernelLiblpTest#BuilderTest.block_device_info
VtsKernelLiblpTest#liblp.ReadSuperPartition
Test:run vts -m VtsKernelLiblpTest -t
VtsKernelLiblpTest#BuilderTest.block_device_info
Test:run vts -m VtsKernelLiblpTest -t
VtsKernelLiblpTest#liblp.ReadSuperPartition
Bug: 156287966
Change-Id: I353b854dd37f1ae3aeb7212c97e376dc9719ba91
alignment_offset restrictions were removed in R and are no longer
needed.
Bug: 180571070
Test: liblp_test
Change-Id: I43fa4a929c20cc8c6ec2fece71d5400351c13dbe
For partial updates, the metadata for untouched dynamic partitions
are just copied over to the target slot. So, verifying the extents
of these partitions in the target metadata should be sufficient for
correctness. And we don't need to read & hash the bytes on these
partitions.
Bug: 151088567
Test: unit tests pass
Change-Id: I95836ee6f76d884c7a1f5537154ac7230563493a
Q liblp only supports 10.0 super partition metadata, so
forcefully downgrade the current metadata version too.
On retrofit Virtual A/B devices, the metadata version is
at most 10.1, because the new VIRTUAL_AB flag is not set
on retrofit devices.
In version 10.1, two per-partition flags: UPDATED and DISABLED
are introduced.
- The updated flag is set when the device undergoes a Virtual A/B
update before. Clear it.
- The disabled flag should only be set on metadata files used by
libfiemap ImageManager. It shouldn't be used on super partition metadata.
Hence, this CL should only clear UPDATED flag.
Test: R->R->Q OTA
Bug: 159590481
Change-Id: I8b548c8ce36a75197e7172a77f9207fd44fe4670
(cherry picked from commit ba5dfd76de)
Merged-In: I8b548c8ce36a75197e7172a77f9207fd44fe4670
Q liblp only supports 10.0 super partition metadata, so
forcefully downgrade the current metadata version too.
On retrofit Virtual A/B devices, the metadata version is
at most 10.1, because the new VIRTUAL_AB flag is not set
on retrofit devices.
In version 10.1, two per-partition flags: UPDATED and DISABLED
are introduced.
- The updated flag is set when the device undergoes a Virtual A/B
update before. Clear it.
- The disabled flag should only be set on metadata files used by
libfiemap ImageManager. It shouldn't be used on super partition metadata.
Hence, this CL should only clear UPDATED flag.
Test: R->R->Q OTA
Bug: 159590481
Change-Id: I8b548c8ce36a75197e7172a77f9207fd44fe4670
If a relative path is provided on linux host, lpdump will not
work because GetPartitionAbsolutePath return an incorrect pathname.
Test: lpdump super.img
Change-Id: I7d0f10110eb72745edba810bdf288e2506bfedd6
Signed-off-by: lijiazi <lijiazi@xiaomi.com>
This test doesn't exist on AOSP anymore, and the bugs around
alignment_offset have been fixed in R. There is no need for the test
anymore.
Bug: 157398966
Test: liblp_test gtest
Change-Id: I00ac7486faf8db8b18f764e61db1d545feb0312c
Merged-In: I563122282e940e07a7ece97ed1a9846ad1f3253c
This code is complex and alignment_offset is not useful for
optimization. Remove it, and add another test that misaligned extents do
not cause overlapping partitions.
Bug: 154646936
Test: liblp_test gtests
Change-Id: I563122282e940e07a7ece97ed1a9846ad1f3253c
The "OwnsSector" tests did not work if one range fit completely inside
another range. The new OverlapsWith() methods address this case.
Bug: 154277287
Bug: 154646936
Test: liblp_test gtests
Change-Id: I1a59069db4ffe4f13c45963c4847cff7b3dd3dfc
The "OwnsSector" tests did not work if one range fit completely inside
another range. The new OverlapsWith() methods address this case.
Bug: 154277287
Bug: 154646936
Test: liblp_test gtests
Change-Id: I1a59069db4ffe4f13c45963c4847cff7b3dd3dfc
Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL moves all tests in vts-core to vts.
It won't change test logic or behavior.
Change-Id: I24779951257ce37fc18929f214d3cf5f76c23a19
Merged-In: I24779951257ce37fc18929f214d3cf5f76c23a19
Bug: 151896491
Test: presubmit check
Exempt-From-Owner-Approval: This CL renames suite name vts-core to vts.
It won't change test logic or behavior.
Change-Id: I24779951257ce37fc18929f214d3cf5f76c23a19