Revert submission 3212512
Reason for revert: Droidmonitor created revert due to b/372273614. Will be verifying through ABTD before submission.
Reverted changes: /q/submissionid:3212512
Change-Id: I37568516e973cb940f1229d52f94b8dc801da2ab
This change cleans up the following build warning:
warning: ISO C++ requires field designators to be specified in
declaration order; field 'events' will be initialized after field
'handler' [-Wreorder-init-list]
Bug: none
Test: TH
Change-Id: I9fe566b452438dc9f00f782fc4435905227a60c9
Signed-off-by: Neill Kapron <nkapron@google.com>
Schedtune was an out of tree cgroup controller present in Android
kernels up to 4.19. It was replaced with uclamp and the cpu controller.
Now that 4.19 is EOL and unsupported, and schedtune is not present in
any supported Android kernels, remove the userspace support for
schedtune.
Bug: 362504801
Change-Id: Iab7b7295d1fb443209d5868ac5c65dca0aabfbab
The cgroup.rc file was introduced in 192aee782 ("libprocessgroup: Add
support for task profiles") back with the initial support for task
profiles. It was intended to optimize performance associated with cgroup
operations. However over time, supporting this file led to making
libprocessgroup code more complicated (such as the cgrouprc LLNDK
interface), and the file ended up getting mmaped into nearly every
process on Android even though only a handful of them actually use it.
Replacing this file with reading and parsing of cgroup information on
demand allows us to simplify and shrink libprocessgroup, and eliminates
thousands of unused mappings without negatively affecting boot time or
other performance metrics.
Bug: 349105928
Test: Verified with memcg v2 and MaxActivationDepth 1 on Cuttlefish, Raven, and Mokey
Change-Id: Ic3f01fdf7fda89a56ab80657e1cf4573156273e6
This modifies first-stage init to check for /metadata/tradeinmode/wipe
as soon as /metadata is mounted. If the file exists, we issue a request
to the bootloader to reboot to recovery and wipe /data. Since this also
wipes /metadata, the wipe indicator will be removed too.
In case some kind of failure happens in recovery, this also implements a
quick-and-dirty counter mechanism to fallback to the recovery menu.
Bug: 307713521
Test: touch /metadata/tradeinmode/wipe && adb reboot
Change-Id: I2d05903cadcdadf9c05f6736454db790a9e6b5bb
Init code is bailing out as soon as `super` partition was
found in the system, ignoring rest of uevents.
In case given device contains multiple boot sources, `super`
partition as well as all other partitions shall be taken
from the same boot source, instead of relying on
`which uevent came first`.
Bug: 309244873, 349144493
Test: Plug secondary USB boot device to device that supports multiple
boot sources. Select boot from USB. Device boots properly.
Signed-off-by: Jan Dabros <dabros@google.com>
Signed-off-by: Konrad Adamczyk <konrada@google.com>
Change-Id: I70eb7d4223258ec273faa523cb67ddab0b7c32a0
Revert submission 3236797-b/340506965
Reason for revert: DroidMonitor created revert due to b/366178299.
Reverted changes: /q/submissionid:3236797-b/340506965
Tracking bug: b/369390218
Change-Id: I0ec7fe89a7a0ca3a9981cd80222d03a785e9b28f
In this change we're moving the asynchronous netd startup ahead of
the async statd and *synchronous* update_verifier.
This is desirable as we want a netd failure (which could
happen due to some mainline incompatibility wrt. bpf
or mainline shipped shared libs: resolver or netd updatable)
to be considered a signal for a bad boot.
It's still asynchronous though, so it's not ideal.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib3e252f085f569864feddaf20ac80858a3bb969d
In a GRF config, if Vendor partition is updated from Android 12; post
OTA reboot, first stage init will communicate to daemon to check if the
daemon can support socket handoff. If that succeeds, then it is a signal
that the vendor has been updated from Android 12. Use a marker in
/metadata to signal that the vendor was updated. If the marker is present,
then post OTA reboot, userspace snapshot will be used.
Bug: 333854394
Test: OTA
Android U (system) + S (vendor) -> Android V (system) + V (Vendor)
Signed-off-by: Akilesh Kailash <akailash@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:1bbf8f042f7ffb4a38657ccf6dca0798931fecd5)
Merged-In: Ie38c4379010789a84e5b44529b407f9f82135271
Change-Id: Ie38c4379010789a84e5b44529b407f9f82135271
Use the existence of
/proc/device-tree/avf/vendor_hashtree_descriptor_root_digest (rather
than kernel param androidboot.microdroid.mount_vendor=1) to know if the
vendor partition is requested.
Bug: 340506965
Test: TH
Change-Id: I0ac1c773e44454fd9c52559d833dc8eca211889c
Targets like PCs/VMs usually don't have fixed boot devices.
For example, moving the disk to another controller would result
in getting different block device path.
To workaround this situation, add an option to bypass the boot
device filter, so that every block devices would get their
symlink in /dev/block/by-name/.
Usage: Specify `androidboot.boot_devices=any` on bootconfig or cmdline
Test: /dev/block/by-name/* exists when `androidboot.boot_devices=any`
Change-Id: I5ae0faf401dac71352dbb05115a2dd6f3e76adc2
This is to match the changes in post_process_props made in
I33ae5c6f2787017a62e679aa0c28d4b909d45935
Change-Id: If521a8abb4810f8b5d4e3164a06969af4fc12374
Allow optional vendor-specific initializations
within init. This can be used for runtime
initialization setup that init rc scripts do
not support.
Change-Id: I7623a0d59b18f9ec8e3623958e2f7ccd72b877bf
Enables a method for swapping off certain block devices or files. This
will be used before hibernation occurs.
Bug: 339688542
Test: Manual, verified that calling swapoff from a init file swapsoff
location that is specified
Change-Id: I212a6f303a023c3e440b557caae82ad3904ac9c9
std::vector<const T> uses std::allocator<const T>, which is an
undocumented libc++ extension to the C++ standard library. The extension
was removed in llvm.org/PR96319. Use an ordinary non-const T instead.
Bug: http://b/349681543
Test: m fuzzy_fastboot CtsInitTestCases
Test: m MODULES-IN-system-core
Flag: EXEMPT, refactor to fix build failure
Change-Id: Ia98a2f090e87541fd35a89bd75bf9638bc7dc711
Indentation in this file is four spaces, remove an
unnecessary trailing semicolon, put a space between
a type declaration and its structured binding.
clang-format shuffled a line around as well.
Bug: None
Test: compile
Change-Id: Ib4cf17fecb1e54971020dc77b7903d2aac5dd9c1
snapshot metadata files are stored in /metadata. This means, we cannot
wipe after installing any update.
This patch does the following:
1: Create a scratch space in super partition. The scratch space for ota
metadata is just about 1MB.
2: Create ext4 filesystem on top of scratch block device.
3: Mount the scratch on /mnt/scratch_super
4: When snapshot-manager instance is created, point the /mnt/scratch/ota
to metadata_dir_ so that all the snapshot files are stored in the new
path.
All the logic of OTA remains the same. This flow is enabled only on userdebug builds for now and the only consumer would be snapshotctl
$snapshotctl apply-update /data/nbd/ -w
During init, we would have to mount the scratch partition to detect
if there is any pending updates.
With this, we would now be able to wipe the device along with the update flow. This will help incremental flashing wherein we would end up saving ~35-40 seconds on Pixel devices.
With this flow, the end-to-end update for incremental builds takes
~20-30 seconds.
Bug: 330744468
Test: Pixel 6 incremental flashing with wipe, Full OTA, vts_libsnapshot
Change-Id: Iac6ce2cf37b70ea221cd18175c8962988d03d95b
Signed-off-by: Akilesh Kailash <akailash@google.com>
If bootconfig hibernation_resume_device is present in boot config, then
we write that value to /sys/power/resume
Bug: 339688542
Test: Check resume from hibernation/boots with/without config present
Change-Id: I1a9bf63af4dab07e494740722898c1aba33c00b5
ro.boot.hardware.cpu.pagesize is used on some devices to
report the page size. However, we also know what value this
should be from the CPU. Rather than create a separate property
for this, standardize around this property.
This also allows us to test the value of this property on all
devices.
Bug: 358696947
Test: Vts16KPageSizeTest
Change-Id: I7f6260c68e17e7df8a789e9066a7171f3a56f4b0
Previously, ServiceParser did the check, but only when it's invoked by
host_init_verifier. Host_init_verifier can do it directly, which removes
unnecessary runtime dependencies from init.
Bug: 326827772
Test: host_init_verifier detects wrong HIDL interface names.
Change-Id: I4c8bb0e89a5def7341c48c52af730795a6ee13c0
CheckInterfaceInheritanceHierarchy() is for host_init_verifier to check
the interface names at buildtime. We don't need to fuzz the host-side
verification code.
Bug: 326827772
Test: run init_parser_fuzzer
Change-Id: Ie01dc2953fd6e69ef3c2cb9caadf7b9964a3d244
post_data was used by Userspace Reboot, which was removed.
Bug: 293377020
Test: atest CtsInitTestCases
Change-Id: I1a5bf328f62b8afbe58eef62c64689471e6b018c