Commit graph

3109 commits

Author SHA1 Message Date
Pete Bentley
c017e2ce0a Move boringssl self tests from early-init to init.
In previous releases, these self tests had a secondary purpose
of writing a flag file to save future processes from running
some slow self checks.  This is no longer true in T.

However running the tests from early-init has caused issues
on some devices as the kernel's entropy pool is not yet
initialised, causing the process to block for a second or more.

Bug: 231946889
Test: m && flashall
Change-Id: I2116f2029ca6a21e4359407dfff4dc79edd39084
2022-07-07 15:34:46 +01:00
Xin Li
ebe6598a1c Merge tm-dev-plus-aosp-without-vendor@8763363
Bug: 236760014
Merged-In: Ia927c19f544536f78c20ccef5830bd1be0cebf9b
Change-Id: I0267b9eaad470a56db68f3a0b99abfc41192c6d7
2022-06-28 21:23:43 +00:00
Almaz Mingaleev
2f38c39169 Do not create /data/misc/zoneinfo.
APK time zone update mechanism used to store tzdata file there.
The feature is removed, no need to create that folder.

Bug: 148144561
Test: atest CtsBionicTestCases
Test: atest BionicTzdbConsistencyTest

Change-Id: I249f1d1b6c1a3f1a283d1ca43fcc93b10cbd910a
2022-06-23 17:21:39 +01:00
Almaz Mingaleev
7f79ee42ee Merge "Remove TZUvA feature." 2022-06-23 07:47:26 +00:00
Treehugger Robot
247a07b481 Merge "charge the permissions for the proc/bootconfig" am: 5683591ff9 am: b6ac0cc227
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2121492

Change-Id: I35510e58ec908d42cab162c3e5544fdbbc0eea7b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 21:32:17 +00:00
zexin.hou
46314853fe charge the permissions for the proc/bootconfig
The current/proc/bootconfig node is the root user group,but some Android modules of our company do not have permission to access the root user group node. We want to add the same permissions to /proc/cmdline for the proc/bootconfig node in init.rc

Change-Id: I98f63a09cf7306be65c40674b1b28f1153c705fb
2022-06-13 12:42:47 +00:00
Almaz Mingaleev
9d3da34bb4 Remove TZUvA feature.
The feature was superseded by tzdata mainline module(s).

Bug: 148144561
Test: see system/timezone

Change-Id: If87e9a71a725f665bfc977d95e52c04668447081
Merged-In: If87e9a71a725f665bfc977d95e52c04668447081
2022-06-13 11:45:38 +00:00
Treehugger Robot
627897b869 Merge "init.rc: restorecon /data/media before chattr" am: 3a728ac7c6 am: 71fca25a67
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2098435

Change-Id: If29ff328709c50b25cb3259c83ebaa5dc9c18944
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 00:43:18 +00:00
Eric Biggers
dce8ba253e init.rc: restorecon /data/media before chattr
The SELinux type of /data/media has changed from media_rw_data_file to
media_userdir_file, but the recursive restorecon of /data happens too
late when taking an upgrade.  Add a restorecon of /data/media to just
above the chattr command which needs the new label to be allowed.  This
doesn't "really" matter, since the chattr command is only needed just
after the directory was created anyway, but this fixes a SELinux denial.

Bug: 156305599
Bug: 232824121
Change-Id: I897be19ceb4686511469bdf7efda2483f298eee4
2022-05-17 02:40:22 +00:00
Treehugger Robot
c96cc03eb0 Merge "Change the encryption rule of /data/bootanim to DeleteIfNecessary" am: e4200bac8d am: e19ae58831
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2097855

Change-Id: I7f1438d090421725ea804a322e7703fbcd72fbbc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 22:22:36 +00:00
Eric Biggers
5aacd5b536 Merge "Annotate and consolidate use of encryption=None" am: 47742ecc54 am: b6fcba892b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2093957

