Device is considered to be unlocked if
androidboot.verifiedbootstate is "orange".
Test: adb shell getprop ro.boot.flash.locked
Change-Id: Id3aeec757908ea63a37e28ad880a6c71d53083ac
MetadataBuilder::AllocatableSpace() represents the total space
available. Adding MetadataBuilder::UsedSpace() to represent the
space used by the existing set of partitions. This will allow a
caller to predict if a partition can be resized (Grown), or to
create a partition to use up the free space (i.e. scratch).
Test: gTest liblp.UseAllDiskSpace
Bug: 109821005
Change-Id: Iae487d869fe18310c76b48c4281f1d6c1ee333cd
We can not mount overlayfs on root / as it will intercept all file
transactions. Thus must remount /system instead.
Test: manual
Bug: 109821005
Bug: 115751838
Change-Id: Idf646b8c1ca8a0d006bf64e23a76a7e909f9162a
Add an fstab argument for fs_mgr_overlayfs_mount_all so that it can
leverage the locally and timely acquired fstab entries. Affects all
callers, adb and init.
Test: manual
Bug: 109821005
Bug: 115751838
Change-Id: I96e2045d88525a6ce39bef63327a0fcf0704e9bc
For non-A/B devices, the recovery partition should be
self-sufficient and not depend on any other partition.
Since recovery may need load ACPIO before access to devices,
we need to make sure that the the recovery image also contains
the information from the ACPIO image.
Test: can generate image with acpio/acpi
Fixes: 111871613
Change-Id: I77b95a4c78a7e967f5e682ba7053f9d03f4ca51c
Devices not supporting logical partitions do not require the command.
Bug: 78793464
Test: 'adb reboot fastboot' reboots to bootloader for a device
not supporting logical partitions.
Change-Id: I0a7b6d4335040e24efbf461e2dd2d56ab1985b7f
TEMP_FAILURE_RETRY's result was unused for the call to read(), so now
mark it as such to silence a possible unused result warning. For
__read_chk(), this function is an internal implementation detail of
FORTIFY in Bionic. Under clang-tidy, FORTIFY checks are actually
removed, so this now results in an unknown function being called. The
code should not be explicitly depending on an implementation detail, but
we can just suppress the failing case to retain test coverage of the
actual implementation.
Bug: http://b/110779387
Test: Build using WITH_TIDY=1
Change-Id: If83ac1d6f3b6dc32c0d0fb56d8e675e53b586f78
Move test to verify we can't read unwritten metadata from
liblp.UpdateAnyMetadataSlot to liblp.CreateFakeDisk.
Test: gTest liblpg_test
Bug: 109821005
Change-Id: I4714c949e2b2d9de6444996a2af2992a821c4a85
CheckRequirements() had various issues that are cleaned up here,
1) Move from C string parsing to C++
2) Moved from C data structures to C++, including fixing memory leaks.
3) Removed the 'cur_product' global and the 'query_save' function that
stores it
4) Actually writing tests for the parsing function for
android-info.txt
5) Check that a variable needs to be checked for a given product before
trying to read it. Previously, fastboot would fail if a variable
isn't recognized on a device, even if the check should be ignored.
A lot of flexibility is allowed for the input strings, to keep
backwards compatibility with the previous parsers.
Test: fastboot works, unit tests
Change-Id: Idc3bba8b8fe829d8eefe5f6c495e63a9441c0b60
This change makes the subcontext processes cleanly exit in the event of
the init's socket being closed. If that was an accident, init will
respawn the process immediately. Otherwise, it will just quietly go
away.
Bug: 80425914
Test: kill -9 $INIT_PID # Outside of an Android container
Change-Id: I664f11d1b3700ea46857abf24857335fe28e92fa
Adds support for partitions with checkpointing enabled. If the
checkpoint= fs_mgr flag is set, and the system has checkpointing on,
the partition will be mounted in checkpointing mode.
Test: Use vdc checkpoint commands, the checkpoint=fs fs_mgr flag
in the fstab, and a kernel containing the f2fs checkpoint
changes. https://lkml.org/lkml/2018/8/21/22
Change-Id: I3ea8da932de06fcfd2eed06b8640a8b1df837f1f