On some devices (e.g., emulator), init needs to read AVB footer from
a logical partition because:
1) Dynamic/logical partition is enabled
2) The partition is AVB chained, i.e., need to locate footer from the end
3) Logical partition is not understandable by bootloader,
but there is no bootloader in this case
Bug: 125540538
Bug: 128434470
Test: boot and force the fallback path, to check it can get logical path
Change-Id: Ie304bce234cbf0f938f386f7ce59235c851e0e2d
Merged-In: Ie304bce234cbf0f938f386f7ce59235c851e0e2d
(cherry picked from commit 84d4933686)
Note: fiemap_writer_test's default argument now defaults to
/data/local/unencrypted or /data (whichever exists), since there is no
way to pass arguments via AndroidTest.xml.
Bug: 129000341
Test: vts-tradefed run commandAndExit vts-kernel --primary-abi-only --module VtsFiemapWriterTest
Change-Id: I8cc2e39e170b26b53cf0a829b308171890ae82fd
- Rename SparseBuilder to ImageBuilder, WriteSplitSparseFiles
to WriteSplitImageFiles, WriteToSparseFile to WriteToImageFile, etc.
- Add sparsify argument to ImageBuilder, WriteToImageFile, and
WriteSplitImageFiles
This allows lpmake to write non-sparse super image directly. Virtual
devices needs non-sparse images to work on.
Test: lpmake without --sparse
Test: liblp_test
Bug: 120041578
Change-Id: I76ee09efd02df7caaa8abd37a55ae0bebf9cfa29
Merged-In: I76ee09efd02df7caaa8abd37a55ae0bebf9cfa29
The pinned file should have NOCOW_FL flag.
Bug: 129803146
Change-Id: Idaf5bdbbdcce1c3805cd16ddb0c1c7f1df87dcfb
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Older host adb client do not recognize reboot-fastboot,
switch it for "adb reboot fastboot" which should be the
same.
Test: None
Bug: 117670584
Change-Id: Iec5230ca66ec18fe7d7c0ebd3f9ab9596a6e7b3c
For devices without overlayfs and system is root (Hikey, Hikey960)
correct "/system" to "/" if that is the mount point.
Test: adb-remount-test.sh
Bug: 129720614
Change-Id: I3bdbd5ea7b70d03477055e60521d8132b486c904
Add basic config that can run through atest the remount
script.
Very first step before being able to run in infra.
Test: atest adb-remount-sh
Bug: 117670584
Change-Id: I399f79fb7d7cd1b8a832be23efb3b625be693f7e
* changes:
libbase: realpath is wrapped with TEMP_FAILURE_RETRY
liblp: Replace open with GetControlFileOrOpen
init: expand prop in 'file'
libcutils: android_get_control_file uses realpath.
On taimen-eng build, the test reports:
[ WARNING ] user fastboot missing required to invalidate, ignoring a failure
ERROR: expected "cat: /vendor/hello: No such file or directory"
got "Hello World! Fri Mar 22 08:56:32 PDT 2019"
[ FAILED ] vendor content after flash vendor
Which is a result of a corner case problem on devices that need to
use overlayfs to support adb remount, but do not have fastbootd as
required by Dynamic Android Partitions (DAP). These legacy non-DAP
devices we consider this a Known Issue.
The message however is too alarming when reporting this Known Issue
that the test has notified you it accepts. Use standard notification
output format, and change the result to a series of WARNING instead.
The output would then look like:
[ WARNING ] user fastboot missing required to invalidate, ignoring a failure
[ WARNING ] expected "cat: /vendor/hello: No such file or directory"
[ WARNING ] got "Hello World! Fri Mar 22 08:56:32 PDT 2019"
[ WARNING ] vendor content after flash vendor
Which still tells us there is an issue, but does not cause a state
of extreme alarm when looking at the test output.
Test: adb-remount-test.sh
Bug: 120448575
Bug: 128876541
Bug: 123079041
Change-Id: I1d8d60f23f7670ade7eae1be629264f7507e0cfd
Bug: 126230649
Bug: 127953521
Test: GSI boots when installed to sdcard on hikey960
GSI boots when installed to /data/gsi
Change-Id: Id59926ebe363939c8c5745bb1bf5bd13722dae7e
Add internal fs_mgr_is_ext4 and fs_mgr_is_f2fs to get heads up on
mount failures and thus bypass trying.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: Ieb1f8c19ced930b6fe2d1791ef710ce528da7e37
When allocating a partition with a size that is unaligned (to the
optimal alignment), the remaining sectors are wasted since they are
never reallocated. This is because the free list is guaranteed to only
contain optimally-aligned regions. Unfortunately this means when a
partition is resized, we are wasting a small amount of space each time.
On a non-A/B device, this could wind up being significant.
For example, with an alignment of 512KiB, a 4KiB partition at offset 0
will waste 508KiB of space. The next extent to be allocated by any
partition will start at the next 512KiB.
To address this, we check if the last extent for a partition can be
extended to cover the difference between its last sector and the next
optimally aligned sector. We also verify that this region was not
allocated to any other partition, and does not appear in the free list,
to make sure we're not stealing space that will be used somewhere else.
Bug: 120434950
Test: liblp_test gtest
Change-Id: I88689889d44a4d2c51e659241918aaf2c064e049
FIBMAP blocks are returned in FIGETBSZ units, which means the number of
blocks also needs to be determined by FIGETBSZ. Using the stat blocksize
is incorrect. On VFAT, FIGETBSZ returns 512 whereas st_blksize is 32768.
Bug: 126230649
Test: fiemap_writer_test gtest
Change-Id: Id0a667936ff9c0b60b1e8f72920cf62ceece1657
The path no longer exists, and thus the path doesn't need to be
unmounted upon remounting.
Bug: 125549215
Test: system/core/fs_mgr/tests/adb-remount-test.sh
Change-Id: I7b263c755ad7eeaa63a00ad9795a134707698625
We allocate VFAT file space by seeking and writing a single byte. It
turns out this is not fast enough to avoid invoking the progress
callback, so instead, we should seek in increments.
Bug: 126230649
Test: fiemap_writer_test gtest
Change-Id: I2b363af4ebde873411e8a3acd22ca68d175afe3f
When this patch landed, it was thought that over-allocating partitions
had no undesired side effects. However there are cases where it is now
causing problems. When flashing a GSI for VTS, the vbmeta is appended to
the end of the partition. If libfs_avb cannot find this vbmeta by
looking at the end of the partition, verification will fail. Similar use
cases with verifying other dynamic partitions are expected to be
problematic, so for now we revert to block-size alignment.
This reverts commit dccfdca1e1.
Bug: 125113249
Test: liblp_test gtest
Change-Id: Ibfd66734b63265e9fbb2ccf6b670c168c36190bc
FIBMAP returns block numbers, whereas fiemap_writer was treating them as
byte offsets.
Bug: 126230649
Test: gsi_tool install to vfat works
Change-Id: Ice80128213425aa9601e381d0fbe53f9581bf596
This adds few new methods to introduce write support to SplitFiemap:
(1) Write(), which has an internal cursor to stream data into the split
files. As the end of one file is reached, the next is opened.
(2) Flush(), which calls fsync() on each internal FiemapWriter.
(3) HasPinnedExtents(), which calls the same on each internal
FiemapWriter.
Included are some tests for edge cases in Write().
Bug: 126230649
Test: fiemap_writer_test gtest
Change-Id: I9fd509215975dbbb20a44b020315d3c1b287d1a0
For devices that do not support overlayfs that are system as root,
need to pull /dev/root device from / mount point in fstab.
Test: adb-remount-test.sh
Bug: 126256072
Change-Id: I198c0e8c60770508737318afde95db2966294ff5
Report any discrepancy in the active slot.
Fix a problem with problematic error propagation for adb_cat()
Test: adb-remount-test.sh
Bug: 126256072
Change-Id: I8a5d4e364945c5e60d252333886987b8dca0cfb3
Can supply a specific partition to remount. Partitions can be
specified by name or mount point. Some extra work to differentiate
an unknown partition, invalid partition, or one that is covered by
overlayfs.
Test: adb-remount-test.sh
Bug: 122602260
Change-Id: Iab6f51c2b5ebe01f1cea3fb235445d5e2f495365
This introduces a new SplitFiemap class that will divide an allocation
request across multiple FiemapWriters. This is primarily useful on
filesystems that have onerous restrictions on maximum file sizes. Vfat,
for example, supports a maximum of 4GiB, which is too small to satisfy
larger userdata size requests.
Bug: 126230649
Test: fiemap_writer_test gtest
Change-Id: I3c95d341e4e94e0c44bbf0e8553c34ccfdcd155b
When flashing in fastbootd, we create a new MetadataBuilder using the
given super_empty.img and attempt to import the existing partition
table. This will fail if there is some incompatibility in the partition
layout or partition quotas.
This import code was accidentally double-accounting partitions when
determining if they could fit within the group quota, preventing
"fastboot flashall" once partitions reached a certain size.
Bug: 126930319
Test: liblp_test gtest
Change-Id: I89a69cba110b62719197c9a4885cfc5bcf8f009f
Rather than require block-size alignment, instead bump the requested
file size to the necessary alignment. This ensures that the final block
is usable without placing onerous restrictions on the caller to figure
out the file system's block size.
This will require callers (namely, gsid) to track the actual desired
image size separately from the flie size.
This patch also updates tests to use the actual filesize of the
filesystem, rather than hardcoded 4096.
Bug: 126230649
Test: fiemap_writer_test gtest
Change-Id: I000cca274718c3ceac526d7c3392fe3a23bb42bc
We should check if the fs_mgr option starts with "avb_keys" before
"avb". Otherwise, it will treat "avb_keys" as "avb" fs_mgr option.
Bug: 112103720
Test: atest fs_mgr_unit_test
Change-Id: I88446222fa88e8ecfcd6f96d30ad4336ebe146a8