Change-Id: Icde6e5f76ea5dbe74ef8ac2828e2d5a1760a11c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 21:37:02 +00:00
Treehugger Robot
e4200bac8d Merge "Change the encryption rule of /data/bootanim to DeleteIfNecessary" 2022-05-13 21:27:36 +00:00
Eric Biggers
72c781df26 Annotate and consolidate use of encryption=None
Although metadata encryption makes the device encryption policy
redundant, for now it is still being used, and the rule is still that
every top-level directory in /data is encrypted by the device policy
unless there is a specific reason why the directory can't be encrypted.
There are various cases where encryption=None is legimately needed and
is used, but they aren't explained in the code, and the option is prone
to be copy-and-pasted (as was done in https://r.android.com/1932960).

Fix this by explicitly commenting every case where encryption=None is
used, and consolidating the creation of all the user parent directories
into one place.  (I left /data/bootanim as-is since it will be changed
to encrypted; see b/232299581.)

Change-Id: I6db5f4be7774e3d250c370638e8e7e33e226f3e7
2022-05-13 17:48:51 +00:00
Josh Yang
a1039f9a4b Change the encryption rule of /data/bootanim to DeleteIfNecessary
Directories should always be encrypted unless there is a specific reason
they can't be.  /data/bootanim is unencrypted without a specific reason,
so fix it to be encrypted.  It is too late to use encryption=Require.
However, the contents of this directory doesn't need to be preserved on
updates, so we can use encryption=DeleteIfNecessary instead of
encryption=Attempt.

Bug: 232299581
Test: build success
Change-Id: I17bcb901ad533cada4e0aa061196fc94d7b213ec
2022-05-13 17:02:48 +00:00
Jooyung Han
c2d6134c2b add apex-ready event after post-fs-data am: 1eb3394e9c am: 72a7532648
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2093005

Change-Id: I59dc322c0c3d22daa3870edc147046704b8b3f8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 03:55:41 +00:00
Jooyung Han
72a7532648 add apex-ready event after post-fs-data am: 1eb3394e9c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2093005

Change-Id: I57b58e139a1cf3f01de3cb8eea4379a5395bae61
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 03:13:11 +00:00
Jooyung Han
ec76b5cb4e Merge changes from topics "action-in-apex-config", "apex-ready-event", "subcontext-for-vendor-apex"
* changes:
  Use subcontext for APEX configs from /{vendor, odm}
  add apex-ready event after post-fs-data
  APEX configs support 'on' as well
2022-05-13 01:47:40 +00:00
William Escande
4e1e3e5575 Set the aptx as provided by system am: e41474eae5
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/18337263

Change-Id: I227f48349cd24f10053d2f0e6f85bf64a525295a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 23:37:31 +00:00
Eric Biggers
93a8fc215e Merge "Move creation of /data/user/0 and /data/media/obb to vold" 2022-05-12 18:41:21 +00:00
Pete Bentley
ba830eb81b Remove setenvs when running boringssl_self_test.
No longer needed as the code to generate flag files based on
this environment variable is removed in Android 13.

Bug: 231946889
Test: Build and boot,
Change-Id: I8ce57619aa4d1e6457f3f864bf5e403f727c040c
2022-05-12 13:50:37 +01:00
Jooyung Han
1eb3394e9c add apex-ready event after post-fs-data
Since apexd.status=ready is system-only property, we need a similar or
equivalent event or property which non-system APEXes can use to define
'on' trigger actions.

Note that services can be started without its own trigger actions by
setting 'class'. For example, 'hal'-class services are started 'on boot'
automatically.

Bug: 202731768
Test: atest CtsInitTestCases
Test: atest CtsBluetoothTestCases (cuttlefish's bt apex defines
   'on' actions in the APEX config)
Change-Id: I6eb62ba8d6e350add2ebafe7da06fcaa57d825ff
2022-05-12 13:37:19 +09:00
William Escande
e41474eae5 Set the aptx as provided by system
Aptx and aptx-Hd are both vendor libs in system_ext.
In order to load their dependencies from a compatible environement
Bluetooth need to setup the linker

Fix: 231967310
Test: atest net_test_stack_a2dp_native
Test: Log analyze after bluetooth boot
Tag: #refactor
Ignore-AOSP-First: Apex only on tm and below
Change-Id: I752e65889a42fe3378f51bd0821c2958ed9b5a7d
2022-05-11 21:14:41 -07:00
Eric Biggers
ef9275223c Move creation of /data/user/0 and /data/media/obb to vold
To prevent bugs, directory creation and encryption should happen
together.  /data/user/0 (and its "alias" /data/data) is a per-user
encrypted directory; such directories can only be encrypted by vold.
Therefore, move its creation to vold as well.

Besides closing the uncomfortably-large gap between the creation and
encryption of /data/user/0, this allows removing init's write access to
/data/user and similar directories (SELinux type system_userdir_file) to
prevent any such issues from being reintroduced in the future.

To also allow removing init's write access to /data/media (SELinux type
media_userdir_file), which also contains per-user encrypted directories,
also move the creation and encryption of /data/media/obb to vold.

Bug: 156305599
BYPASS_INCLUSIVE_LANGUAGE_REASON=Linux API ("slave" mount flag)
Change-Id: I7245251eeb56b345b6c7711482c0aa5848648edb
2022-05-11 21:50:35 +00:00
Richard Chang
6f554d1a2a Remove redundant settings in init.rc for cpu scaling_max_freq
The uevent.rc will setup owner/group/permissions in all the conditions
including device boot, cpu hotplugs, and cpu online/offline.
Since ueventd always regenerates uevents at boot, we could remove the
redundant settings in init.rc.

Bug: 230291215
Test: Build and check scaling_max_freq on Cuttlefish and B3 device
Change-Id: I4fcc440f2a950967667f88da574faa501b3e227c
2022-05-11 08:55:27 +00:00
Richard Chang
cbd75b85a2 Align file permissions for cpufreq scaling_max_freq node
The ueventd.rc sets permissions to 0664 but init.rc sets cpu0 to
0660. Since lots of processes already had read access for cpufreq nodes
(refer to system/sepolicy/public/domain.te), align all cpus to 0644
permissions.

