Note that the check needs the kernel built with latest f2fs.
Bug: 122138114
Test: fiemap_writer_test /dev/block/sda21 \
--gtest_filter=VerifyBlockWritesF2fs.CheckWrites
Change-Id: I0afbc14241f74ed368438a64afbdb97e3376f1f6
Signed-off-by: Sandeep Patil <sspatil@google.com>
F2fs may return -EAGAIN on mounting with checkpoint=disable. This
signals that the required garbage collection was taking a while, and
that more garbage collection is required, and will be resumed by
attempting to mount again.
Test: Start device with checkpointing set up with an f2fs userdata
partition that is in need of heavy garbage collection.
Mount should fail with EAGAIN and retry
Bug: 122917966
Change-Id: I83341f68e5cffa5f1bd569dfb2037ad5d3cbd7a3
bind mounts create administrivia in /proc/mounts that can not be
easily discerned to confirm expectations. We squash the stutter,
and filter out overlay backing references for /system/<path>/<file>.
Test: adb-remount-test.sh
Bug: 122737045
Change-Id: I61342f5f76f54a1a8201a52efb8054acde100a6f
This patch supports zram_writeback enabled by fstab in two ways.
e.g.,
/dev/block/zram0 none swap defaults
zramsize=1073741824,max_comp_streams=8,zram_loopback_path=/data/unencrypted/zram_swap
==> loopback size is 512MB by default.
Or,
/dev/block/zram0 none swap defaults
zramsize=1073741824,max_comp_streams=8,zram_loopback_path=/data/unencrypted/zram_swap,zram_loopback_size=1G
==> loopback size can be specified by "zram_loopback_size=%s" with "GB" or "MB".
Or,
/dev/block/zram0 none swap defaults
zramsize=1073741824,max_comp_streams=8,zram_backing_dev_path=/dev/block/partition
Bug: 74582279
Bug: 122659265
Change-Id: I66a2e6953b4743a34cf732dd0f5b5256c901f247
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
If /metadata is wiped, but is specified as a first-stage mount, it'll
fail to mount and then skipped as a mount in the second stage. Rather
than add a new flag, this patch piggy-backs on "formattable" since
otherwise there is no way the file system will be formatted.
Bug: 121209697
Test: flashall -w && reboot
Change-Id: If36a12251f398a99b9423713a8bfbe8c33523b66
Damaged avb metadata can result in avb_slot_verify returning a
nullptr in avb_slot_data. Instead of an illegal access
violation in first_stage_init, we return the verify_result so
that it can be acted upon.
Test: confirm happenstance damaged vbmeta does not crash init.
Change-Id: I15be5bd32760bcc3418c5d8a943b016c0ddd56bc
Fixes adb-remount-test and flashstation because the scratch device
was set to readonly before.
Test: adb-remount-test
Change-Id: I12551d1ed99fb7cfd04f84fcc2b77d3cb94275b2
Fixes: 122454600
Fixes: 122602260
This commit has the following changes:
1. Builds libfs_avb via "fs_mgr/libfs_avb/Android.bp" instead of
"fs_mgr/Android.bp", and removes the libfs_avb source
dependencies on "fs_mgr/fs_mgr_priv.h".
2. Moves static functions in fs_avb.cpp into util.cpp or
avb_util.cpp, depending on whether the function is related to
AVB or not.
3. Introduces two host unit tests: libfs_avb_test and
libfs_avb_internal_test, the former is to test public
<fs_avb/fs_avb.h> APIs, while the latter is to test libfs_avb
internal functions.
4. Splits fs_avb_unittest_util.* into:
- fs_avb_test_util.* (host static lib: libfs_avb_test_util),
- basic_test.cpp (host executable: libfs_avb_test)
Bug: 112103720
Bug: 117960205
Test: atest libfs_avb_test
Test: atest libfs_avb_internal_test
Test: boot a device
Change-Id: I11d6c9e9019e20b594d9321b9a28118d4806e5a7
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
This change removes this denial:
avc: denied { write } for comm="init" name="sda6" dev="tmpfs" \
ino=25715 scontext=u:r:init:s0 tcontext=u:object_r:system_block_device:s0 \
tclass=blk_file permissive=0
The reason is that during any mount_all in init,
fs_mgr_overlayfs_mount_all() will mount a list of candidates for
scratch, which includes system_other. However, in order to probe
if /overlay directory exist in the partition, it only needs read
access to the block device, and mount the partition as readonly.
If the block device is a true candidate (i.e. it does have /overlay),
re-mount it as writable.
Test: flash, wipe, boot, denial goes away, cppreopt is successful
Test: boot the second time, no denials (no cppreopt this time)
Fixes: 122454600
Change-Id: I465b363eac755d79711e4f82955cd98450527122
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
This will be used by gsid to invoke mkfs.ext4 on the userdata_gsi
partition. Since the extents are not located on the super partition, we
need a helper method that takes in an LpMetadata.
Bug: 121210348
Test: manual test
Change-Id: I00467ace8a745fb0c0d130babfda1a2d5d97c208
On first mount check if overlays are setup, if not and there is
no space, then umount and make a filesystem and try again.
Test: adb_remount_test.sh
Bug: 119885423
Change-Id: I3a76ff5b53474976f72e9db326b26838f7df5ba8
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
... instead of using the block size from the underlying block device.
Bug: 121211685
Test: fiemap_writer_test /dev/block/sda21 (on blueline)
Change-Id: I6038d3f06505a397280b0482e33814b4883be9a2
Signed-off-by: Sandeep Patil <sspatil@google.com>
The IsFilePinned() function is still not being called because I am still
seeing # blocks moved when I run following test on
aosp_blueline-userdebug.
$ fiemap_writer_test /dev/block/sda21 \
--gtest_filter=FiemapWriterTest.CheckWriteError
Bug: 122138114
Test: fiemap_writer_test /dev/block/sda21
Change-Id: I08d74093a082674d621772d202143d2f32e7c665
Signed-off-by: Sandeep Patil <sspatil@google.com>
Currently vbmeta images are stored in AvbSlotVerifyData defined in
libavb, which contains some fields that isn't needed by fs_mgr.
e.g., loaded_partition, rollback_indexes. Adding a new class VBMetaData
to replace it.
Bug: 112103720
Bug: 117960205
Test: boot crosshatch
Change-Id: I480461dad3c6aca7e028097662a3b06c3aa6646d