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
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
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
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
prepare_fs_for_mount() attempts to mount() the block device at the
mount_point, so it must be created beforehand, as opposed to later in
__mount() where it is done now.
Also fix slight bugs with using fstab.mount_point instead of an
alternative specified mount_point.
Test: boot
Change-Id: I758b6a6efe2dd99433fc1974b69cb6f7ce3bc0c2
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
Used by tests on the system side of the Treble boundary, e.g. fuzzing
Test: m libtrusty libtrusty_test
Change-Id: I56a15c80eb7c4b9e51f8e59a7cd1abdfc35d8d5a
- 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