Bug: 230291215
Test: Build
Change-Id: I3c72d69590998f8da894fb02097212f834edd48c
2022-05-09 09:12:58 +00:00
Daeho Jeong
bc752d279f Merge "init.rc: increase readahead window multiplier for POSIX_FADV_SEQUENTIAL files" into tm-dev 2022-05-04 15:37:48 +00:00
Jaegeuk Kim
45aafa58d4 Merge "Support /dev/fscklogs/log in f2fs back" 2022-05-04 07:35:09 +00:00
Treehugger Robot
04afe0c3dc Merge "Delete stale Virtualization image files" 2022-05-03 09:28:57 +00:00
Jaegeuk Kim
3aca50cb9e Support /dev/fscklogs/log in f2fs back
We need to fix the below error happening in early stage.

[   24.835617][    T1] init: [libfs_mgr]Running /system/bin/fsck.f2fs -a -c 10000 --debug-cache /dev/block/sda1
[   24.843693][    T1] logwrapper: Cannot log to file /dev/fscklogs/log

Bug: 230637147
Bug: 230879192
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I19bc5f7154577e29414f855de6ce72172b281975
2022-05-02 15:06:43 -07:00
Daeho Jeong
2a7bd96c19 init.rc: increase readahead window multiplier for POSIX_FADV_SEQUENTIAL files
Set readahead window multiplier for POSIX_FADV_SEQUENTIAL files as 16 to
enhance file read performance like a language package loading.

Bug: 192011293
Test: adb shell cat /dev/sys/fs/by-name/userdata/seq_file_ra_mul
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Change-Id: I7f7e4339651be2d6aa99b07bcb12ab62136a940e
Merged-In: I7f7e4339651be2d6aa99b07bcb12ab62136a940e
2022-05-02 10:52:11 -07:00
Daeho Jeong
431e35ef7c init.rc: increase readahead window multiplier for POSIX_FADV_SEQUENTIAL files
Set readahead window multiplier for POSIX_FADV_SEQUENTIAL files as 16 to
enhance file read performance like a language package loading.

Bug: 192011293
Test: adb shell cat /dev/sys/fs/by-name/userdata/seq_file_ra_mul
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Change-Id: I7f7e4339651be2d6aa99b07bcb12ab62136a940e
2022-04-29 11:52:03 -07:00
Alan Stokes
df84dd93e5 Delete stale Virtualization image files
Delete all files and directories under
/data/misc/virtualizationservice at boot. Originally they were owned
by the virtualizationservice user; we now run as system, and don't
have permission to remove them after boot.

Bug: 230056726
Test: Create fake stale dir+file, see them deleted
Change-Id: I5ff7d055aeeb25ba7693e50876d6b8a830c4bf51
(cherry picked from commit 34ee0c931c)
2022-04-29 10:56:19 +00:00
Alan Stokes
34ee0c931c Delete stale Virtualization image files
Delete all files and directories under
/data/misc/virtualizationservice at boot. Originally they were owned
by the virtualizationservice user; we now run as system, and don't
have permission to remove them after boot.

Bug: 230056726
Test: Create fake stale dir+file, see them deleted
Ignore-AOSP-First: Needed in T, will CP to aosp
Change-Id: I5ff7d055aeeb25ba7693e50876d6b8a830c4bf51
2022-04-28 10:57:36 +01:00
Jiyong Park
1a2dbd917e Remove stale files in /data/misc/virtualizationservice
[1] changed the UID of the virtualizationservice daemon and
/data/misc/virtualizationservice directory to `system`. However, this
can cause a permission denial issue when the directory has stale files
when the device was running a build before [1] and an OTA to [1] (or
above) is attempted. The daemon tries to delete the stale files - which
must have been still labeled as old UID and thus the daemon has no
privileged to delete them.

Fixing this issue by ensuring that the directory is always empty by
init.

[1] https://android-review.googlesource.com/c/platform/packages/modules/Virtualization/+/2059527

Bug: 230056726
Test: watch TH
Merged-In: I61c0297503347932b14b83859bec9ff82628336f
Change-Id: I61c0297503347932b14b83859bec9ff82628336f
2022-04-25 09:47:12 +09:00
Jiyong Park
97cc69ee5d Remove stale files in /data/misc/virtualizationservice
[1] changed the UID of the virtualizationservice daemon and
/data/misc/virtualizationservice directory to `system`. However, this
can cause a permission denial issue when the directory has stale files
when the device was running a build before [1] and an OTA to [1] (or
above) is attempted. The daemon tries to delete the stale files - which
must have been still labeled as old UID and thus the daemon has no
privileged to delete them.

Fixing this issue by ensuring that the directory is always empty by
init.

[1] https://android-review.googlesource.com/c/platform/packages/modules/Virtualization/+/2059527

