Commit graph

1742 commits

Author SHA1 Message Date
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
Bart Van Assche
7f3fe0aaf2 Make foreground and background I/O priority different
The default I/O priority is "best effort" so the combination of "none"
and "restrict-to-be" is not sufficient to make foreground and background
I/O priorities different. This CL makes sure that foreground and
background I/O priorities are different.

As one can see, this CL has the intended effect in Cuttlefish:
$ adb -s 0.0.0.0:6520 shell 'cd /dev/blkio && grep -aH . blkio.prio.class background/blkio.prio.class'
blkio.prio.class:promote-to-rt
background/blkio.prio.class:restrict-to-be

Bug: 186902601
Change-Id: I24d30d360280d8c398684b0b5e88635f658ff870
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-03-12 13:30:40 -07:00
Jiakai Zhang
22ddb0aec5 Allow other processes to run snapshotctl through init.
Running snapshotctl involves talking to gsid, which requires the UID to
be 0. To allow other processes to run snapshotctl without running as the
root user, this change adds system properties "sys.snapshotctl.map" and
"sys.snapshotctl.unmap" that proxy snapshotctl calls.

Bug: 311377497
Test: adb shell setprop sys.snapshotctl.map requested
Test: adb shell setprop sys.snapshotctl.unmap requested
Change-Id: Ia29dde30021a94511b8e699c2c8f3816b851bf5c
2024-03-08 18:53:47 +00:00
Jiakai Zhang
699f27913f Create /mnt/pre_reboot_dexopt on init for Pre-reboot Dexopt.
Bug: 311377497
Test: manual - Boot the device and see the directory.
Change-Id: I083e0dc3c8d16839122a42fc3d00cdcac07a5cb8
2024-02-29 21:41:41 +00:00
Treehugger Robot
87e978bc47 Merge "aconfig_storage: fix aconfig storage dir permissions" into main 2024-02-29 01:01:11 +00:00
Dennis Shen
6884e27d8e aconfig_storage: fix aconfig storage dir permissions
Bug: b/312444587
Test: m and launch AVD
Change-Id: I8db6bf8ffde40c9266e17d818d1e88d7e095a93e
2024-02-28 21:20:35 +00:00
Florian Mayer
877d1f6694 Make tombstones 664.
They are still restricted by SELinux, and apps still cannot open them
because they don't have `open` SELinux permission.

Bug: 312740614
Change-Id: I83b7e6ed39f5af64f161af3b3e8e33af0d125b20
2024-02-23 15:31:30 -08:00
Dennis Shen
61d9e2ab8d init.rc: create /metadata/aconfig, /metadata/aconfig/flags and
/metadta/aconfig/boot dirs

Create aconfig dirs on /metadata to store aconfig storage related files.

Under /metadata/aconfig we will store the following pb files:

1, aconfig_storage_location.pb, store the location of the storage files for
each container.

2, aconfig_flag_persistent_overrides.pb, store the local flag value overrides.

Under /metadata/aconfig/flags we will store flag value and info files
for each container, this include:

1, <container_name>.val flag value file
2, <container_name>.info flag info file

Under /metadata/aconfig/boot we will store read only flag value files
copied from /metadata/aconfig/flags at boot. These read only files are
used to serve flag read queries.

Bug: 312444587
Test: m
Change-Id: I8ae06e56fc9b9e8c0b06f86e3deb4219d7f49660
2024-02-13 20:47:13 +00:00
Bart Van Assche
0cf102b703 Restore I/O priority support
CL aosp/2929791 removed I/O priority support to prepare for a clean
revert of the CL that migrates the blkio controller from the v1 to the
v2 cgroup hierarchy. Since there was no other reason to revert the I/O
priority CL, restore I/O priority support.

Bug: 186902601
Change-Id: I1a4053140ab55973878bfeacfb546da3c601a895
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-02-01 10:52:13 -08:00
Treehugger Robot
761db93167 Merge changes from topic "b314861914" into main
* changes:
  Revert "Migrate the blkio controller to the v2 cgroup hierarchy"
  Revert "task_profiles.json: Set io.prio.class"
2024-01-26 15:38:44 +00:00
Youngtae Cha
6392be617b Merge "A new folder to store OTA telephony config update" into main 2024-01-26 15:37:46 +00:00
Randall Huang
d0ce4ca33c Revert "Migrate the blkio controller to the v2 cgroup hierarchy"
This reverts commit f99ca8aeb1.

Reason for revert: b/2768906

