Commit graph

1775 commits

Author SHA1 Message Date
Giovanni Ricca
7934335c2a
Revert "init: Remove schedtune support"
This reverts commit 50fd822149.

Change-Id: Ife5bbcba6327022cabeb1a2b7362e2c8b2891cbf
2025-03-13 20:11:40 +01:00
Dennis Shen
683e3c0761 Start aconfigd socket defined in configinfra mainline module
Context: to have better future updatability. The responsiblity of
managing mainline module storage files and a socket service for flag
overrides will be moved to the configinfra mainline module. Later,
aconfigd on /system will only be repsopnsbile for managing platform
partition storage files.

Bug: b/369810972
Test: m, launch avd and then inspect the logcat log to confirm the
service is launched.

Change-Id: I490e5aa432fa4afa236689ad0999e5602f7d297e
2024-12-03 23:52:00 +00:00
Eric Biggers
6dc0ed1758 Merge "Fix the dm-verity Merkle tree caches to not expire so quickly" into main 2024-12-02 18:11:34 +00:00
Dennis Shen
db80953238 Merge "Deprecate cc_binary aconfigd and the controlling flag" into main 2024-11-27 13:33:23 +00:00
Dennis Shen
52d2446b4e Deprecate cc_binary aconfigd and the controlling flag
cc_binary aconfigd is replaced with rust_binary aconfigd-system. The
replacement is flag guarded and is already in TF full for more than a
week. Thus delete the flag and deprecate old cc_binary aconfigd.

Test: m
Change-Id: Ib128adc2ef8178e02222f77e6b89bcc7ac83c1da
2024-11-26 15:26:52 +00:00
Eric Biggers
cadad290a7 Fix the dm-verity Merkle tree caches to not expire so quickly
Bug: 335233956
Test: cat /sys/module/dm_bufio/parameters/max_age_seconds
Change-Id: I20e4df7dd3eb2ac1f462510e900568e946195faf
2024-11-26 03:24:44 +00:00
Dennis Shen
c532409c5c Merge "move aconfigd platform init service from init.rc into aconfigd.rc" into main 2024-11-25 17:27:03 +00:00
Jooyung Han
fef2dff80a Remove /data/apex/hashtree directory
This directory is no longer used.