Bug: 230056726
Test: watch TH
Change-Id: I61c0297503347932b14b83859bec9ff82628336f
2022-04-25 09:47:03 +09:00
Jiyong Park
93c66bbd89 Virtualizationservice is owned by the system UID
Previously, virtualizationservice had its own UID
`virtualizationservice`. As a result, crosvm, which is spawed by
virtualizationservice`, also run as the UID. However, that prevented us
from applying task profiles to the crosvm process because joining a
process to a cgroup requires system UID.

To fix that, virtualizationservice now runs as system UID. As a result,
this directory that virtualizationservice accesses has to change its
owner and group to system.

Bug: 223790172
Bug: 216788146
Test: watch TH

Change-Id: I2bdf49e99f1841bf77ff046b0c2455064b174e0a
2022-04-15 00:05:38 +09:00
Jiyong Park
5b178328a3 /dev/[kvm|vhost-vsock] are owned by system
/dev/kvm and /dev/vhost-vsock are used by crosvm. Previously, it ran as
a custom UID `virtualizationservice`. However, this prevented us from
applying task profiles to the crosvm process because joining a process
to a cgroup requires system UID.

Now, crosvm (and its parent virtualizationservice as well) runs in
system UID. Therefore, the ownership of two device files are also
updated accorgly.

BUG=b:216788146
BUG=b:223790172
Test: watch TH

Change-Id: I1f63a12532d3a2cb5724291dbbb40210bd7c9203
2022-04-15 00:05:38 +09:00
Kalesh Singh
cb965e093c Merge "Set Multi-Gen LRU enabled based on experiment prop" 2022-04-12 13:48:48 +00:00
Christopher Ferris
da94c7f650 Add support for only starting 64 bit zygote.
This is part of the changes that will allow creating a single
system image but a different set of properties will either
start or not start the secondary zygote.

Bug: 227482437

Test: Verified that secondary doesn't start with same system image
Test: with ro.zygote set to zygote64 and abilists set appropriately.
Test: Verified that secondary does not start when restarting netd.
Test: Verified that secondary does start with same system image
Test: with ro.zygote set to zygote64_32 and abilists set appropriately.
Test: Verified that secondary does start when restarting netd.
Test: Verified that a 64 bit device only starts the primary.
Test: Verified that a 32 bit device only starts the primary.
Change-Id: Id37a223c73f9a61868b2e26450ef4b6964f7b496
2022-04-11 14:18:59 -07:00
Kalesh Singh
bd42559beb Set Multi-Gen LRU enabled based on experiment prop
Experiments can enable/disable MG-LRU using the
persist.device_config.mglru_native.lru_gen_enabled property
which will update the coresponding sysfs control to enable or
disable this feature in the kernel.

Test: adb shell device_config put mglru_native lru_gen_config [none, core, ...]
Test: verify MG RLU is enabled/disabled: cat /sys/kernel/mm/lru_gen/enabled
Bug: 227651406
Bug: 228525049
Change-Id: I0708df8c78a85359d5cb6d5b167836768029380e
2022-04-08 13:54:10 -07:00
Shikha Panwar
4b91af7d24 [Init] Create dir for odsign metrics
This is required so that system_server can read/delete the file(s) in
/data/misc/odsign/metrics & report to statsd

Note the group change in odsign directory was required so that
system_server can get the execute permission to read file in the sub dir

Test: adb shell ls -l /data/misc/odsign/metrics
Bug: 202926606
Change-Id: I6dd80e05bbfb9daf4aa3e996fc22bba1de8bd2ce
2022-04-06 17:51:08 +00:00
Bart Van Assche
159563561a Revert "Migrate the blkio controller to the v2 cgroup hierarchy"
Revert "Migrate the blkio controller to the cgroup v2 hierarchy"

Revert "Migrate the blkio controller to the cgroup v2 hierarchy"

Revert "Migrate the blkio controller to the cgroup v2 hierarchy"

Revert submission 1962326-blkio-cgroup-v2

Reason for revert: This set of changes is suspected to have caused a redfin boot time regression for the git_tm-dev branch.

Reverted Changes:
Id18d876b6:Migrate the blkio controller to the cgroup v2 hier...
I7dfa52136:Migrate the blkio controller to the v2 cgroup hier...
I5336167be:Migrate the blkio controller to the cgroup v2 hier...
I3f0131d8f:Migrate the blkio controller to the cgroup v2 hier...
Ibb62b2d4d:Migrate the blkio controller to the cgroup v2 hier...

Bug: 227382327
Bug: 227389363
Change-Id: I6c8183ed1c3044c8947c4fca07799deff98101b3
2022-03-30 14:58:20 +00:00
Bart Van Assche
07f6c82a4c Migrate the blkio controller to the v2 cgroup hierarchy
This patch preserves the following parameter values:
* Foreground BFQ weight:      100
* Foreground CFQ group_idle:    0
* Foreground CFQ weight:     1000
* Background BFQ weight:       10
* Background CFQ group_idle:    0
* Background CFQ weight:      200

The foreground BFQ weight in task_profiles.json is the default BFQ
weight. From
https://www.kernel.org/doc/Documentation/block/bfq-iosched.txt:
"weight (namely blkio.bfq.weight or io.bfq-weight): the weight of the
group inside its parent. Available values: 1..10000 (default 100). The
linear mapping between ioprio and weights, described at the beginning
of the tunable section, is still valid, but all weights higher than
IOPRIO_BE_NR*10 are mapped to ioprio 0."

Bug: 213617178
Test: Booted Android in Cuttlefish and ran the following test:
Test: adb -e shell cat /sys/fs/cgroup/*/*/io.bfq.weight | sort | uniq -c
Test: 22 default 10
Test: 98 default 100
Change-Id: I7dfa521363a316592852fecce9192708c7a90514
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-28 20:56:15 +00:00
Eric Biggers
0c9413d883 Merge "init.rc: remove commented-out code that set vold.post_fs_data_done" 2022-03-22 03:42:23 +00:00
Eric Biggers
881ca51a84 init.rc: remove commented-out code that set vold.post_fs_data_done
The "vold.post_fs_data_done" system property was only used by FDE, which
is no longer supported, and this code was commented out anyway.

Bug: 208476087
Change-Id: Ib9346d14368c77058a598e5c4f5f2ed72f5a5316
2022-03-21 22:15:53 +00:00
Florian Mayer
daedc740c9 Add etc to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I0edc35a73fe6760ffe52127d246fde4fe3980bbc
2022-03-18 21:38:47 +00:00
Treehugger Robot
4c7dc7bd1d Merge changes from topic "sys_rootdisk"
* changes:
  Init: add dev.mnt.blk.bootdevice to access device sysfs
  init: mount_handler: detect main block device more reliably
  init.rc: use /sys/class/block instead of /sys/devices/virtual/block
2022-03-16 22:44:01 +00:00
Jaegeuk Kim
120f6b260c Init: add dev.mnt.blk.bootdevice to access device sysfs
This patch adds a new property, 'dev.mnt.root.<mount_point>', which provides,
for example of /data,

1. dm-N
  dev.mnt.dev.data = dm-N
  dev.mnt.blk.data = sdaN or mmcblk0pN
  dev.mnt.rootdisk.data = sda or mmcblk0

2. sdaN or mmcblk0pN
  dev.mnt.dev.data = sdaN or mmcblk0pN
  dev.mnt.blk.data = sdaN or mmcblk0pN
  dev.mnt.rootdisk.data = sda or mmcblk0

Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I0a58a62d416f966f26b5de04112c2f9a7eceb22c
2022-03-14 16:59:52 -07:00
Juhyung Park
852111eea4 init.rc: use /sys/class/block instead of /sys/devices/virtual/block
/sys/class/block covers all of dm-[0-9], sd[a-z], mmcblk[0-9].
Use it instead of /sys/devices/virtual/block, which only covers dm
devices.

This allows f2fs tunings to be applied more reliably regardless of
how the userdata partition is set up.

Do note that while everything under /sys/devices/virtual/block are
expected to have correct SELinux labels by AOSP, some under
/sys/class/block are not as it's symlinked to platform-specific paths,
and it is up to the vendors to label them correctly.

Test: Confirm entries under /dev/sys aren't dangling and cp_interval,
      gc_urgent_sleep_time, iostat_enable and discard_max_bytes are
      all set up properly under FBE, FDE and unencrypted.
Change-Id: I089af5bc068445f33919df6659671e50456d49f9
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
2022-03-06 00:31:20 -08:00
Pirama Arumuga Nainar
9868487540 Set '%c' in LLVM_PROFILE_FILE for continuous mode
Bug: http://b/194128476

If CLANG_COVERAGE_CONTINUOUS_MODE is set, enable continuous mode by
adding '%c' to LLVM_PROFILE_FILE.

Test: CLANG_COVERAGE_CONTINUOUS_MODE m and verify continuous mode works.
Change-Id: I8ace01f2aeaef62857e73308b04a535739171b53
2022-03-04 12:47:55 -08:00
Colin Cross
86b6db0b0f Merge "Use sanitizer paths exported by make" 2022-02-18 03:39:26 +00:00
Colin Cross
21527e9794 Use sanitizer paths exported by make
The clang prebuilts now provide a single module with per-architecture
variants instead of a module per architecture, which means the module
name doesn't match the installed file name.  Use the file names
exported from Soong instead of the module names.

Bug: 220019988
Test: m out/target/produuct/coral/system/etc/sanitizer.libraries.txt
Change-Id: I12e7e988ce60d928987db8611883e67f2ecdee87
2022-02-17 11:19:48 -08:00
Peter Collingbourne
15a20e3906 Merge "Reland "Add a core configuration that disables the zygote."" 2022-02-17 18:37:21 +00:00
Peter Collingbourne
d22ff8a93a Reland "Add a core configuration that disables the zygote."
In targets that do not include a zygote binary, attempting to start the
zygote service will result in repeated service restarts. Avoid this by
providing a way for targets to opt out of declaring a zygote service.

The fvp_mini target does not have a zygote, so apply this opt-out to
that target.

Relanding after fixing breakage on an internal branch.

Bug: 217455793
Change-Id: Ic26f76142afb5f700bd7b12359d62feb2652b617
2022-02-15 16:03:35 -08:00
Bob Badour
3332e2127a Declare license metadata for copied files.
Bug: 151177513

Test: m nothing reportmissinglicenses
Change-Id: I2d06c042e41eda55930ea3b49efd9f27e35bc520
2022-02-12 21:20:41 -08:00
Jordan Demeulenaere
13041ef021 Merge "Revert "Add a core configuration that disables the zygote."" 2022-02-07 14:53:40 +00:00
Jordan Demeulenaere
09dacde8ab Revert "Add a core configuration that disables the zygote."
Revert "Add a core configuration that disables the zygote."

Revert submission 1964759-master-I4f918502e611e950fa039e4e2ed817c97b928ba2

Reason for revert: b/217993447
Reverted Changes:
I4f918502e:Add a core configuration that disables the zygote....
I4f918502e:Add a core configuration that disables the zygote....
I4f918502e:Add a core configuration that disables the zygote....

Change-Id: I9dc73c6338ed158bd712324b99ae9e3cd4a36424
2022-02-07 09:05:29 +00:00
Treehugger Robot
a1a2c257f3 Merge "Add a core configuration that disables the zygote." 2022-02-04 23:52:33 +00:00
Ramji Jiyani
273c0184b1 system_dlkm: add unguarded mount point
Always create system_dlkm mountpoint like
vendor_dlkm and odm_dlkm; as some CF mixed
tests are using the dynamic partition to boot
with builds with no system_dlkm which causes
avd boot failures.

Bug: 217511547
Test: TH
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: Ibf32127df22898706db02400addaa0f1193c105c
2022-02-02 19:45:22 +00:00
Ramji Jiyani
86175ef960 system_dlkm: Fix flag for mount point guard
Replace /system_dlkm mount guard flga from
BOARD_USES_SYSTEM_DLKM_PARTITION to
BOARD_USES_SYSTEM_DLKMIMAGE. board_config.mk
and other tools are using this format of image
name to auto generate code to prevent duplication.

Bug: 200082547
Test: TH
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: Ie4dc899509cf42afb553936e6dbf69d5ce234d01
2022-02-02 02:34:46 +00:00
Ken Chen
d30232369d Merge "[NETD-BPF#27] Require libnetd_updatable.so from APEX" 2022-01-31 22:48:06 +00:00
Peter Collingbourne
1414e3cc77 Add a core configuration that disables the zygote.
In targets that do not include a zygote binary, attempting to start the
zygote service will result in repeated service restarts. Avoid this by
providing a way for targets to opt out of declaring a zygote service.

The fvp_mini target does not have a zygote, so apply this opt-out to
that target.

Change-Id: I4f918502e611e950fa039e4e2ed817c97b928ba2
2022-01-27 20:18:39 -08:00
Suren Baghdasaryan
2e7799a4d3 init.rc: Set permissions to cgroup.procs files
Set permissions to cgroup.procs files in cgroup hierarchies similar to
permissions for tasks files so that SetProcessProfiles can access them.

Bug: 215557553
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Id0c82288392146c8d536d273790a0252580c4203
2022-01-25 00:05:47 +00:00
Ken Chen
8e89f648ee [NETD-BPF#27] Require libnetd_updatable.so from APEX
Add libnetd_updatable.so as dependency of platform. The library will be
used by Netd. Linker config is required if a library in mainline module
is linked by platform.

Bug: 202086915
Test: m; flash; boot

Change-Id: I97183f022b229e788184a979d1a211968295563d
2022-01-21 08:42:15 +00:00
Pirama Arumuga Nainar
dbd3883b9b Revert "Enable continuous coverage: use '%c' specifier in LLVM_PROFILE_FILE"
Bug: http://b/194128476
Bug: http://b/210012154

This reverts commit e59f0f66fc.

Coverage metrics dropped for ~10 of the 40 modules.  There are also
regressions in mainline when running tests on older platform builds.

Test: presubmit
Change-Id: I50a011f68dcdc25883a68701c51e7e2aabc5a7dc
2022-01-18 13:15:54 -08:00
Yi-yo Chiang
1eeee3db1a Merge "Remove unused rootdir/avb/*-gsi.avbpubkey modules" 2022-01-11 06:57:25 +00:00
Pirama Arumuga Nainar
f9a54a86ec Merge "Enable continuous coverage: use '%c' specifier in LLVM_PROFILE_FILE" 2022-01-10 22:36:57 +00:00
Yi-Yo Chiang
0c99f93351 Remove unused rootdir/avb/*-gsi.avbpubkey modules
They were moved to test/vts-testcase

Bug: 176869478
Test: presubmit
Change-Id: I4f4f1c50e624125c839161d83e28f051099e6ec0
2022-01-10 14:25:42 +00:00
Yi-Yo Chiang
88e0f4abdb Move *-gsi_avbpubkey filegroup to vts directory
Bug: 176869478
Test: presubmit
Change-Id: I41cf85bb2f3b5270fcb848fc07e9145d26adcc18
2022-01-07 18:27:15 +08:00
Josh Yang
ef76c8103d Create /data/bootanim folder in init.rc.
This folder is used to host bootanim data files.

Bug: 210757252
Test: /data/bootanim is correctly created.
Change-Id: I5019a92df4526865d53797bfd93cd68c3e6d2886
2021-12-23 14:55:40 -08:00
Ramji Jiyani
856817afe0 Merge "Create /system_dlkm mount point for GKI modules." 2021-12-16 02:41:24 +00:00
Pirama Arumuga Nainar
e59f0f66fc Enable continuous coverage: use '%c' specifier in LLVM_PROFILE_FILE
Bug: http://b/194128476
Bug: http://b/210012154

- Do not use %c if coverage is enabled for bionic/libc.

Test: Run tests with this topic and verify coverage still works and also
test memory-mapped coverage (death tests, JNI code in CTS)

Change-Id: Id1ade9c6f45d69a1da912e3e57acd1d0197c11b5
2021-12-13 14:33:58 -08:00
Kalesh Singh
ccf343fa5b Add group ID for reading tracefs
Add AID_READTRACEFS and mount tracefs with gid=AID_READTRACEFS

Bug: 209513178
Test: adb shell ls -l /sys/kernel/tracing/events
Change-Id: Ibbfdf8a4b771bd7520ecbaaf15a1153d6bf0e599
2021-12-06 16:25:04 -08:00
Ramji Jiyani
aebe60bf46 Create /system_dlkm mount point for GKI modules.
Bug: 200082547
Test: Manual verification with CF boot.
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I82fa90b9977a6e8fa9235aeccc29dce8c1283746
2021-12-01 02:04:02 +00:00
Daniel Norman
9eeffa42e6 Merge "Revert^2 "Load persist props before starting apexd."" 2021-11-17 21:24:28 +00:00
Alan Stokes
82d6d124f3 Merge "mkdir /metadata/sepolicy" 2021-11-17 14:11:14 +00:00
Jeff Vander Stoep
75d0b33d0f mkdir /metadata/sepolicy
Test: make -j; launch_cvd; adb shell ls -laZ /metadata/sepolicy
Bug: 199914227
Change-Id: I005d3eee0e047da9a7f671e87a0274fedaf59447
2021-11-17 10:45:34 +00:00
Daniel Norman
ebaa3e5146 Revert^2 "Load persist props before starting apexd."
f106650b04

Change-Id: I8a774130d178dbf56ba23d152c82a57751de4b6b
2021-11-16 20:28:29 +00:00
Owen Kim
5f77edac5b Merge "Revert "Load persist props before starting apexd."" 2021-11-16 08:39:27 +00:00
Owen Kim
f106650b04 Revert "Load persist props before starting apexd."
Revert "Demonstrate multi-installed APEXes."

Revert "Adds a new prop context for choosing between multi-insta..."

Revert "Adds multi_install_skip_symbol_files field (default fals..."

Revert submission 1869814-vapex-multi-config

Bug: 206551398
Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/tests/view?invocationId=I55600009996329947&testResultId=TR93527797572038984, bug b/206551398
Reverted Changes:
I0cd9d748d:Adds multi_install_skip_symbol_files field (defaul...
I5912a18e3:Demonstrate multi-installed APEXes.
I0e6881e3a:Load persist props before starting apexd.
I932442ade:Adds a new prop context for choosing between multi...
I754ecc3f7:Allow users to choose between multi-installed vend...

Change-Id: I27a4985061b112af7d0e9b95b6d42ccd9b846471
2021-11-16 07:08:15 +00:00
Treehugger Robot
469e830cfd Merge "Restart media.tuner when zygote is restarted." 2021-11-16 06:06:31 +00:00
Hongguang
8d8d9d853a Restart media.tuner when zygote is restarted.
Bug: 206042321
Test: Kill system_server and dumpsys tv_tuner_resource_mgr
Change-Id: Icc83453ef8852a07329757fecd10e8898a9dbdcd
2021-11-16 04:51:49 +00:00
Daniel Norman
b3aa2c4691 Merge "Load persist props before starting apexd." 2021-11-16 00:45:32 +00:00
Daniel Norman
4b09b5e202 Load persist props before starting apexd.
apexd now reads persist props to select between multi-installed APEXes
for debug builds.

Bug: 199290365
Test: see https://r.android.com/1872018
Change-Id: I0e6881e3a5a3775560b580556a7de2e2da043d34
2021-11-11 19:08:51 +00:00
Eric Biggers
335cd1f4a3 init.rc: remove handling of vold.decrypt property changes
These triggers were specific to FDE, which is no longer supported, so
remove them.

Bug: 191796797
Change-Id: Iab4f6bd3d0fa70ff959be2c27986c101c42e29d7
2021-11-09 22:44:50 -08:00
Treehugger Robot
af97deddb1 Merge "Sets 'verity_update_state' in init.rc" 2021-10-27 07:23:47 +00:00
Rick Yiu
014446d702 init.rc: Create a new group for dex2oat
Create a new group for dex2oat in cpu cgroup, which is dedicated for
dex2oat processes. Also modify task profiles for this change.

Bug: 201223712
Test: dex2oat group created
Change-Id: Ic61f4b8a64d01c03549b680970805e12b9ce4fcc
2021-10-22 22:20:07 +08:00
Bowgo Tsai
5998c74d7a Sets 'verity_update_state' in init.rc
This is required since Android 12, because
CtsNativeVerifiedBootTestCases will read property
"partition.${partition}.verified.hash_alg" to
check that sha1 is not used.

Also see https://r.android.com/1546980 for more details.

Bug: 175236047
Bug: 203720638
Test: build and boot a device
Change-Id: I300265f4af9c2781d40537f391bda9eaf62c27ba
2021-10-21 21:38:22 +08:00
Alexander Potapenko
53cd1e95e7 init.rc: disable creation of bootreceiver tracing instance for kernels >=4.9 and <= 5.4
The tracing instance takes extra RAM and is not needed on devices running older kernels.
Bug: 194156700
Test: manual on a Pixel device

Change-Id: I794062741688ebea0e4bc500723a966f8f646ee1
Signed-off-by: Alexander Potapenko <glider@google.com>
2021-09-29 15:01:55 +00:00
Christopher Ferris
2163bbbd34 Add executable bit to tests directories.
In order for crashes when executables are run from the
/data/local/tests directory, set the executable bit for that
directory and sub-directories. Without this, neither the root
user nor shell user can read any executables or shared libraries in
the tests directory.

Bug: 197229540

Test: Used the crasher executable and copied it to /data/local/tests
Test: and verified that running it as root and shell results in
Test: tombstones that have full unwinds with function names.
Change-Id: Ice669358decad9766e0496c156aa84d4ecacd124
2021-09-09 20:07:31 +00:00
Suren Baghdasaryan
92cb2e8583 Use extra_free_kbytes.sh whenever sys.sysctl.extra_free_kbytes changes
sys.sysctl.extra_free_kbytes property controls the value set to the
/proc/sys/vm/extra_free_kbytes out-of-tree kernel knob. Replace its
use with execution of extra_free_kbytes.sh script which calculates
and sets corresponding value to /proc/sys/vm/watermark_scale_factor
upstream-supported kernel knob.

Bug: 109664768
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Iaece28eb858a20c8c39578a28dc6bbc6adc13c40
2021-08-17 17:02:25 +00:00
Alexander Potapenko
ec37ba8359 Restrict creation of bootreceiver tracing instance to 64-bit systems.
The main users of this instance are KFENCE and MTE-aided KASAN, which are only supported on arm64.
Skip creation of this tracing instance on 32-bit systems to save ~6Mb memory on low-end devices.

Bug: 195089948
Bug: 194719088
Bug: 194156700
Change-Id: Icaf762715fed7a282b1ad738c10bcb45dc848f4d
2021-08-05 18:46:43 +00:00
Andrew Walbran
1f885aee3d virtualizationservice will clear its own temporary directory.
Bug: 192917795
Bug: 193365943
Test: flashed on a VIM3L and booted
Change-Id: Ib9657843c4d13c428670982a3f8d0e5dfdb78211
2021-07-14 14:18:25 +00:00
Martin Liu
9f8b024c72 init: disable watermark_boost feature
In newer kernel, it introduces watermark boost feature
to enhance memory fragmentation problems. This feature
will dynamically boost/down watermark level which conflicts
with LMKD assumption and causing LMKD not to work properly.
Disabling this feature first until we address it.

Bug: 189938926
Test: check vm parameter.
Signed-off-by: Martin Liu <liumartin@google.com>
Change-Id: I6db5163f843f1129080bb944df7cbb8c799a58e0
2021-07-01 12:26:44 +08:00
David Anderson
da75aa7b6b Merge "init: fix to set sd device label correctly for FS" 2021-06-29 04:12:13 +00:00
Guo Weichao
bcefbb1dfb init: fix to set sd device label correctly for FS
The sysfs node of sd blk_device is /sys/fs/f2fs/sd-<num>, we shouldn't
skip partition number at this time.

Bug: 189257443
Test: access sd-<num> sysfs correctly
Signed-off-by: Guo Weichao <guoweichao@oppo.com>
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
Change-Id: Ibcd7bb265f8fca9cd26f8770403f1bafad433acb
2021-06-25 21:42:17 +08:00
Wei Wang
7703d074cc init.rc: remove system cgroup migraion
We never use CONFIG_RT_GROUP_SCHED in GKI kernel, but that could be set
on legacy devices. Remove system cgroup migration and also RT settings
as we should not have any task under those groups.

Bug: 191925901
Test: Build
Signed-off-by: Wei Wang <wvw@google.com>
Merged-In: I492833975e28e9888e412711e80670ca0901010d
Change-Id: I492833975e28e9888e412711e80670ca0901010d
(cherry picked from commit b4e79853cd)
2021-06-24 18:00:08 -07:00
Suren Baghdasaryan
2079c5f0c9 Replace writepid with task_profiles command for cgroup migration
writepid command usage to join a cgroup has been deprecated in favor
of a more flexible approach using task_profiles. This way cgroup path
is not hardcoded and cgroup changes can be easily made. Replace
writepid with task_profiles command to migrate between cgroups.

Bug: 191283136
Test: build and boot
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I945c634dfa7621437d8ea3981bce370d680b7371
2021-06-24 17:24:20 +00:00
Inseob Kim
2e20058069 Completely migrate init first stage to Soong
adb_debug.prop is migrated too. And ramdisk_available is added to all
dependencies.

Bug: 187196593
Test: boot
Change-Id: I59cd149e0021211b8fd59c44b93bbf18dc8637bf
2021-06-18 14:26:55 +09:00
Treehugger Robot
1c998ded12 Merge "Add libbinder_rpc_unstable.so to linker.config.json" 2021-06-17 21:43:55 +00:00