Change-Id: I9ce259a2c96e9f8dd8c7598204c35922b56f7a0a
2024-01-26 03:54:47 +00:00
Kangping Dong
236c7060cd [Thread] create dir /dev/socket/ot-daemon
ot-daemon may use multiple unix sockets so create a dir for it.

Bug: 320451788
Test: verified that ot-daemon can create socket
/dev/socket/ot-daemon/thread-wpan.sock

Change-Id: I43ccb11ed664cf0d59fc02e2efc721ed7284e2a0
2024-01-22 01:22:36 +08:00
Yu-Ting Tseng
80b2bf16c9 Merge "Add AID_UPROBESTATS and set up its config dir." into main 2024-01-20 03:59:30 +00:00
youngtaecha
63da53fdde A new folder to store OTA telephony config update
Bug: 320002105
Test: Build, checked /data/misc/telephonyconfig is system radio

Change-Id: Id8efee15594f372fa6aaf3fe9b9081a3cefe327b
2024-01-13 14:58:58 +00:00
Kangping Dong
680c4a332f Revert "init.rc: create /data/misc/threadnetwork folder"
This reverts commit 40e1666fb9.

Reason for revert: this directory is for the Thread stack which is
in the Tethering mainline module. Per mainline guideline, the data
should be saved in a APEX specific directory (i.e.
/data/misc/apexdata/com.android.tethering). It's safe to remove this
directory directly given this is a new feature targeting Android V

Bug: 309932508
Test: manually verified that Thread settings file can be written to
      /data/misc/apexdata/com.android.tethering/threadnetwork
Change-Id: I3a7e24b4cdc1c99ca36a22414507538279dd31cd
2024-01-03 23:02:58 +08:00
Hansen Kurli
731972b086 Create directory for /data/misc/connectivityblobdb
Create a new folder for connectivity blobs, to be used by
ConnectivityBlobStore for VPN and WIFI to replace legacy
keystore. System server and Settings app will need permissions
to manage databases in the folder.

Bug: 307903113
Test: build and manual test to confirm folder is created.
Change-Id: I3b558d8d5913e0d3d1efe5cb56d5f7f2e84fd22a
2023-12-19 19:27:31 +08:00
Peter Collingbourne
cee7fcd001 Mount /tmp as tmpfs.
/tmp is a volatile temporary storage location for the shell user.
As with /data/local/tmp, it is owned by shell:shell and is chmod 771.

Bug: 311263616
Change-Id: Ice0229d937989b097971d9db434d5589ac2da99a
2023-12-15 16:46:46 -08:00
Yu-Ting Tseng
38cb94d32a Add AID_UPROBESTATS and set up its config dir.
Test: m, flash and reboot
Bug: 296108553
Change-Id: Ied5e688db8e93874ad66610c4d98c39d892d268b
2023-11-29 10:56:37 -08:00
Bart Van Assche
f99ca8aeb1 Migrate the blkio controller to the v2 cgroup hierarchy
There are multiple use cases in Android for which background writes need
to be controlled via the cgroup mechanism. The cgroup mechanism can only
control background writes if both the blkio and memcg controllers are
mounted in the v2 cgroup hierarchy. Hence this patch that migrates the
blkio controller from the v1 to the v2 cgroup hierarchy.

The changes compared to the previous version of this CL are as follows:
- The JoinCgroup actions for the "io" controller have been left out
  since these caused processes to be migrated to the v2 root cgroup.
- The BfqWeight / CfqGroupIdle / CfqWeight settings have been included
  in this CL instead of applying these settings as a separate CL.

Change-Id: I67e06ce3462bb1c1345dba78f8d3d655b6519c74
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-17 11:37:24 -08:00
Shin-Yu Wang
3b16967f0f Revert "Reapply "Migrate the blkio controller to the v2 cgroup hierarchy""
This reverts commit d71f9e5fbb.

Reason for revert: p0 failed test (b/308687042)

Change-Id: I3d8cb899d79634bb1c80f7d05af5c1311358c25c
2023-11-01 06:26:31 +00:00
Bart Van Assche
d71f9e5fbb Reapply "Migrate the blkio controller to the v2 cgroup hierarchy"
This reverts commit c7a6fe684c.
Repply the blkio controller migration because it was not responsible
for the test failures that led to the revert. See also the following bugs:
* https://b.corp.google.com/issues/260143932
  (v2/android-virtual-infra/test_mapping/presubmit-avd test failure)
