This library is empty, and its functionality has moved
into libbinder/libhwbinder.
Bug: 148692216
Test: N/A
Change-Id: I306a2c18ec7770cfb6c3939b5e3d42a55c3165fb
Add libsnapshot test to the TEST_MAPPING's presubmit of fs_mgr to run
the test on TH whenever changes are applied to the fs_mgr contents.
Some of the tests are temporarily disabled due to a WIP bug.
Test: TH
Bug: 142513589
Change-Id: I2a283645b433ed1fd2b08d1c4919cac26d19cf16
Signed-off-by: Alessio Balsini <balsini@google.com>
Do not delete snapshots for any reason other than merge-complete or a
cancel request from update_engine. Additionally, create a rollback
indicator file if booting into the source slot, so update_engine can
attempt to cancel the update.
Bug: 147819418
Bug: 147347110
Test: libsnapshot_test gtest
Change-Id: Id357a91cec467a60246c7c3d133f6c54ccb3fc93
Add fiemap_image_test and fiemap_writer_test to TEST_MAPPING to be run
by TH as presubmits.
Because of a bug under investigation, the actual
fiemap_image_test_presubmit is used instead of the original, that has
one test case disabled.
Bug: none
Test: TH, fiemap_image_test, fiemap_writer_test
Change-Id: I63b5e69b5c245a18eceb1e5896df7bd0577f289b
Signed-off-by: Alessio Balsini <balsini@google.com>
Fix the total fiemap struct plus extents size allocation.
Fix also the logging in IsLastExtent, that was printing error messages
every time.
Bug: none
Test: fiemap_*_test
Change-Id: I85c6af63ba3a75b993a5e8ad7d7170dc7af59582
Signed-off-by: Alessio Balsini <balsini@google.com>
Avb keys used to verify a partition are stored in the first-stage
ramdisk. However, after /system is mounted, init will chroot into it.
This makes those keys inaccessible for later mounts, e.g., /vendor or
/product.
This change retains avb keys by reading all of them before chroot
into /system.
Note that it is intentional to perform public matching for both
preload_avb_key_blobs and fstab_entry.avb_keys in libfs_avb.
As some keys might only be availble before init chroots into /system,
e.g., /avb/key1 in the first-stage ramdisk, while other keys might
only be available after the chroot, e.g., /system/etc/avb/key2.
Bug: 147585411
Test: specify avb_keys for a partition and checks the keys are preloaded
Test: atest libfs_avb_test
Test: atest libfs_avb_internal_test
Change-Id: I6bd490c4215480db2937cdfc3fea0d616e224a91
Bug: 148818798
Test: apply OTA but cancel it in the middle, then
delete /data/misc/update_engine/prefs/*, then
reapply it again (to trigger CancelUpdate()).
Stack is dumped.
Change-Id: I2dfb6b7f15b9d5854d0b81ed8ad260538d21c922
snapshotctl merge --logcat --log-to-file
- If --logcat, log to logcat
- If --log-to-file, log to /data/misc/snapshotctl_log/
- If both, log to both
- If none, log to stdout
Test: manually test these 4 cases
Bug: 148818798
Change-Id: I44b52936c0d095867acc6ee781c6bec04f6ebd6b
In tests CreateLogicalAndSnapshotPartitions may give flaky results
because not synchronous.
Add a bounded delay that prevents this behavior defined by a single
constexpr.
Bug: none
Test: libsnapshot_test
Change-Id: Iad3c24b1d3e82e3bd695d6dbbc8af8eab75bee32
Signed-off-by: Alessio Balsini <balsini@google.com>
Regression from commit cb1a8e7fdd
("Don't retrigger bootstat during userspace reboot.")
sys.boot_completed and either sys.logbootcomplete (legacy) or
sys.bootstat.first_boot_completed set to determine if the display
has gone active for bootstat. For adb remount test we have no
desire or need to wait for bootstat complete, reduce script
complexity.
Also solve a possible problem with no content supplied to xargs.
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: adb-remount-test.sh
Bug: 148804390
Bug: 135984674
Change-Id: Ieefddf583ff7422e8811d2e338a0f16c8943b0d7
Also add libdm_test to the TEST_MAPPING's presubmit of fs_mgr to run the
test on TH whenever changes are applied to the fs_mgr contents.
Test: TH
Bug: none
Change-Id: Icc6adeeacaefbcfeb494f37fc776eb5a886a5183
Signed-off-by: Alessio Balsini <balsini@google.com>
Due to some recent code updates that introduced some additional
extra_argv, the DmTargetDefaultKey::GetParameterString() test was
failing.
Update the string accordingly.
Bug: none
Test: libdm_test
Change-Id: I63fab27e32a08211a43d4804d90a6f19ea4edc06
Signed-off-by: Alessio Balsini <balsini@google.com>
Product ID Quotas require wider inodes. For Ext4, quotas and casefolding
are enabled later via tune2fs
Bug: 138322712
Bug: 138321217
Test: Build with and without casefolding and quotas. Verify fs features
Change-Id: I99819f6c38adabcf7a1f944085f9005134e6fc5f
Version 2 of dm-default-key has an extra parameter and always sets the
DUN.
Bug: 147814592
Test: Cuttlefish boots with keydirectory flag
Test: Crosshatch formatted before this change boots after it
Change-Id: I309bcc3f907a6df745f5c073b0017a7dd5b5354b
In a device with malformed metadata, the MetadataBuilder returns a
nullptr that may cause segmentation faults when using the builder.
Fix by handling the nullptr exception in CreateUpdateSnapshot and
propagating the error to its caller.
Bug: n/a
Test: libsnapshot_test
Change-Id: Ie9148a552cf4bb223ab8d54b1d30d2b13d92bb22
Signed-off-by: Alessio Balsini <balsini@google.com>
The libsnapshot features are currently not used anywhere else than the
update system with Virtual A/B.
Ignore libsnapshot tests for devices that are not implementing this
feature.
Test: m, snapshot_test, OTA
Bug: 142513589
Change-Id: I4580bae5ed315f21501556eea062e6af1f982ab3
Signed-off-by: Alessio Balsini <balsini@google.com>
CreateLogicalAndSnapshotPartition is used in first-stage init and by
default never blocks (thanks to a timeout set to 0). This causes some
libsnapshot tests to fail, because snapshot devices may be accessed
before there actual creation is complete.
Fix by introducing a timeout_ms argument, set to 0 if unspecified.
Test: libsnapshot_test
Bug: 142513589
Change-Id: I5e23adaaf6df8603df501b9a25fdd1e9d8c15252
Signed-off-by: Alessio Balsini <balsini@google.com>
Reorder, remove and fix some of the dependencies in the Android.bp for
snapshot.
Test: m, snapshot_test, OTA
Bug: 142513589
Change-Id: Id214a8d6453a5675e60cda4352094dc3987292ec
Signed-off-by: Alessio Balsini <balsini@google.com>
Add flag in Android.bp to force the execution of libsnapshot_test as
root.
Test: m
Bug: 142513589
Change-Id: I9d047a9e1f9ea6d6e5540fa66fb42603ea136641
Signed-off-by: Alessio Balsini <balsini@google.com>
Currently, this is only enabled for Virtual A/B devices. When /data uses
F2FS, then proper pinning support must be enabled.
Because /data cannot be mounted in recovery, we can't delete the scratch
image backed by /data while in fastbootd. Instead, we mark it as
disabled in /metadata. The remount command now has an init script that
checks for and removes a disabled scratch partition.
Bug: 134949511
Test: adb remount on V A/B device with patched F2FS
Change-Id: Ifc8720378259654472d3822e97059b6c366f601d
When using partitions backed by /data, for example during a Virtual A/B
merge or "adb remount" on a Virtual A/B device, the userdata block
device is seen as in-use when /data mounts in second-stage init. This
subsequently prevents mount() or e2fsck from working. Metadata-encrypted
devices are not affected, because dm-default-key provides a wrapping
block device that can be used exclusively.
This patch addresses the problem by detecting when userdata has
device-mapper dependencies. If it does, and the device is not
metadata-encrypted, we introduce a dm-linear wrapper around userdata.
It is created on demand, but like logical partitions, it exists until
the device reboots.
Bug: 134949511
Test: adb remount, cuttlefish boots
Change-Id: Ifbfea1591a6e58978fdaffd6ef889afabd10e270