There is a small change of behavior in this patch. If "remount"
specifies a list of arguments, and one of them is invalid, it will now
error rather than try to remount the remaining partitions.
Bug: 241179247
Test: remount
Change-Id: I7a9ef41886f32ae97173796358b41844a1e42ea8
Using vector + unordered_map to retrieve the index in
a COW op vector consumes significant memory; this
is a problem especially when there are hundreds
of thousands of operations.
Instead, just store the index of the COW op vector
during pre-processing.
On Pixel, peak memory usage when all the partitions
are mapped:
Without patch:
RssAnon: 118804 kB
With path:
RssAnon: 55772 kB
Additionally, post OTA reboot, memory usage further goes
down as the partition merge completes.
Bug: 238052240
Test: OTA on Pixel
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Icc68a9688ceb89572821cee2dac689779f5e7c11
Change -force_config to -force_mode. Change inputs to vab-legacy
(Android R) and vabc-legacy (Android S). Default is device
configuration. There is no explicit option for Android T since it is the
default.
This also adds -compression_method which overrides the default of "gz".
Bug: 208944665
Test: vts_libsnapshot_test -compression_method lz4
vts_libsnapshot_test -force_mode vab-legacy
vts_libsnapshot_test -force_mode vabc-legacy
Change-Id: Iedc9461325229ccffd84478e1971f8b6b959e160
vts_libsnapshot_test uses IPropertyFetcher, as does liblp, but
libsnapshot doesn't. Fix this by switching relevant cases in
utility.cpp.
This also changes SnapshotTestPropertyFetcher from a mocked class to a
pseudo-implementation. This is useful because sometimes we want the
actual device's properties and sometimes we don't, and this setup is
more flexible.
Bug: 208944665
Test: vts_libsnapshot_test
Change-Id: I58621281715b3efb045b6be6f788934fddaa1a0c
The compression.enabled property only refers to legacy snapuserd.
However, everywhere it's used, we almost always mean "using the new COW
format with snapuserd, whether compression is enabled or not".
This patch clarifies things by renaming "compression_enabled" fields to
"using_snapuserd".
This also simplifies the feature detection code quite a bit, by removing
some redundant checks and clarifying which cases are legacy vs userspace
snapshots.
Bug: 208944665
Test: vts_libsnapshot_test
apply OTA, snapshotctl dump
Change-Id: Ie617ed3f92eefb8dff0a5cf13e5a2caa47b9e8e0
This adds a helper around WrapSnapshotAndHash to avoid manually calling
it as most tests have to do. It also changes the signature so a
PartitionUpdate is passed rather than a name, which gives access to
partition information for debugging.
Bug: 208944665
Test: builds
Change-Id: Icd1cdf9d49c48f5a44c35ab1b86f43287e429f86
This will be in sync with incremental OTA's where the sync
is done every 2MB. This improves performance on devices
with low memory.
Merge times for full OTA may increase by couple of seconds but
that is ok given it decreases the memory footprint.
Bug: 238052097
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ic2c8d2ffdbdb677e0c4d44e5de68ce8ccf86df34
This adds a test case for filesystems with larger than 4KiB alignment.
It creates a temporary FAT filesystem and attempts to create a backing
image. The actual size of the block device should be the requested size.
Test: fiemap_image_test
Bug: N/A
Change-Id: I8ef574b22dbf6d47f4855b7de681c927cf81f2b7
b/239574953 uncovers an obscure test device configuration that breaks
with aosp/2146960.
Without aosp/2146960, "/system" is not a mountpoint, because after
switch_root, the "/system" mount entry becomes "/", thus changing the
subtree propagation type of "/system" would fail.
With aosp/2146960, "/system" is bind-mounted to itself after
switch_root, ensuring "/system" being a mountpoint, thus changing the
subtree propagation type of "/system" is allowed.
Before we can re-land aosp/2146960, just try both "/system" and "/"
when changing the subtree shared propagation type of "/system", so
both scenarios are handled.
Test: Add submount under /system and adb remount
Change-Id: I4006a5c1b1987d5f6452efa069ec5c7d2ac7c8ec
AVB 1.0 support in fs_mgr has been removed in commit
Ibfb46aa6c2f761dbb3a9b5f0b16336e510417620.
Adding a VTS test case to ensure the legacy 'verify' fs_mgr
flag isn't used anymore.
Also converting GetFstabPath() to a public API in the fstab.h,
so the test case can read then parse the fstab file.
Bug: 204948957
Test: atest vts_fs_test
Change-Id: Ib6ed7cb8b6ad719b19cd876acf10f4312ecb51b6
1.In ANP, the path of the executable file recovery is sbin/recovery, and in ANR it is system/bin/recovery
2.Add a judgment on whether sbin/recovery exists in fs_mgr_fstab.cpp,
Make it possible to correctly load etc/recovery.fstab in recovery mode
Bug: 237368169
Change-Id: I8df76a003bc2edbaa01d9dd173a0cba1401ef3ac
Currently OTA merge process prints enum values in logs in numerical
form. This patch changes the log messages from numerical enums to
more friendly names.
Test: Manual OTA
===========Logs==========
CheckTargetMergeState for vendor_dlkm_b returned: Merging
ProcessUpdateState handling state: Merging
CheckTargetMergeState for product_b returned: Merging
CheckTargetMergeState for vendor_dlkm_b returned: MergeCompleted
ProcessUpdateState handling state: Merging
CheckTargetMergeState for product_b returned: MergeCompleted
ProcessUpdateState handling state: MergeCompleted
Bug: 234518211
Change-Id: If690d3ea86e6fe37e8b3e4bd52e87b70ae92495c
Thew new client will use AIDL if available, and fallback to HIDL
otherwise.
Test: th
Bug: 227536004
Change-Id: I9af21037a76a4a6db00144f5b2774ea23f3a5cc2
EROFS is not mandatory for android T and below,
so skip the test for those.
Bug: 237765186
Test: vts_fs_test fs#ErofsSupported
Change-Id: Iceea46f8f2d443636de504962b718a2461605591
Skip checking for userspace snapshots enabled property
for API level < T as this feature is not applicable for
GRF targets.
Bug: 236450435
Test: vts_ota_config_test
Change-Id: Ib5083f6237cdf4962aae06f166811d67cf6c385e
Currently, when daemon is spin up, it runs at the highest
priority with nice value set to -20. This can potetially
lead to a problem in a busy system especially after OTA
reboot when all the merge threads are running in parallel.
Now that we reduced the number of merge threads in-flight
to 2, we reduce the priority as well by setting the nice
value to -5. The other threads which serve I/O's
from dm-user (from root filesystem) still runs at higher
priority. We need this because post OTA reboot, these
threads serve I/O's until merge is completed.
Merge threads on the other hand can run at a relatively
lower priority. We need to make sure that there
is always forward progress even in a busy system
and hence set the priority to -5 as compared
to default value of 0.
No boot time regressions observed.
Output of NICE value of merge and worker threads post OTA reboot:
1 S 0 427 451 1 0 39 -20 64 2314640 dev_r+ ? 00:00:00 8
1 S 0 427 486 1 4 39 -20 64 2314640 dev_r+ ? 00:00:02 8
1 S 0 427 487 1 4 39 -20 64 2314640 dev_r+ ? 00:00:02 8
1 S 0 427 488 1 3 39 -20 64 2314640 dev_r+ ? 00:00:02 8
5 R 0 427 634 1 1 24 -5 64 2314640 0 ? 00:00:00 8
5 R 0 427 935 1 5 24 -5 64 2314640 0 ? 00:00:02 8
Bug: 237490659
Test: Full and incremental OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I6791dd72ccd8cd5bba6eff663bb3f9598bce7ed2
Currently, there is one thread per partition
for snapshot merge. When all these threads are
run in parallel, this may stress the system
as the merge threads are both CPU and I/O bound.
Allow only two merge threads to be in-flight
at any point in time. This will ensure that there
is forward progress done with respect to snapshot-merge
and only two cores are used as against using
5-6 cores.
Additionally, system and prodcut partitions are merged
first. This is primarily because /root is mounted
of system partition and faster the merge completes
on /system partition, we can switch the dm tables
immediately. There is no change in the merge phase
from libsnapshot perspective. This prioritization
is based on each merge phase. If the system partition
merge is in second phase, then it takes priority
in that phase.
As a side benefit, this should also
reduce the memory usage when merge is in-flight
given that we now limit the threads.
There is slight delay in overall merge time as
we now throttle the merge.
No boot time regressions observed.
Full OTA:
Merge time (Without this patch): 42 seconds
Merge time (With this patch): 46 seconds
Incremental OTA:
Merge time (Without this patch): 52 seconds
Merge time (With this patch): 57 seconds
system partition merge completes in the first ~12-16 seconds.
App-launch (COLD) on Pixel:
Baseline (After snapshot-merge is completed when there is no daemon):
==========================
Chrome: 250
youtube: 631
camera: 230
==========================
Without this patch when snapshot-merge is in-progress (in ms):
Full - OTA
Chrome: 1729
youtube: 3126
camera: 1525
==========================
With this patch when snapshot-merge is in-progress (in ms):
Full - OTA
Chrome: 1061
youtube: 820
camera: 1378
Incremental - OTA (350M)
Chrome: 495
youtube: 1442
camera: 641
=====================
Bug: 237490659
Test: Full and incremental OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I887d5073dba88e9a8a85ac10c771e4ccee7c84ff
* Instead of copy-and-modify `/data` mount entry, TransformFstabForDsu()
can just modify all `/data` mount entries in-place.
* This also stops TransformFstabForDsu() from shuffling the mount entry
of `/data` in fstab, simplifying the testcase.
* Implement GetEntriesForMountPoint() with GetEntriesByPred().
* Remove unused method BuildDsuUserdataFstabEntry() and
EraseFstabEntry().
Bug: 235111004
Test: atest CtsFsMgrTestCases
Test: Presubmit GSI boot test
Change-Id: I4afb443b7e527038fb42424543bb1538b01d5ec9
Deprecate DSU booting support on Q first_stage_init.
Now kDsuActiveFile and kGsiLpNamesFile must be accessible for
ReadFstabFromFile() to return successfully.
Bug: 235111004
Test: Presubmit GSI boot test
Change-Id: I5760eb9aa05610085dd7b7b78940f22fba425229
Add lz4 support in CowWriter/CowReader. Lz4 should offer faster
read/write performance but slightly larger COW sizes.
Download time: Reduced from 1264s to 825s (~35% faster)
Filesystem verification time: from 69s to 59s (~15% faster)
COW Size: 2.59GB to 3.21GB, (~25% regression)
Merge time: 37046ms to 27690ms (~25% faster)
Boot time: LZ4 is 2.7% faster
Overall, LZ4 offers faster read/write performance at the cost of 25%
space regression.
Test: th
Bug: 228478555
Change-Id: Ie521852fb3c9ff8a12e55b764c1eb1838f7b2181
Include EXT4_FEATURE_COMPAT_STABLE_INODES feature
flag from system/extra.
Test: m
Test: mmma system/core
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
Change-Id: I85f4a1c66cdfb37246808d58ca6315861daafe83
Synthesis mount entry for erofs and ext4.
Fix the synthesis logic to always create a new entry from scratch. The
old logic of "copy an existing mount entry and edit its fs_type"
doesn't work because different fs_type would have incomptable
fs_options. For example, changing this:
system /system ext4 ro,barrier=1 wait,logical,first_stage_mount
to this:
system /system erofs ro,barrier=1 wait,logical,first_stage_mount
doesn't work, because the erofs driver won't recognize the "barrier=1"
mount flag, since "barrier=1" is specific to ext4.
Bug: 235111004
Test: Boot erofs GSI.
Test: atest CtsFsMgrTestCases
Change-Id: I57132a55a089c7aae3e17c717ecd9dc1047fede8
If the vendor partition is on S and system partition is on T,
certain tests in vts_libsnapshot_test used to fail. This is primarily
because of inconsistent check between daemon and vts test.
vts test checks the userspace.snapshots.enabled property which is true on T
but never checks if the underlying vendor partition is on S. Hence,
vts test will enable userspace snapshots. However, daemon checks
the vendor partition and disables userspace snapshots thereby
leading to inconsistency.
This is only a problem on vts tests. The underlying OTA on devices
works fine as we have the vendor partition check.
Bug: 231401995
Test: vts_libsnapshot_test on S vendor and T system
vts_libsnapshot_test on T vendor and T system
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Iad4f299bd2e07c9c01f5fbee6a20e2f01bf1778a
"adb-remount-test.sh" is sh_binary,
not cc_prebuilt_binary.
Test: m
Test: cd system/core/fs_mgr; mma
Change-Id: Ie5e2446f87d38905d728e2c5a76f6f02381d10ce
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
Initiate update verification from daemon. This will help
in two ways:
1: We avoid reading everything into page-cache. Since,
low end devices are already short on memory, we don't
want to read and populate page-cache which can slow
down boot.
2: During boot, once the selinux transition is done, daemon
is all ready to kick off the verification since verity is
already setup. Note that we are still guarded by update_verifier.
Update_verifier will still block marking new slot as
boot success until the verification is completed. So, there
is no change in the behavior.
Bug: 193863442
Test: Full and incremental OTA on Pixel 6
Incremental OTA of 500M (Monthly OTA)
Boot-time (Without this patch): 38 seconds
Boot-time (With this patch): 32 seconds
Full OTA of 2.2G:
Boot-time (Without this patch): 27 seconds
Boot-time (With this patch): 21 seconds
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I4f17db19bdd0dd261902c670be6212862d861fe1
The return code check should be after TEMP_FAILURE_RETRY.
Discovered by the tautological-constant-compare warning.
Test: presubmit
Bug: 72331526
Change-Id: I531a9e0498ce9448facc692ddedc14434e7ab507
These were backported to android13-5.10 and should be present in
T-launch kernels.
Bug: 233926292
Test: vts_fs_test
Change-Id: Ifb5ff6a200b081fe8696d5803d4a128740eb8e21
This patch also begins reducing the complexity of SnapshotMergeStats by
eliminating the indirection layer between the protobuf and
SnapshotManager.
Bug: 222117189
Test: statsd_testdrive
Change-Id: I15d740121c381da7d8311f0cbbd0da82db877555