* https://b.corp.google.com/issues/264620181
  (CtsInitTestCases.RebootTest#StopServicesSIGKILL failure)

The only change compared with the previous version is that the io
controller has been declared optional. This is necessary because some
devices have a kernel that does not support the io controller.

Bug: 213617178
Test: Cuttlefish and various phones
Change-Id: I490740e1c9ee4f7bb5bb7afba721a083f952c8f2
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-10-30 16:55:14 -07:00
Treehugger Robot
b5ce7aa444 Merge "disable sync_on_suspend when flag is set" into main am: cfec879ad6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2762661

Change-Id: I44e9af64a4562ede087007cfb19e070ad0ed3a6a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 00:52:03 +00:00
Steve Muckle
5ebc657386 disable sync_on_suspend when flag is set
Bug: 285395636
Test: suspend/resume testing
Change-Id: I2d97d8366b864ab3e72d7ae38a0f4906dc74ec6f
2023-09-27 16:36:26 +00:00
Thiébaud Weksteen
9229827386 Merge "Skip /metadata/sepolicy creation" into main am: 911d309224
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2761545

Change-Id: I7acfa6f5cb28f051ca5fae7d641d216fe5254fcf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-25 08:12:00 +00:00
Thiébaud Weksteen
a6b5f94687 Skip /metadata/sepolicy creation
Bug: 297794885
Test: presubmit
Change-Id: I93f94f319d0f86e1cad6f2a4912b5df3aae09cec
2023-09-25 16:07:47 +10:00
Xin Li
4484eb1bfd Merge Android U (ab/10368041)
Bug: 291102124
Merged-In: I849958d9e9de3be48e32f57acc7b3526e184482c
Change-Id: Ic765b54aa981b6370b5dff6b4cf046bbe9fbdbaf
2023-08-25 13:54:47 -07:00
Treehugger Robot
a2bac909ce Merge "Run boringssl tests according to ro.zygote" into main 2023-08-22 12:55:07 +00:00
Po-yao Chang
6fe9367f7b Run boringssl tests according to ro.zygote
If ro.zygote is zygote64, don't bother running 32-bit test.
Otherwise abilist{32,64} decides what tests to run.

Bug: 291874369
Test: make gsi_arm64-user; Check /system/etc/init/hw
Change-Id: Id10b2242606d6400acc29c3174f713581d6cce2e
2023-08-10 17:12:47 +08:00
Jooyung Han
5c4217cf6e Read .rc files from bootstrap apexes
To start an early_hal service from a bootstrap vendor apex, init now
reads .rc files from bootstrap apexes as well.

In this change, perform_apex_config command is re-purposed to support
bootstrap mode. Now we have some similarity between two apexd calls:

- for bootstrap apexes (in the bootstrap mount namespace):

  exec_start apexd-bootstrap
  perform_apex_config --bootstrap

- for normal apexes (in the default mount namespace):

  restart apexd
  ...
  wait_for_prop apexd.status activated
  perform_apex_config

Note that some tasks in perform_apex_config are not needed in the
bootstrap.  For example, we don't need to create apexdata directories
for bootstrap apexes.

Bug: 290148081
Test: VendorApexHostTestCases
Change-Id: I8f683a4dcd7cd9a2466a4b1b417d84c025c37761
2023-08-10 15:40:06 +09:00
Lee George Thomas
2493d50328 Create /data/misc/bootanim folder in init.rc.
This folder is used to host bootanim data files.

Bug: 210757252
Test: /data/misc/bootanim is correctly created.
Change-Id: I9c9949316d073ad7ebac503f097c5fee6c0b2a22
2023-07-25 15:07:17 -07:00
Eric Biggers
42164ff920 Merge changes from topic "fsverity-init-cleanup" into main
* changes:
  init.rc: stop using fsverity_init --lock
  init: remove unfinished fsverity signature support for APEX sepolicy
2023-07-17 20:10:28 +00:00
David Anderson
f489314dec Merge changes from topic "lpdump-snapshots" into main
* changes:
  Remove local_include_dirs from fs_mgr_defaults.
  Allow processes in the "system" group to read /metadata/ota.
2023-07-17 16:55:14 +00:00
David Anderson
a71faae86f Allow processes in the "system" group to read /metadata/ota.
lpdumpd runs as "system", not "root". Adjust the DAC permissions of
/metadata/ota so it can call SnapshotManager::Dump.

Bug: 291083311
Test: lpdump
Change-Id: I97fd7eb2055cf6d31fd42f1021e2f99edbdb838a
2023-07-14 09:01:05 -07:00