When testing adb-remount with overlayfs, vendor overlay may fail the
test because there are unexpected overlayfs uses by vendor overlay.
By excluding mount entries for vendor overlay, the test runs
regardless of vendor overlay mount.
Bug: 122231184
Test: run adb-remount-test.sh with vendor overlay mount
Change-Id: I795774b27d5e5f973792337813b67487a5d72e29
The host builds for both libs are needed for libfs_avb host unit test.
Also replaces strlcat()/strlcpy() with snprintf() because the former
doesn't have a glibc version. Or switch char* to std::string*.
Bug: 112103720
Bug: 117960205
Test: m libdm ARCH=x86_64
Test: m libfstab ARCH=x86_64
Test: atest libdm_test
Test: atest fs_mgr_unit_test
Test: boot a device
Change-Id: Id9b92b5286b8ed9ab0d80f18ab5802dcfeb83dfa
Some commands like 'adb_sh grep " rw," /proc/mounts' do not preserve
the embedded spaces when transferred to the device and thus do not
entirely behave as expected. There are several commands issued this
way throughout the test that are similarly broken. To add
consistency, pass any arguments that are not explicitly (double)
quoted and contain embedded spaces as quoted to preserve.
Also devices that report the kernel internal device /dev/root in
/proc/mounts should be suppressed when investigating whether
overlayfs is needed. If /dev/root is reported, then we should assume
that the mount point / represents it for the following df command
when trying to determine if the partition is right-sized.
When there is only one device attached, and a serial number is not
specified, correctly determine this condition to progress to
the testing.
Test: adb_remount_test.sh
Bug: 122231184
Change-Id: I913e297dd272d6691110bb5d7a7c7f54321b6833
Cleanup test issues with single super device. Indicate mount point
instead of partitions as that can lead to confusion when referencing
the partition when there is none. For example root (/) partition
uses overlay on /system. Resolve a script syntax error when there
are no devices. Fix script logic surrounding detection of overlayfs
takeover and handling of reboot device request from
adb disable-verity.
In README.overlayfs.md discuss
BOARD_<partitiion>IMAGE_PARTITION_RESERVED_SIZE and its negative
impact on right sizing.
Soften README.overlayfs.md wording with respect to update_engine
to match changes in handling.
Test: adb-remount-test.sh
Bug: 120536582
Bug: 109821005
Change-Id: Iad7e19a436322ff9c3bdc597f4545028be112ff5
Extend test script to check non overlayfs case too. Establish
whether overlayfs is supported, or needed, and adjust expectations.
For the flash vendor code, make sure it is the _right_ vendor,
skip instead of fail.
Improve quality of the testing and handle more cases.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: Ic9957cb378d8e7737ffc4ba04078c1cb6bbd1bbd
When we have multiple physical super partitions, it is prudent to
take the alternate super physical partition in its raw entirety
rather than to construct a logical partition out of the current
super partition's limited remaining space.
SideEffect: alternate boot partitions destroyed for the sake of debug
Test: adb-remount-test.sh (including manually disabled to check
both code paths).
Bug: 119885423
Change-Id: I368d3a5619f69de3b0d1fcad73c4b42d25d0d969
Test script assumes overlayfs takeup after disable-verity, although
that can happen if verity is already disabled, it is not the case
for devices that just had it disabled. Move takeup and first stage
init tests downwards to where the condition is guaranteed.
Differentiate the test for devices that support or have verity, and
those that do not.
Fortify test to also use /data mount to check init first stage limit.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: I5241d6c97bf374614e50aa0aa18a1b9d118be093
If scratch gets made too small (eg: fastboot flash scratch small-file)
it can not recover without a workaround. The workaround is not
intuitive, (adb enable-verity then adb disable-verity to erase and
re-establish the proper sized scratch. This needs to be automatic.
If we detect it is too small to support a filesystem, resize it to an
more appropriate size if it exists.
Alter unit test to check for fastboot characteristics and assumptions
associated with the scratch partition, and a test case to flash the
partition.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: Icfceaa461c2bf13ca5a7dd4e34675dde8a4d251f
Add a test report df before overlay applied to make it clearer what
the device looked like before applying for remount. Check error
code from adb disable-verity and use that to terminate test if bad.
Collect a sliced logcat for failures to help diagnose problems.
If the device does not come back after flashing, timeout and fail
when waiting. Fix some issues that result when running script under
set -x when diagnosing the tests logistics.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: Iffbd6261703393417cb6ec3a12042d59523c348d
Strip out /dev/block/loop* devices to filter out apex mounts. Deal
with scale of skip_administrative_mounts function to make for easier
maintenance.
Test: adb-remount-test.sh
Bug: 109821005
Bug: 112455435
Change-Id: Ic7382a613db8f3ac7cdc10721194042378d136b9
Regression introduced commit bb1efbd1c6
By not first checking if overlayfs mount on /system is in /proc/mounts
remount fails to discover the override and take the selected action.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: I1f0bae22caae1bca84fc1e33b508b54d98f4ed5c
Under the condition of an existing, but broken, filesystem on the
scratch device, force recreation. Add the -f flag for f2fs,
already present for ext4.
Test is enhanced. The test needs to check, and if necessary wipe
out any existing overrides and reboot before running the remainder
of test. Report which overrides are being used, and how they are
setup. Fail if they are not as expected. Improve efficiency of
checks by reducing the duplication of commands issued to the device.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: I9ac4fac952e334c00b089fec0b73b2cd2cc0af5c
For logical partitions, the fstab supplied during
fs_mgr_overlayfs_setup() does not have the correct blk_device and
thus check in fs_mgr_has_shared_blocks() inside
fs_mgr_overlayfs_enabled() will fail to provide the correct status.
Call fs_mgr_update_logical_partition() to fix this up. Side effect
is an API change where fstab can no longer be considered const when
passed into fs_mgr_overlayfs_mount_all() and
fs_mgr_overlayfs_required_devices().
Some additional minor cleanup as well. Move fs_mgr_rm_all() higher
up as-is in the file as it has no dependencies, which will complicate
future changes. Add --help to adb-remount-test.sh unit test script,
improve error handling and checking.
Test: adb-remount-test.sh
Bug: 109821005
Bug: 117605276
Change-Id: I548d3797d49661529490d1a0bf96b63e57491704
Arrange to delete the overlayfs backing when a specified partition
has been flashed.
Test: manual
Bug: 109821005
Bug: 117605276
Change-Id: I1c6a0341c6cd2ecfbb7c71bec5679a74d579aadd
Provide a means to test out overlayfs work
Test: adb-remount-test.sh
Bug: 109821105
Bug: 117605276
Change-Id: Ia6114c8f4d0c3424cb869d002cc61cfc6863151c
We ran into an issue with an fd leaking due to missing both CLO_EXEC
and fclose() in related code, so let's make sure we're safe here too.
Test: boot
Change-Id: Ief893c936859815c78fa6d7e06cb88ad34aadbac
Generate fstab from /proc/mounts. Basically like any regular fstab
minus the requirement for the Android fs_mgr_flags. Added a unit
test to confirm that fs_mgr_read_fstab("/proc/mounts") matches the
setmntent("/proc/mounts")+getmntent() content.
As a result, discovered a bug in parse_flags that would report "ro"
if the "rootcontext=..." flag was referenced.
Test: fs_mgr_unit_test
Bug: 109821005
Change-Id: I635ee979e11ee089b09adbedb5f42b6ba78026de
Spans quoted with " are dealt with atomically, and are stripped from
the key/value results when parsing the kernel cmdline.
Test: compile, device boot, fs_mgr_unit_test
Bug: 109821005
Change-Id: I45f3d7395f34295edefdeaafa4c15c6ee25cc4da