Bug: 184914612
Change-Id: Iaa094e2df39c363fe0a5ffd4b27b5c3075bb4f7f
Test: (device doesn't have the directory)
2024-11-25 08:32:05 +00:00
Shin Kawamura
640e32478f Merge "Fix permission of zram writeback and idle file" into main 2024-11-22 03:58:13 +00:00
Akilesh Kailash
35ab96a423 Add prefetch directory in /metadata
Bug: 362507272
Test: Verify directory is created in /metadata
Change-Id: Ie1c2312f405d4b41e06a248e4d2b93cd8fc62a93
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-11-21 05:59:54 -08:00
Shintaro Kawamura
b912e3e548 Fix permission of zram writeback and idle file
The default permission of "/sys/block/zram0/idle" and
"/sys/block/zram0/writeback" are "0200".

Adding read permission to the files does not make sense because reading
those files fail as EIO error.

We should keep permission as minimum as possible.

Bug: 117682284
Bug: 375432468
Test: ls -la /sys/block/zram0

Change-Id: I11ed5d9eee257002f4698edcd81de39d2c317ea1
2024-11-21 16:28:34 +09:00
Gabriel Biren
6105d9dc8a Create the mainline supplicant directory
during initialization.

Bug: 365585450
Test: Manual test - verify that the mainline
      supplicant can add/remove interfaces
Change-Id: Ib41b361a8b032c04586f108be9d1933214934286
2024-11-18 20:24:58 +00:00
Dennis Shen
f1eaa75168 move aconfigd platform init service from init.rc into aconfigd.rc
Bug: 378079539
Test: m
Change-Id: I10c306468bf3efe3b5186851cb09b576b143512a
2024-11-11 17:44:14 +00:00
Ted Bauer
3c700588c7 Start aconfigd_system processes in init.rc
aconfigd_system is replacing aconfigd. Which one executes is toggled
by RO flag enable_system_aconfigd_rust, introduced in https://android-review.googlesource.com/q/topic:%22switch-to-aconfigd-system%22.

Bug: 378079539
Test: m
Change-Id: I6a04c38e9ef22da2b230046ddace73d6f7e39652
2024-11-08 17:45:16 +00:00
Jooyung Han
03429accee init: mount tracefs before apexd-bootstrap
This removes the error log when apexd-bootstrap starts:

  cutils-trace: Error opening trace file: No such file or directory (2)

Bug: 376150518
Test: boot-time trace shows apexd-bootstrap
  see https://source.android.com/docs/core/perf/boot-times#systrace
Change-Id: I5feaece50663a602b61377cee034060fd30217f9
2024-10-29 16:28:33 +09:00
David Anderson
097b607ac6 Merge "init: Issue a wipe on boot if trade-in mode was active." into main 2024-10-18 21:55:09 +00:00
Treehugger Robot
499643e456 Merge "init: Remove schedtune support" into main 2024-10-09 20:45:29 +00:00
T.J. Mercier
50fd822149 init: Remove schedtune support
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
2024-10-04 14:53:27 +00:00
Rob Barnes
da77c2e1dc Change owner of ACPI BERT tables to system
Changes the owner of the following files to system:system:

* /sys/firmware/acpi/tables
* /sys/firmware/acpi/tables/BERT
* /sys/firmware/acpi/tables/data/BERT

This allows the bert_collector deamon to read these files for error reporting.

Bug: 357626966
Test: m && atest bert_collector_test

Change-Id: Iba3a169f1851566ee6fed6d41b538dae448bf811
2024-10-03 13:54:52 +00:00
David Anderson
6f451a9c8c init: Issue a wipe on boot if trade-in mode was active.
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
2024-10-02 20:19:08 -07:00
Maciej Żenczykowski
b4b3950e52 Fix the trigger name for loading bpf programs.
The trigger name should be load-bpf-programs, not load_bpf_programs.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I00cff0a3dd971de39dfc3226b140be972854ea28
2024-09-23 21:34:33 +00:00
Maciej Żenczykowski
3e8f0b53e4 Merge "start netd earlier" into main 2024-09-23 21:16:05 +00:00
Maciej Żenczykowski
e60b760e74 start netd earlier
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
2024-09-23 21:15:01 +00:00
Inseob Kim
f5af00e79f Mount /mnt/vm earlier
To support early VM in the init stage.

Bug: 331320802
Test: boot and check /mnt/vm
Change-Id: If6f20a616ad24ae194e6fae292c9be200b63185b
2024-09-13 14:02:10 +09:00
Nick Kralevich
1220d17108 init.rc: Fix entropy pool initialization
Init is responsible for initializing the /dev/[u]random entropy
pool, to ensure that high quality random numbers are available
to all Android processes. Previously Android mixed in data
from /system/etc/prop.default, which included properties which
differed on a device-by-device basis. That file no longer exists,
and init generates the following error at boot:

  init: Command 'copy /system/etc/prop.default /dev/urandom'
  action=init (/system/etc/init/hw/init.rc:106) took 0ms and
  failed: Could not read input file '/system/etc/prop.default':
  open() failed: No such file or directory

Instead of reading a property file, this change modifies init.rc
to read from /proc/bootconfig. The bootconfig file contains
per-device data which was previously on the command line, such
as androidboot.serialno. Additionally, it contains device-class
information such as androidboot.hardware,
androidboot.hardware.platform, and data which frequently churns
such as androidboot.vbmeta.digest. These help ensure that the
random number initialization is at least unique on a per
device-class basis.

Relying on /proc/bootconfig accomplishes the same goal that
relying on /system/etc/prop.default was intended to accomplish.
And /proc/bootconfig is in a more stable location than
/system/etc/prop.default, hopefully preventing future regressions.

Bug: 361624398
Test: Device boots and error above goes away
Change-Id: Id5c891e871217d62ff6517c5804b4acc2d723622
2024-08-23 11:17:41 -07:00
Jooyung Han
148f602f23 init: clean up unused Service[List]::post_data
post_data was used by Userspace Reboot, which was removed.

Bug: 293377020
Test: atest CtsInitTestCases
Change-Id: I1a5bf328f62b8afbe58eef62c64689471e6b018c
2024-08-19 14:30:37 +09:00
Rick Yiu
673e6bb089 Create a new group for foreground of multi-window
In multi-window mode, currently the focused window will be top-app,
and others will be foreground. However, the cpu resource we assign to
typical foreground group may not meet the performance need of those
windows. Therefore, create a new group for them so that we could
distinguish their performance need.

Bug: 200769420
Test: group created
Change-Id: I84c61f9ed4d167e156dafb7a816b6482e80a8523
2024-08-15 01:29:48 +00:00
Jooyung Han
b29f0dcb5b Merge changes I00deb50c,I82650277 into main
* changes:
  Clean up userspace-reboot (#2)
  Clean up userspace-reboot
2024-08-12 00:40:07 +00:00
Jooyung Han
e34549af33 Clean up userspace-reboot
The feature was deprecated last year.

Bug: 292469129
Test: atest CtsInitTestCases
Change-Id: I826502770ab3fa566be57a33829f1103efa893fb
2024-08-09 15:58:53 +09:00
Inseob Kim
b6e4179dab Add /mnt/vm and mount tmpfs onto it for early VM
It will be used as a storage for early boot virtmgr.

Bug: 354059281
Test: boot and check /mnt/vm
Change-Id: I4a0c604161356b631c21913a0f8c3f2d796a3c65
2024-08-09 15:20:18 +09:00
Mike McTernan
b525463558 init: set a new trigger when a vold checkpoint is committed
Add post-fs-data-checkpointed trigger when vold completes checkpointing
after an OTA update.

Bug: 350362101
Test: ABTD
Change-Id: I647a73a942174015b46c5f40bd8f8d3347977ecd
2024-07-19 16:40:23 +00:00
Bart Van Assche
0b2f24ceb1 Merge "Revert "Make foreground and background I/O priority different"" into main 2024-06-11 23:14:34 +00:00
Bart Van Assche
4cb11951e2 Revert "Make foreground and background I/O priority different"
It has been reported that CL "Make foreground and background I/O
priority different" causes Android devices equipped with eMMC storage
to reboot if there is sufficient I/O activity. Hence revert commit
7f3fe0aaf2.

Bug: 186902601
Bug: 342034992
Change-Id: I4fa9c782eb0e801b410cb358e20fe41acebe1094
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-06-11 20:17:44 +00:00
Dennis Shen
230f639275 init.rc: add a new maps dir under /metadata/aconfig dir
Bug: b/312444587
Test: m and avd
Change-Id: Idf19d314b51cc409e58d6a2f2ae1831bfc3d717d
2024-05-22 13:30:26 +00:00
Dennis Shen
208fccdae8 init.rc: set up init.rc for aconfigd to initialize mainline storage
aconfigd-mainline-init is the service target to initialize mainline
storage files. aconfigd is the service target to start aconfigd socket
for incoming messages.

Bug: b/312444587
Test: m and avd
Change-Id: Ic8052eaf933501da3371812c482ad816ec353b27
2024-05-17 00:56:29 +00:00
Ellen Arteca
6f7e39526c Merge "Create and support isolation for /data/storage_area" into main 2024-04-26 20:59:43 +00:00
William Loh
188b64778c Create app-metadata directory
App metadata bundles, also known as Android Safety Labels (ASL),
contains information about the app's privacy and security practices.
This information is used to help users make more informed choices when,
for example, granting access to permissions.

ASL can currently only be preloaded on the system image or distributed
by the installer and written to a file in the app's codePath. To support
embedded ASL in APK we need to extract ASLs from APKs to a writeable
location. For non-preloaded apps we can write to the app's codePath like
the installer provided ASLs, however, we need to create a new writable
directory for preloaded apps located on read only partitions.

Bug: 336618214
Test: manual
Change-Id: I651b2dab45c3132d8467c507dc4ee304001f73f5
2024-04-25 19:21:27 +00:00
Ellen Arteca
f885d551c2 Create and support isolation for /data/storage_area
Creating the directory /data/storage_area (which will store each user's directory
of app directories of storage areas) on startup, and adding this directory
/data/storage_area to the tmpfs mirror so it can be protected by app data isolation
in zygote.

Bug: 325121608
Test: atest StorageAreaTest
Change-Id: Ia938e89fd8b794dbcbb844b01b790db7c0a62319
2024-04-22 20:51:44 +00:00
Treehugger Robot
6901df0eb3 Merge "init.rc: remove 4.9/4.14 support" into main 2024-04-22 17:01:10 +00:00
Maciej Żenczykowski
a95be37d2c init.rc: remove 4.9/4.14 support
U requires 4.14+
V requires 4.19+

as such this is no longer useful

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I39d01cc16897c6c9174cf074e27c888bc758f1cc
2024-04-20 07:06:54 +00:00
Maciej Żenczykowski
8b29034b89 init.rc: remove xt_qtaguid configuration
which has been fully replaced by eBpf
(started in android P, finished in android S)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie38e54600a9bb01c7ecdde63d9a9256bed047f41
2024-04-20 06:58:05 +00:00
Ted Bauer
e6eda1f80e Merge "Create new file for test_mission_1 marker file" into main 2024-04-10 21:16:43 +00:00
Ted Bauer
7443b82ce7 Create new file for test_mission_1 marker file
Test: m
Bug: 328444881
Change-Id: I4329fa161922f3dda2e3d7c9a5231f56ac716fac
2024-04-10 15:26:28 +00:00
Michael Bestas
867f0ada9a
init: Remove encryption=DeleteIfNecessary from /data/misc/bootanim
/data/misc already sets encryption=Require and this causes certain
devices not being able to boot with the following error:

init: Failed to set encryption policy of /data/misc/bootanim to
    a5a40d896b46d8c6 v1 modes 127/4 flags 0x0: The directory already
    has a different encryption policy.
init: Setting a5a40d896b46d8c6 policy on /data/misc/bootanim failed!
init: Setting policy failed, deleting: /data/misc/bootanim
init: Failed to set encryption policy of /data/misc/bootanim to
    a5a40d896b46d8c6 v1 modes 127/4 flags 0x0: The directory already
    has a different encryption policy.
init: Setting a5a40d896b46d8c6 policy on /data/misc/bootanim failed!
init: Rebooting into recovery
init: Got shutdown_command 'reboot,recovery' Calling
    HandlePowerctlMessage()

Test: m; fastboot flashall, observe device boots successfully
Change-Id: I86a2b2b8fe8e438ca405a0e901739d11550d3ebd
2024-04-04 19:11:21 +03:00
Hansen Kurli
6ec79b5605 Merge "Create directory for /data/misc/connectivityblobdb" into main 2024-03-20 20:27:18 +00:00
Dennis Shen
9e17d3a032 turn on aconfigd in init
Bug: b/312444587
Test: avd
Change-Id: Ibc88b57f88f924318d54ae81c70fd8da1fc1b437
2024-03-20 16:33:28 +00:00
Dennis Shen
a8a6d67f29 Merge "Revert "start aconfig storage daemon"" into main 2024-03-15 19:16:42 +00:00
Android Culprit Assistant
71179955f7 Revert "start aconfig storage daemon"
This revert was created by Android Culprit Assistant. The culprit was identified in the following culprit search session (http://go/aca-get/2def2bc9-4177-4451-930d-96612adf7d95).

Change-Id: I232a36309883bff892fff5a5d43fd1432d7f1c6e
2024-03-15 19:06:14 +00:00
Dennis Shen
e7abebc01d Merge "start aconfig storage daemon" into main 2024-03-14 12:17:53 +00:00
Dennis Shen
07afcabf67 start aconfig storage daemon
Bug: b/312444587
Test: m and launch AVD
Change-Id: I92946fc4ec2100d995300c58ef6045ae5b40f13a
2024-03-13 19:16:29 +00:00