We only need to iterate exceptions_per_area times during
merge. Additional iteration overhsoots the buffer and hence triggers
the assert.
BUG: 168311203
Test: Full OTA with VABC - Verified merge complete
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: If6e8dee08802ea70a8fd40e93ad63a47f39ce96e
This adds a compression bit to SnapshotUpdateStatus. This is so init can
tell whether it needs to launch snapuserd, without reading the
individual state of each snapshot, since this state is global.
Bug: 173476209
Test: manual test
Change-Id: I8c3bbfb0d184f70e661e7b043afc37e335d1e187
Normally, DeviceMapper::CreateDevice() handles this for us. However, it
does not work in first-stage init, because ueventd is not running.
Therefore this patch adds a way for first-stage init to set a callback
to manually regenerate and process uevents.
Additionally, even with ueventd, dm-user misc device creation needs a
WaitForFile() call, since ueventd is asynchronous.
The WaitForDevice() helper in this patch accounts for both of these
scenarios.
Bug: 173476209
Test: device boots into first-stage init after full VABC ota
Change-Id: Ib7a9bfc2a5a5095aa00b358072f9cb1743c19ab2
Migrate tasks from root group to a subgroup would help us to put soft
cpu bandwidth control correctly. There are few tasks now failed to
migrate due to PF_NO_SETAFFINITY which is the default kernel behavior
which we are not overriding at this moment.
This CL also fixed an issue that most of RT thread lost RT attribute
when kernel with CONFIG_RT_GROUP_SCHED enabled, as the subgroup would be
initialized with 0 RT runtime by default. CONFIG_RT_GROUP_SCHED is not
enabled in GKI kernels but there could be devices with
CONFIG_RT_GROUP_SCHED enabled, so setting some budget for those devices
to make they can still function. OEM can either set proper budget by
themselves or remove CONFIG_RT_GROUP_SCHED completely.
Bug: 171740453
Test: boot and check cgroup
Change-Id: I83babad2751c61d844d03383cb0af09e7513b8e9
Put tasks into a subgroup so that we can set things up e.g. soft cpu
bandwidth and/or uclamp.
Bug: 170507876
Bug: 171740453
Test: boot and check cgroup
Change-Id: Iaeb081bc4f214aa23eb281e0c28a81ea581bb4d1
There are sysfs nodes that don't take multiple inputs, adding a new
copy_per_line built-in command to copy from source file to destination
line by line.
Bug: 171740453
Test: boot and check file and log
Change-Id: I41b7a565829299d56b81d4509525dfa6a0a52444
Now that tune2fs and resize2fs may be dynamic, add linker[64] to
first_stage_ramdisk/system/bin.
Test: boot and examine serial output, ensure tune2fs and resize2fs
can be executed.
Bug: 173425293
Change-Id: I35699b38ddf5004c04ec0adc1b0c54d5d9c92ae6
create_directories return false with ec == 0 if directory
already exists. Do not abort in this case.
Bug: 173425293
Test: boots with pre-existing /first_stage_ramdisk/system/bin
Change-Id: I351837f0a5a56361ebc385b9a9da9658882a131d
We change read_all() and write_all() to return signed values, so
our negative error return values will be correctly caught.
Test: TreeHugger
Change-Id: I4d03d4475bccb40ae4b84a846966139b34ede2bd
Also includes new --out_<partition> flags for
system,system_ext,product,vendor,odm
to allow host_init_verifier to work with a collection of init rc files.
Test: host_init_verifier --out_system=... --out_vendor=...
where vendor contains an init rc file that overrides a service
present in system. Observe parse failure and non-zero exit.
Bug: 163089173
Change-Id: I520fef613e0036df8a7d47a98d47405eaa969110
- Make it apply to every thread, and thus remove the restriction
that it must be called while the program is single threaded.
- Make it change TCF0 itself (on all threads), instead of requiring
callers to do it themselves, which can be error prone.
And update all of the call sites.
Change the implementation of
android_mallopt(M_DISABLE_MEMORY_MITIGATIONS) to call
android_mallopt(M_SET_HEAP_TAGGING_LEVEL) internally. This avoids
crashes during startup that were observed when the two mallopts
updated TCF0 unaware of each other.
I wouldn't expect there to be any out-of-tree callers at this point,
but it's worth noting that the new interface is backwards compatible
with the old one because it strictly expands the set of situations in
which the API can be used (i.e. situations where there are multiple
threads running or where TCF0 hadn't been updated beforehand).
Bug: 135772972
Change-Id: I7746707898ff31ef2e0af01c4f55ba90b72bef51
Using ro.virtual_ab.compression.enabled does not work in first-stage
init, since properties aren't available. Instead, attach a compression
bit to SnapshotStatus. Although there are no plans to have per-snapshot
compression toggles, this route avoids creating a new state or indicator
file elsewhere. And SnapshotStatus is available in every place that
cares about compression.
Bug: N/A
Test: apply OTA with VABC
Change-Id: I51deb5693a08417ea7a2c524e240191748907123
Handle flush operations by dm-snap post merge and
the ABI changes from dm-user. This
is now in sync with the latest dm-user patch (patch 25).
In case of any failures observed in daemon in the IO
path, return error code back to dm-user which
will eventually fail the IO.
Bug: 168311203
Test: vts_libsnapshot_test, cow_snapuserd_test
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I4af63845f8c3e1c445f6c55374ea58b6f3454795
This provides a block device via dm-user, with all accesses backed by
in-memory storage. It's essentially the same as what I have in
selftests, with the kselftests stuff removed so it'll build in Android.
Test: mkfs.f2fs, dd, fsck.f2fs
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Change-Id: I68515d6e9001c2f6d199d394e67ebe528b382406
* changes:
init: Always create and restorecon /dev/dm-user.
libsnapshot: Get DaemonTransition test passing again.
libsnapshot: Move first-stage pid var constant into IDeviceInfo.
Add the matadata directory for the non-VAB device to eliminate the
following init error logs:
[ 1.891172] init: [libfs_mgr]check_fs():
mount(/dev/block/by-name/metadata,/metadata,ext4)=-1: No such
file or directory
Test: dmesg | grep metadata | grep "No such file or directory"
Change-Id: Ie4db10bd3cbc194d05e64ffb954f1956db2321c6
Signed-off-by: lijiazi <lijiazi@xiaomi.com>
If device specifies moving AVB keys to vendor ramdisk, but
doesn't have a dedicated recovery partition, install to
vendor-ramdisk/first_stage_ramdisk.
Test: manual
Bug: 156098440
Change-Id: I05a8731236996dda0d1ab3c09828f7dac46f4ac7