Commit graph

3197 commits

Author SHA1 Message Date
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
Victor Hsieh
500c526377 Add libbinder_rpc_unstable.so to linker.config.json
Bug: 190547489
Bug: 189947807
Test: m
Change-Id: Ibcf04c036c721720a086c74110aed8618f385dd5
2021-06-10 08:42:06 -07:00
Ricky Wai
420830f8a6 Isolate app profile ref data
Due to aosp/1708274, ref data directory is now world accessible.
We need to fix ref data directory so that it does not leak app
visibility information.

Bug: 189787375
Test: AppDataIsolationTests
Change-Id: I716852478ce0734c7038934c88c36a567c06393f
2021-06-08 12:15:14 +01:00
Andrew Walbran
89ddf50566 Merge "Create data directory for VirtualizationService." 2021-05-28 12:06:58 +00:00
Michael Butler
2e3dabc629 Merge "Revert "Add libneuralnetworks_shim.so to requireLibs."" 2021-05-27 18:05:25 +00:00
Andrew Walbran
2934ee0bcd Create data directory for VirtualizationService.
Bug: 184131523
Test: Built, flashed, ran microdroid VM via virtmanager
Change-Id: I1e6a5f7a304a02de1efb29e253d8bbd54f3f704d
2021-05-27 13:07:50 +00:00
Andrew Walbran
3aedc7edc8 Rename VirtManager to VirtualizationService.
Bug: 188042280
Test: atest VirtualizationTestCases
Change-Id: I0e549ef02c7327f57c3d04853b3eefed7403d8e8
2021-05-24 11:41:13 +00:00
Michael Butler
6ecfbf3309 Revert "Add libneuralnetworks_shim.so to requireLibs."
This reverts commit 14f6751df1.

Reason for revert: Removing libneuralnetworks_shim.so from Android S

Change-Id: I23acbdc31ddc488ad59225b483936905fa3652ee
Merged-In: I23acbdc31ddc488ad59225b483936905fa3652ee
2021-05-21 19:57:26 +00:00
Calin Juravle
11197dd8a8 Allow others to read the profile ref dir
ART wants to optimize the time when the profile information
is saved for an app. To do so, it needs access to both, the current
profile, and the reference profile. This will allow ART to access
the ref profiles, which previously was not needed.

Test: m & flash
Bug: 185979271
Change-Id: Ie07bce81d2fba9c0b0ae4f322418e960c024e15d
2021-05-14 18:34:02 +00:00
Martin Stjernholm
7b5e682da1 Merge "Require libjdwp from the ART APEX." 2021-05-05 14:30:50 +00:00
Mohammad Islam
a2de531f2c Merge "Add execute permission to /data/apex/decompressed directory" 2021-05-05 12:31:43 +00:00
Martin Stjernholm
bcd1d4b670 Require libjdwp from the ART APEX.
There is no direct dependency in platform on this library, but we still
need a link to it from the system namespace, since adbconnection can
load it as a JVMTI agent without a class loader, and that is changing
to use the system namespace in https://r.android.com/1673312.

Test: atest CtsJdwpTestCases
Test: atest CtsJdwpTunnelHostTestCases
Bug: 130340935
Change-Id: Ia06c0f2a80226a056195fcff2f5d4dcab8f38518
2021-04-29 20:40:31 +01:00
Eric Biggers
915b8d7194 init.rc: fix (re)starting apexd on FDE devices
On first boot, FDE devices hang on the command
'wait_for_prop apexd.status activated'.  This is because apexd was
already started with the tmpfs /data, then was stopped by
vold.decrypt=trigger_shutdown_framework.  Then when apexd is started
again with the real /data, it sees that apexd.status="ready" already, so
it doesn't consider itself to be starting from scratch again.  So it
doesn't move apexd.status back to "activated" as expected.

Fix the above by resetting apexd.status to its initial value of the
empty string before trying to start apexd in the post-fs-data trigger.
Note that this also takes care of the userspace reboot case which was
previously handled in the userspace-reboot-requested trigger.

Also, FDE devices hang at the same place on non-first boots with default
encryption (i.e., when no PIN is set) because apexd is still running
after having been started with the tmpfs /data.  This is because
vold.decrypt=trigger_shutdown_framework isn't run in that case, but
rather vold manually kills processes that have open files on /data --
which doesn't include apexd.  But, apexd should be restarted too.

Fix that by using 'restart apexd' rather than 'start apexd'.

Note that these changes are needed even though FDE devices don't support
updatable APEXes, as apexd is needed regardless.

This is one of a set of changes that is needed to get FDE working again
so that devices that launched with FDE can be upgraded to Android 12.

Bug: 186165644
Test: Tested FDE on Cuttlefish.  Also tested userspace reboot (with FBE)
Change-Id: I4fa57cf15d77b64d1167eaf966347d2a9d6a9b72
2021-04-29 17:05:37 +00:00
Mohammad Samiul Islam
60e30a5ada Add execute permission to /data/apex/decompressed directory
Now that we are activating APEX directly from /data/apex/decompressed
directory, without this permission, PackageManager fails to parse
decompressed APEX. This permission setting is same as what we have for
/data/apex/active.

Bug: 185886528
Test: atest ApexCompressionTests
Change-Id: Ief36a6ddc5760faff2c390fa913984385fda99a6
2021-04-29 14:23:27 +00:00
Treehugger Robot
6e784c5503 Merge "Prevent debugfs unmount on debug builds with a persist property" 2021-04-22 21:43:18 +00:00
Artur Satayev
1acd663e96 Don't generate /etc/classpath in make.
Soong generates classpaths.proto config and puts it into
/system/etc/classpaths/ for derive_classpath to read at runtime. There
is no need to plumb these values via make anymore.

Bug: 180105615
Test: m && launch_cvd; presubmit / DeviceBootTest
Change-Id: I514c5036871233ae865b972effea8321dbe4aea9
2021-04-22 12:17:49 +00:00
Treehugger Robot
79cd46d1e9 Merge "Rename ro.product.enforce_debugfs_restriction appropriately" 2021-04-20 06:07:53 +00:00
Treehugger Robot
d7fd9b715c Merge "Add libneuralnetworks_shim.so to requireLibs." 2021-04-19 15:40:11 +00:00
Hridya Valsaraju
129d8743b9 Prevent debugfs unmount on debug builds with a persist property
In order to simplify developer/test flow, the persistent property
persist.dbg.keep_debugfs_mounted can be set to prevent debugfs from
being unmounted on boot.

Bug: 184381659
Test: build and boot
Change-Id: I714616b361e6c8fb59633ec0763f9bd55af7df0e
2021-04-16 13:59:15 -07:00
Hridya Valsaraju
d723f21fec Rename ro.product.enforce_debugfs_restriction appropriately
Rename ro.product.enforce_debugfs_restrictions to
ro.product.debugfs_restrictions.enabled as per the sysprop naming
scheme.

Bug: 184381659
Test: build, boot
Change-Id: Ie350eefa342e7e16d31363139257ed285780e874
2021-04-16 09:52:03 -07:00
Paul Crowley
61abbef4e4 Merge changes from topic "revert-1665499-revert-1660531-max-boot-level-crypto-KFMCEDKSIV-WPIHELCRFI"
* changes:
  Revert^2 "Set earlyBootEnded before apex starts"
  Revert^2 "Expose AID_KEYSTORE"
2021-04-16 15:51:27 +00:00
Treehugger Robot
3f4ea91c7c Merge "Move debugfs mount/unmount to init-debug.rc" 2021-04-16 01:54:54 +00:00
Artur Satayev
a2631ebc13 Install platform-bootclasspath generated config in /system/etc.
platform-bootclasspath module generates classpaths.proto config with
the information for derive_classpath to read and parse at runtime.

See go/updatable-bootclasspath.

Bug: 180105615
Test: m && launch_cvd; presubmit / DeviceBootTest
Change-Id: I0f4b1cfce9468fd6e3377a1d7233245e30f1ea51
2021-04-15 22:32:31 +00:00
Paul Crowley
7583da1bcd Revert^2 "Set earlyBootEnded before apex starts"
Revert submission revert-1660531-max-boot-level-crypto-KFMCEDKSIV

Reason for revert: topic:vold-use-keystore2 has landed fixing the bug

Reverted changes:
Ibf63734a: Revert "Set earlyBootEnded before apex starts"
Id02f63a7: Revert "Expose AID_KEYSTORE"
Ibcedeff4: Revert "Cryptographic security for MAX_BOOT_LEVEL"

Restored changes:
Ia3b968afc:Set earlyBootEnded before apex starts
Ia69891291:Expose AID_KEYSTORE
I12530cd13:Cryptographic security for MAX_BOOT_LEVEL

Reverted-SHA1: 82cfe66794

Original commit message:
earlyBootEnded signals to keystore2 to read the database for the first
time, and start the MAX_BOOT_LEVEL system. It must therefore run
after /data is mounted and /data/misc/keystore is created, but before
apexd or odsign starts.

Bug: 176450483
Test: atest com.android.tests.odsign.OnDeviceSigningHostTest#verifyArtUpgradeSignsFiles
Change-Id: Ib9c2b4bbdddecdf73924125f9bdc75c82e1dd257
2021-04-15 12:55:28 -07:00
Przemysław Szczepaniak
14f6751df1 Add libneuralnetworks_shim.so to requireLibs.
Adding in case of link required from the system image to nn apex.

Test: Run sample vendor service on cf device
Bug: 172925288
Change-Id: Ic4609cc0b73dfd5c9d39b75b22e241c30d61b753
2021-04-15 11:12:15 +01:00
Orion Hodson
abe3b42eb4 Merge "Create directory for caching odrefresh metrics" 2021-04-15 08:51:01 +00:00
Jooyung Han
489cea14d8 Make prebuilt_etc for public.libraries.android.txt
so that this can be packaged in a filesystem(e.g microdroid)

Bug: 181093750
Test: MicrodroidTestCase
Change-Id: Ib86789de4632a32eee31fee0607d5ade8ae6b33f
2021-04-15 09:45:48 +09:00
Hridya Valsaraju
3f384a25fa Move debugfs mount/unmount to init-debug.rc
Debugfs cannot be mounted in userbuilds since Android R. Since init only
mounts/unmounts debugfs during boot for debug builds, move it to
init-debug.rc.

Bug: 184381659
Test: build/boot
Change-Id: Ib51e82b99ec1eb95a2647c91855f6d4d1585040a
2021-04-13 14:45:50 -07:00
Andrew Walbran
d8d9736573 Merge "Give virtmanager user access to /dev/kvm and /dev/vhost-vsock for crosvm" 2021-04-13 09:18:44 +00:00
Hridya Valsaraju
2a8b028c04 Merge "Use property ro.product.enforce_debugfs_restrictions to enable debugfs restrictions" 2021-04-12 17:11:23 +00:00
Andrew Walbran
e76a7ef09c Give virtmanager user access to /dev/kvm and /dev/vhost-vsock for crosvm
Bug: 183583115
Test: Ran a VM manually with vm tool
Change-Id: Idf691c3ec3551c4cdadaecff96eddc2027dc8c79
2021-04-12 15:25:35 +00:00
Martin Stjernholm
33a4e5539b libdexfile_external is replaced by libdexfile (reland 2).
This relands https://r.android.com/1644045 after requisite fix in
https://r.android.com/1671709.

Test: atest CtsSimpleperfTestCases
Bug: 143978909
Change-Id: I89650a8059b56d2b35a5592ef555c91faa49a2cf
2021-04-09 19:11:13 +01:00
Orion Hodson
44bedf6a58 Create directory for caching odrefresh metrics
Metrics are written to /data/misc/odrefresh by odrefresh during early
boot, then the zygote passes them to statsd and delete the metrics
files.

Bug: 169925964
Test: manual
Change-Id: Ia39098109d59600ae8d7b197f46e9a6de18ca57c
2021-04-09 15:42:31 +01:00
Ulyana Trafimovich
9cfeb70f97 Revert "libdexfile_external is replaced by libdexfile (reland)."
Revert "Merge libdexfile_external into libdexfile (reland)."

Revert "Rename libdexfile_external_static to libdexfile_static (..."

Revert "Rename libdexfile_external_static to libdexfile_static (..."

Revert submission 1666119-libdexfile-noext-2

Reason for revert: broken build 7270939 on aosp-master on full-eng
Reverted Changes:
I582e49ae7:Merge libdexfile_external into libdexfile (reland)...
Iaa6a90f41:Rename libdexfile_external_static to libdexfile_st...
I4315189b2:libdexfile_external is replaced by libdexfile (rel...
Ia065119c2:Rename libdexfile_external_static to libdexfile_st...

Bug: 184929782
Change-Id: Id4830ded68e6fb3e9da0bcd8e428c46a79df3ff8
Test: forrest build for aosp-master on full-eng
2021-04-09 11:35:11 +00:00
Ulyana Trafimovich
82cfe66794 Revert "Set earlyBootEnded before apex starts"
Revert "Cryptographic security for MAX_BOOT_LEVEL"

Revert submission 1660531-max-boot-level-crypto

Reason for revert: broken test com.android.tests.odsign.OnDeviceSigningHostTest#verifyArtUpgradeSignsFiles on aosp-master on aosp_cf_x86_64_phone-userdebug at 7261517

Reverted Changes:
Ia3b968afc:Set earlyBootEnded before apex starts
Ia69891291:Expose AID_KEYSTORE
I12530cd13:Cryptographic security for MAX_BOOT_LEVEL

Bug: 184635938
Change-Id: Ibf63734a02a2c132142671c0fae5d0177bf46079
Test: forrest run for the broken test
2021-04-06 16:07:07 +00:00
Martin Stjernholm
0648856a1f libdexfile_external is replaced by libdexfile (reland).
This relands https://r.android.com/1644045 after fixing the build issue
in b/184239856.

Test: atest CtsSimpleperfTestCases
Bug: 143978909
Change-Id: I4315189b243503f5633f64d46a0ffedad3bebf0c
2021-04-06 14:01:44 +01:00
Paul Crowley
02e0ddcaf9 Set earlyBootEnded before apex starts
earlyBootEnded signals to keystore2 to read the database for the first
time, and start the MAX_BOOT_LEVEL system. It must therefore run
after /data is mounted and /data/misc/keystore is created, but before
apexd or odsign starts.

Bug: 176450483
Test: cuttlefish: check keystore2 logs to ensure all looks well.
Change-Id: Ia3b968afc38edf95712480e99e545ba88ea309c3
2021-04-05 21:40:36 -07:00
Hridya Valsaraju
6b7311fc99 Use property ro.product.enforce_debugfs_restrictions to enable debugfs
restrictions

Use the property ro.product.enforce_debugfs_restrictions to enable
debugfs restrictions instead of checking the launch API level. Vendors
can enable build-time as well as run-time debugfs restrictions by
setting the build flag PRODUCT_SET_DEBUGFS_RESTRICTIONS true which in
turn sets ro.product.enforce_debugfs_restrictions true as well enables
sepolicy neverallow restrictions that prevent debugfs access. The
intention of the build flag is to prevent debugfs dependencies from
creeping in during development on userdebug/eng builds.

Test: build and boot
Bug: 184381659
Change-Id: If555037f973e6e4f35eb7312637f58e8360c3013
2021-04-02 17:00:50 -07:00
Nikita Ioffe
89e50ee521 Merge "Revert "libdexfile_external is being replaced by libdexfile."" 2021-04-01 14:22:53 +00:00
Nikita Ioffe
698370e933 Revert "libdexfile_external is being replaced by libdexfile."
Revert "Merge libdexfile_external into libdexfile."

Revert "libdexfile_external is replaced by libdexfile."

Revert "Rename libdexfile_external_static to libdexfile_static."

Revert "Rename libdexfile_external_static to libdexfile_static."

Revert "Allow dependencies from platform variants to APEX modules."

Revert submission 1658000

Reason for revert: Breaks full-eng build: b/184239856
Reverted Changes:
I4f8ead785:Avoid internal APEX stubs for libsigchain and clea...
I68affdf69:Allow dependencies from platform variants to APEX ...
I54b33784e:Rename libdexfile_external_static to libdexfile_st...
Id68ae9438:libdexfile_external is being replaced by libdexfil...
I12ac84eb4:libdexfile_external is replaced by libdexfile.
If05dbffc8:Rename libdexfile_external_static to libdexfile_st...
Ia011fa3a8:Merge libdexfile_external into libdexfile.

Change-Id: I2448810c9a863cde32b6ed98d9ed0a99cf260d34
2021-04-01 10:58:24 +00:00
Martin Stjernholm
3080a06431 Merge "libdexfile_external is being replaced by libdexfile." 2021-04-01 06:53:13 +00:00
Treehugger Robot
911850ecc3 Merge "Copy vendor.sys.usb.adb.enabled to sys.usb.adb.enabled." 2021-03-31 00:06:44 +00:00
Martin Stjernholm
3ecc22fd20 libdexfile_external is being replaced by libdexfile.
Test: atest CtsSimpleperfTestCases
Bug: 143978909
Change-Id: Id68ae9438e8e7a902ee00e00f53018aa90e92c7b
2021-03-30 12:19:49 +01:00
Artur Satayev
7df79970ad Delay running derive_classpath.
It must run before odsign; and now runs after restorecon on /data as well.

Bug: 183861600
Bug: 180105615
Test: presubmit && cuttlefish boots
Change-Id: Iefe59d94a7a40ed1e526c189cbc2baf69156f334
2021-03-30 11:57:38 +01:00
Artur Satayev
441e6b91e1 Attempt to fix labels on /data/system/environ/.
Bug: 183861600
Bug: 180105615
Test: presubmit && cuttlefish boots
Change-Id: Ic5206eb28e8028ec3c9c4b5a756c46ddb6e68b58
2021-03-30 11:49:05 +01:00
satayev
baf2168da7 Merge "Revert^2 "Exec_start derive_classpath on post-fs-data."" 2021-03-23 10:10:00 +00:00
Josh Gao
552f3b4b9c Copy vendor.sys.usb.adb.enabled to sys.usb.adb.enabled.
Bug: http://b/182088146
Test: manual
Change-Id: Ic20dd05813d834ad077f241929030f69906bf0bf
2021-03-22 16:36:17 -07:00
Michael Rosenfeld
e853d37efd Add a system property to init that drops caches.
*   Users can't call /proc/sys/vm/drop_caches otherwise.
*   Requires change with associated SELinux permissions.

Bug: 178647679
Test: flashed user build and dropped caches; no avc denials.
Test: flashed userdebug build and dropped caches w/o root.
Change-Id: Ibc91991509f0902d1c04c958fefc0966233f0b2e
2021-03-19 10:30:01 -07:00
satayev
52cc896997 Revert^2 "Exec_start derive_classpath on post-fs-data."
9ebc6085da

Bug: 180105615
Test: manual boot of cuttlefish and gphone emulator
Change-Id: I299df6b29194fdf41fdcb2c1f59f65241b519c8d
2021-03-19 11:21:07 +00:00
Martijn Coenen
648dec66d5 Support asynchronous odsign.
To improve boottime, we want to run odsign in an asynchronous fashion;
but there are 2 places where we do need it be sync:
1) We need to know when it's done using its key, so that we lock
keyrings and advance the boot stage
2) We need to know verification is complete before we start the zygote

These are indicated by odsign using separate properties.

Bug: 165630556
Test: init waits for the properties, and proceeds when done
Change-Id: I623c24a683340961b339ed19be2f577d9293b097
2021-03-19 09:05:09 +01:00
Orion Hodson
8de8eb741b Merge "Revert "Exec_start derive_classpath on post-fs-data."" 2021-03-18 19:18:02 +00:00
Orion Hodson
9ebc6085da Revert "Exec_start derive_classpath on post-fs-data."
Revert "Introduce derive_classpath service."

Revert "Introduce derive_classpath."

Revert submission 1602413-derive_classpath

Bug: 180105615
Fix: 183079517
Reason for revert: SELinux failure leading to *CLASSPATH variables not being set in all builds

Reverted Changes:
I6e3c64e7a:Introduce derive_classpath service.
I60c539a8f:Exec_start derive_classpath on post-fs-data.
I4150de69f:Introduce derive_classpath.

Change-Id: Iefbe057ba45091a1675326e3d5db3f39cc3e2820
2021-03-18 17:00:23 +00:00
Paul Hu
b684856949 Merge "Migrate net.tcp.default_init_rwnd to net.tcp_def_init_rwnd" 2021-03-17 11:24:53 +00:00
satayev
294167d436 Merge "Exec_start derive_classpath on post-fs-data." 2021-03-17 10:58:30 +00:00
paulhu
f8cdebfc35 Migrate net.tcp.default_init_rwnd to net.tcp_def_init_rwnd
Currently, tcp receive window size is read from
net.tcp.default_init_rwnd then set to net.tcp_def_init_rwnd. It
should not use seperate property to read/write the value, it only
needs one of property basically. So migrate
net.tcp.default_init_rwnd to net.tcp_def_init_rwnd which has
formal API.

Bug: 182538166
Test: Manually check that net.tcp_def_init_rwnd has default
      value and proc/sys/net/ipv4/tcp_default_inti_rwnd node
      is created with same value.
Change-Id: I6748485f99198b1200c67d6595b659aac7d7e1e0
2021-03-17 13:59:22 +08:00
Nicolas Geoffray
f85f3d628e Merge "Add libsigchain as dependency of platform." 2021-03-15 16:04:38 +00:00
Nicolas Geoffray
8a3f8853d3 Add libsigchain as dependency of platform.
Test: m and boot
Test: atest CtsJniTestCases
Bug: 142944043
Change-Id: Iefded35c478d6278c56fbfa02e5cb364a9326c5c
2021-03-13 16:07:13 +00:00
Martijn Coenen
43defd972f Merge "Add some keystore boot levels." 2021-03-11 09:25:40 +00:00
Artur Satayev
1320668c52 Exec_start derive_classpath on post-fs-data.
The service parses and merges configs from multiple partitions, defines
*CLASSPATH environ variables' values and writes them to file, for
init to export.

See go/updatable-classpath for more details.

Bug: 180105615
Test: manual
Change-Id: I60c539a8fef4d690f47704e896f67949ec49db60
2021-03-11 07:20:23 +00:00
Martijn Coenen
e94b36637d Add some keystore boot levels.
The first user of keystore boot levels is on-device signing; transition
the boot level to 30 before running the post-fs data hook, and
transition it to 40 right after on-device signing is done. This leaves
some space for future boot levels to be inserted, if we wanted.

Bug: 165630556
Test: inspect logs
Change-Id: If0a74cbe9ea8fce806020d8a42a978cfb9117ded
2021-03-09 09:59:57 +00:00
Alexander Potapenko
439608bfb0 init.rc: set up a tracing instance for BootReceiver.java
This instance will be used to monitor the error_report_end tracing
events sent by kernel tools in the case of a memory corruption.

Bug: 172316664
Bug: 181778620
Test: manual runs with KFENCE enabled
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ibc5cd3b60fb99030cc55db6b490d6d4bbbca3963
2021-03-04 10:36:51 +01:00
Wonsik Kim
5e53f90cdd Revert "init.rc: set up a tracing instance for BootReceiver.java"
Revert "Selinux policy for bootreceiver tracing instance"

Revert submission 1572240-kernel_bootreceiver

Reason for revert: DroidMonitor: Potential culprit for Bug 181778620 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted Changes:
Ic1c49a695:init.rc: set up a tracing instance for BootReceive...
I828666ec3:Selinux policy for bootreceiver tracing instance

Change-Id: I5c2ccfe3eeb8863086b7cb9b3de43c6e076d995a
2021-03-03 22:47:02 +00:00
Alexander Potapenko
2ec6c68ce9 init.rc: set up a tracing instance for BootReceiver.java
This instance will be used to monitor the error_report_end tracing
events sent by kernel tools in the case of a memory corruption.

Bug: 172316664
Test: manual runs with KFENCE enabled
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ic1c49a695ff7df4147a7351051db7b6707c86e0a
2021-03-02 16:50:16 +01:00
Paul Crowley
75a2bba158 Merge "Set an initial keystore.boot_level" 2021-02-27 05:05:50 +00:00
Daeho Jeong
272e7a60cb bfq: set background cgroup weight to 10
For better responsiveness of foreground task's io in BFQ I/O scheduler,
set background task's weight from default 100 to 10.

Test: cat /dev/blkio/background/blkio.bfq.weight
Bug: 171739280
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Change-Id: I6a4ea2d46c4426d3e34c7ea71a4653e0ce3ed0df
2021-02-24 19:42:50 +00:00
Paul Crowley
95a25124c7 Set an initial keystore.boot_level
Keystore listens to this property and uses it to honor the
MAX_BOOT_LEVEL key tag.

Test: boot, use adb getprop to find the current value.
Bug: 176450483
Change-Id: If32b20f56f96afa24166188c2dd931620dcaef98
2021-02-23 08:45:45 -08:00
Mohammad Islam
40839a8469 Merge "Create apex reserved dir for update_engine" 2021-02-23 10:26:26 +00:00
satayev
334a93381d Merge "Export *CLASSPATH variables after apexes are configured." 2021-02-23 04:05:14 +00:00
Bob Badour
d69ad69a93 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id740a7d2884556081fdb68876584b25eb95e1bef
2021-02-19 12:59:05 -08:00
Artur Satayev
c19f99781b Export *CLASSPATH variables after apexes are configured.
For now, export the exact same values, on `post-fs-data` instead of on
`early-init` to soak the change. As a follow up, the actual values will
be generated by a new oneshot service.

See go/updatable-classpath for more details.

Bug: 180105615
Test: manual - device boots
Change-Id: I5f6826a0f87a5e01233e876d820e581feb555bca
2021-02-19 17:12:26 +00:00
Martijn Coenen
73dea057c2 Merge "Add on-device signing binary." 2021-02-19 11:31:50 +00:00
Kelvin Zhang
1f455c8dfe Create apex reserved dir for update_engine
When installing an OTA, update_engine needs to reserve some space on
filesystem by writing to a specific directory(/data/apex/ota_reserved/),
therefore we need to create this dir on system start up.

We are also pro-actively enabling encryption on this directory so that
we can create hard links to /data/apex/decompressed. This will be needed
when we start decompresssing capex from post-install script before
reboot and on boot we can then simply hard link to these files.

Test: th
Bug: 172911822

Change-Id: Ia6a63efcedcfdad9817ba88b54f96683d34df6ce
2021-02-17 15:35:22 +00:00
Elliott Hughes
c3a206ccda Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"
This reverts commit 187b7d1950.

Reason for revert: system/core is multiple projects, not one.

Change-Id: I790ea41741f8cd9b8b6db2f59a49e71fb0958fd6
2021-02-16 20:01:20 +00:00
Bob Badour
187b7d1950 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  Android.bp
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I5bd81adb5cdcf2b4dd4141b204eb430ff526af8f
2021-02-16 04:10:03 -08:00
Mohammad Islam
223902d81c Merge "Create an encrypted directory for decompressing compressed APEX" 2021-02-12 10:16:55 +00:00
Elliott Hughes
3e455e3ae1 Merge "Remove special config for /dev/hw_random." 2021-02-11 18:04:45 +00:00
Elliott Hughes
61fb3d0b69 Remove special config for /dev/hw_random.
There's no need for system_server to access this any more, so no need to
have weaker permissions than we'll get by default (ignoring the fact
that SELinux policy is our real protection here anyway).

Bug: http://b/179086242
Test: treehugger
Change-Id: I584e87f027f44e10190c2e5c2eb85785f61f8bd5
2021-02-10 15:13:46 -08:00
Hongming Jin
87f55fe2af Create /data/misc/a11ytrace folder to store accessibility trace data.
Bug: 157601519
Test: manual check
Change-Id: I0a12246c8b30e8c68e1dd1fa80135f8945f343dc
2021-02-09 11:54:46 -08:00
Andrei-Valentin Onea
2e2861dbd3 Merge "Create appcompat data dir" 2021-01-29 14:53:27 +00:00
Tom Cherry
71dd7064cc ueventd: deprecate paths without /etc/
ueventd.rc scripts belong in the /etc/ directory of their given
partition, not the root of the partition.  This can cause problems,
especially since Android.bp cannot write to the root directly, forcing
vendors to use Android.mk for these files.  Note that
/system/etc/ueventd.rc moved long ago.

Test: Tree-hugger
Change-Id: I2dcaafc3c3f687f76ab6bc38af979c8b43346db0
2021-01-26 12:26:09 -08:00
Seigo Nonaka
4356f6e98d Merge "Set up /data/fonts directory for updatable system fonts" 2021-01-25 05:47:03 +00:00
Linzhao Ye
5a9b8577c9 Merge "Allow system server to access sysfs node of led lights." 2021-01-23 17:08:46 +00:00
Andrei Onea
3c50588529 Create appcompat data dir
This is currently used for persisting the compat framework overrides
across reboots.

Test: atest CompatConfigTest
Bug: 145509340
Change-Id: I9205388b44a337a5b56b78cb6cc78f09494a623e
2021-01-22 17:12:27 +00:00
Martijn Coenen
00e51a4b39 Add on-device signing binary.
This binary checks and refreshes ART compilation artifacts that are
necessary for the system to boot.

Bug: 165630556
Test: inspect init log output on boot
Change-Id: I15074989a0fb6e5b1036292bc2cd824a141a0252
2021-01-18 13:45:03 +01:00
Martijn Coenen
c7a26dc263 Move restorecon of /data earlier in boot sequence.
A future early-boot daemon (on-device signing) needs to access
/data/misc before fs-verity keys are locked. Therefore, move the
restorecon of /data up a bit, to make sure the labels are correct. To be
safe, only run it after init_user0, since that function is responsible
for loading DE keys.

Also move early boot keys and fs-verity key locking a bit later, since
the on-device signing daemon needs to use both of these, but it also
needs the restorecon to function correctly.

Bug: 174740982
Test: manual
Change-Id: I9b6e44d9b547d420e1c6ba01fb3d3accc0625e20
2021-01-18 13:42:53 +01:00
Chris Ye
f41e334922 Allow system server to access sysfs node of led lights.
To support input device lights manager feature in frameworks, provide
sysfs node access to system server process.

Bug: 161633625
Test: atest LightsManagerTest, atest InputDeviceLightsManagerTest
Change-Id: Ic823539e9dd616b6ca4ae803756746e0f5349ec1
2021-01-17 06:58:39 +00:00
Mohammad Samiul Islam
96711052eb Create an encrypted directory for decompressing compressed APEX
We want to decompress into an encrypted directory so that it can later
be hard linked to other encrypted directories, such as /data/rollback.

Bug: 172911820
Test: atest ApexCompressionTests#testCompressedApexIsDecompressed
Change-Id: I98bc567ba7e8b1ea1b335830d71d1b1f38e6ea33
2021-01-14 20:07:05 +00:00
Hridya Valsaraju
0db7ccaf99 Merge "Setup ueventd to support DMA-BUF system-secure heap" 2021-01-13 16:23:52 +00:00
Treehugger Robot
8376d87e2d Merge "Let init mount/unmount debugfs for non-user builds" 2021-01-13 04:24:22 +00:00
Hridya Valsaraju
fb921a1c4e Let init mount/unmount debugfs for non-user builds
This change will help non-user builds with keeping debugfs
disabled during run time. Instead, debugfs will be mounted by init
to enable boot time initializations to set up vendor debug data
collection and unmounted after boot. It will be also be mounted by
dumpstate for bug report generation and unmounted after.

This change is only intended to help vendors (who depend on debugfs to
collect debug information from userdebug/eng builds) keep debugfs
disabled during runtime. Platform code must not depend on debugfs at all.

Test: manual
Bug: 176936478
Change-Id: I2e89d5b9540e3de094976563682d4b8c5c125876
2021-01-12 14:41:53 -08:00
Hridya Valsaraju
f7c0f3d830 Setup ueventd to support DMA-BUF system-secure heap
Memory allocated from this heap will be used for secure playback.

Test: manual
Bug: 175697666
Change-Id: I16275ef0cef39b7b56cdce7c3545622712d438dc
2021-01-12 12:49:24 -08:00
Gavin Corkery
09494764ae Merge "Add /metadata/watchdog" 2021-01-08 08:20:45 +00:00
Gavin Corkery
badf3962bc Add /metadata/watchdog
This directory will be used to store the mitigation count
from Package Watchdog in the case of a boot loop, in
order to persist the value across fs-checkpointing
rollbacks. One integer will be stored in a file in this
directory, which will be read and then deleted at the
next boot. No userdata is stored.

See go/rescue-party-reboot for more context.

Test: Manual test using debug.crash_sysui property
      and inspecting file
Bug: 171951174
Change-Id: I2bd5e1ebe14d7e9e4f0e0dbeb90cf76b8400752e
2021-01-07 19:41:07 +00:00
Nicolas Geoffray
5266e041ef Merge "Add boot animation progress system property." 2021-01-07 09:23:35 +00:00
Treehugger Robot
208cad671d Merge "Adding Car GSI public key" 2021-01-06 01:05:43 +00:00
Treehugger Robot
d3ba0e28cd Merge "Reland "Create a pool of 20 measurement files per library for coverage."" 2021-01-05 19:16:50 +00:00
Karthik Ramakrishnan
bb6cebb2ec Adding Car GSI public key
Bug: 140827657
Test: m qcar-gsi.avbpubkey
Change-Id: Ib493d17b9ca3859b8613de12fb8015d2ffb766f6
2020-12-21 17:07:59 -08:00
Kevin Brodsky
13d86ad6bf init.rc: start tombstoned before switching mount namespace
Unlike apexd, tombstoned uses the regular dynamic linker path
(/system/bin/linker64). As a result, starting it after we have
switched to the default mount namespace but before APEXes have been
activated fails, because /system/bin/linker64 does not exist between
those two events. Fix that by starting tombstoned even earlier,
before we have switched mount namespace.

To avoid reintroducing the bug fixed by 2c9c8eb5ff ("init.rc:
create /data/vendor* earlier"), also make sure that /data/vendor* is
still created before /data/vendor/tombstones.

While at it, move the creation of /data/anr before starting
tombstoned, because tombstoned assumes that /data/anr exists.

Fixes: 81c94cdce6 ("Start tombstoned early in post-fs-data.")
Test: boot fvp-eng and fvp_mini-eng, check that tombstoned starts
      succesfully on the first attempt
Change-Id: Ic52383c35fb39c61c2f0e0665fd10e795895d50d
2020-12-17 16:09:36 +00:00
Pirama Arumuga Nainar
4fc933cca4 Reland "Create a pool of 20 measurement files per library for coverage."
This reverts commit 0c4fb3dd4b.

Reason for revert: Permissions issue in b/173448692 are fixed.

Change-Id: Ic0382484c8e46470b4d7986681229fef0f0dcdfc
2020-12-17 01:43:07 +00:00
Youkichi Hosoi
63fdd1ba24 ueventd: Fix property variable for ro.hardware in ueventd.rc
Property variables should be written ${x.y} to be expanded.

Bug: 175645356
Test: The property ro.hardware is expanded properly.
Change-Id: Idf7ff7ecc002e6e4de4ccef70e89dcc1c10e63d0
2020-12-16 15:54:15 +09:00
Nicolas Geoffray
e106f0aaeb Add boot animation progress system property.
Test: m
Bug: 175686819
Change-Id: Ic2757054b908e2c7ff51e256e8683616df74fb33
2020-12-15 18:34:47 +00:00
John Stultz
efb6e07e0a ueventd.rc: Add /dev/dma_heap/system-uncached permissions
Add permissions for dev/dma_heap/system-uncached dmabuf heap.

This should match the dmabuf system heap.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I9253d56c72d45e228539f709e76ba0862ae03d96
2020-12-14 23:29:55 +00:00
John Stultz
dc01a02a1a ueventd.rc: Reduce permissions for /dev/dma_heap/system to 444
Jeffrey Vander Stoep noted the permissions for the system dmabuf
heap should be 444 instead of 666, as we only need to open and
call ioctl on the device.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I650c9fabfffd1eac5f59bbc7fa1e0ae1f5646bd9
2020-12-14 23:29:35 +00:00
Elliott Hughes
21de4e727e Add new owners to various sub-projects.
Test: treehugger
Change-Id: Ia2a99c0499633ccc5d23c37a1ec93867c876d637
2020-12-11 12:45:45 -08:00
Treehugger Robot
24adfede52 Merge "Add execute permission to /data/app-staging folder" 2020-12-10 17:04:42 +00:00
Mohammad Samiul Islam
64fe2c66e2 Add execute permission to /data/app-staging folder
Package verifiers (e.g, phonesky) needs to access the folders inside
/data/app-staging to be able to verify them. Without the execute
permission on app-staging folder, it cannot stat any of the sub-dirs
inside app-staging.

This also aligns with permission of /data/app folder.

Bug: 175163376
Test: manual
Test: installed a staged session and observed that Phonesky did not log
about not finding the apks in /data/app-staging folder

Change-Id: I9774ed800da9f15401d3cee653142a37bf54ef4a
2020-12-09 21:05:28 +00:00
Tom Cherry
5b271797de ueventd: add the import option from the init parser
Vendors have an interest in importing ueventd files based on certain
property values.  Instead of baking this logic in the ueventd binary,
add the import option from the init parser to the ueventd parser, to
allow vendors to expand as needed.

Test: imported files are parsed
Change-Id: I674987fd48f3218e4703528c6d905b1afb5fb366
2020-12-08 13:21:26 -08:00
Martijn Coenen
cd91f86618 Merge "Split fsverity_init in two phases." 2020-12-07 13:55:48 +00:00
Treehugger Robot
f38f0fdd2d Merge "Adding 'postinstall' root dir unconditionally." 2020-12-05 01:15:47 +00:00
Bowgo Tsai
2e228936f4 Adding 'postinstall' root dir unconditionally.
It is required to pass update_engine_unittests in GSI
compliance test. And it's clean to just add this mount
dir unconditionally.

Bug: 172696594
Test: `m init.environ.rc` and checks that $OUT/root/postinstall exists
Change-Id: Ib340a78af442ea66c45cecb373a9eb3c428f8dda
2020-12-04 17:07:26 +08:00
Kiyoung Kim
2f3e936f72 Merge "Use bootstrap linkerconfig from early init" 2020-12-04 01:00:33 +00:00
Wei Wang
673b6d47bc Merge changes I13c9660a,I41745e7b,I0e6722b8
* changes:
  init.rc: correct the obsolete comment
  Add system-background cpu group
  init.rc: create camera-deamon stune cgroup
2020-12-03 18:57:25 +00:00
Treehugger Robot
0029d3f6c0 Merge "Follow vdc naming convention: earlyBootEnded" 2020-12-02 07:49:38 +00:00
Wei Wang
aed52ef138 init.rc: correct the obsolete comment
system-background cpuset is mapped in tasks_profiles.json.

Bug: 170507876
Test: Build
Change-Id: I13c9660a1288e22382ced4dd31f079f31bf7c8dc
2020-12-01 19:46:02 -08:00
Wei Wang
ab87979a00 Add system-background cpu group
Add system-background cgroup hierarchy for uclamp and cpu bandwidth
tuning.

Bug: 170507876
Bug: 171740453
Test: boot and check cgroup
Change-Id: I41745e7b3ac5c1d7ea7dd77f5db39c6895047446
2020-12-01 19:46:02 -08:00
Wei Wang
6a28572648 init.rc: create camera-deamon stune cgroup
camera-daemon is referred in task-profiles.json so the hierarchy should
be created in aosp's init.rc.

Bug: 170507876
Bug: 171740453
Test: boot and check cgroup
Change-Id: I0e6722b88922abf4ccae3b19623d8b889a6e3cb6
2020-12-01 19:46:02 -08:00
Wei Wang
84719713c7 Merge "rootdir/init.rc: Create camera-daemon groups" 2020-12-02 03:38:01 +00:00
Kiyoung Kim
03b9bcabff Use bootstrap linkerconfig from early init
Linkerconfig will be moved into Runtime APEX, so
/system/bin/linkerconfig would not be available before APEX is mounted.
Use bootstrap linkerconfig instead during early init.

Bug: 165769179
Test: Cuttlefish boot succeeded
Change-Id: Iae41f325bbd5f5194aaf4613141860f913dfbff1
2020-12-02 11:41:06 +09:00
Paul Crowley
3fe1a8c76c Follow vdc naming convention: earlyBootEnded
vdc commands use camelCase, not kebab-case.

Test: EarlyBootKeyTest.CannotCreateEarlyBootKeys
Change-Id: I5bcc9c435c848f5054e81ffaf87ae32577548570
2020-12-01 14:37:48 -08:00
Martijn Coenen
3b68bf2d34 Split fsverity_init in two phases.
First load the verified keys, and then only lock the keyring after apexd
has run. This is in preperation for on-device signing, which will need
to add another key to the fs-verity keyring before it's locked.

Note that I've moved loading of the verified keys up a bit; fsverity_init
used to load keys from Keymaster, but it currently doesn't, so there's
no need to wait for it.

Bug: 165630556
Test: boot, cat /proc/keys
Change-Id: I077673575ae3dafcf3126d8c544fe7f8d34c0225
2020-12-01 14:39:22 +00:00
Rick Yiu
a983f8ab1e rootdir/init.rc: Create camera-daemon groups
In task_profiles.json, camera-daemon is referred for both cpu and
cpuset controller, so create them in init.rc officially.

Test: build pass
Bug: 170507876
Change-Id: I655154ab739ffde6fdfd2d499cbaa974597d3ee7
2020-12-01 15:45:01 +08:00
Kiyoung Kim
344b46a5b3 Remove provide libs from file
Remove provide libs of system image from file, and generate it at build
time instead

Bug: 172889962
Test: Build cuttlefish and confirmed list is generated in
/system/etc/linker.config.pb

Change-Id: I365252dcb2e8735fd8f6345c9ec2c985b0489d64
2020-12-01 10:41:09 +09:00
Rick Yiu
1848e5e69c rootdir/init.rc: Remove duplicated settings
Bug: 170507876
Test: build pass
Change-Id: I2cfa886eb84982f03df9bf0db95dc1aae2117418
2020-11-23 07:29:55 +00:00
Wei Wang
77cb6a0015 init.rc: migrate tasks from root cpu cgroup to a subgroup
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
2020-11-20 12:59:20 -08:00
Seigo Nonaka
18e4372cab Set up /data/fonts directory for updatable system fonts
- /data/fonts/files
The updated font files are placed this directory. This files under
this directory are readable by any apps. Only system_server can write
font files to this directory.

- /data/fonts/config
The font configuration used by system_server is stored in this directory.
Only system_server can read/write this directory.

Bug: 173517579
Test: atest CtsGraphicsTestCases
Change-Id: I3d0edd9e58b456be5f8342a4a7babd77e54e0339
2020-11-18 12:43:55 -08:00
Oliver Nguyen
279a719fe6 Merge "Revert "Create a pool of 20 measurement files per library for coverage."" 2020-11-18 07:52:31 +00:00
Martijn Coenen
0de764d716 Merge "Call early-boot-ended from init." 2020-11-18 07:51:31 +00:00
Oliver Nguyen
0c4fb3dd4b Revert "Create a pool of 20 measurement files per library for coverage."
This reverts commit ca54a7b7a6.

Reason for revert: Missing coverage measurements for some tests

Change-Id: I5d5e364eb7ecb5b870cd3d5f529b39d78082c0ea
2020-11-17 19:01:14 +00:00
Yifan Hong
9210ee391d Fix comments.
Test: none
Change-Id: I1f2446ac31d9466ba01cef59079b49815571d6a1
2020-11-16 10:07:16 -08:00
Yifan Hong
a1ee8cea9d Merge "Fix AVB key path again." 2020-11-16 18:06:53 +00:00
Yifan Hong
5d83d87ee6 Fix AVB key path again.
If device specifies moving AVB keys to vendor ramdisk, but
doesn't have a dedicated recovery partition, install to
vendor-ramdisk/first_stage_ramdisk.

Test: manual
Bug: 156098440
Change-Id: I05a8731236996dda0d1ab3c09828f7dac46f4ac7
2020-11-13 19:08:43 -08:00
JW Wang
5fc74a490e Create the rollback directories in init (1/n)
/data/rollback-history is used to store deleted rollbacks
for debugging purpose.

Bug: 172644981
Test: Boot device without this, then try to boot with it without wiping.
Change-Id: I79da5190aad455448ccd73fe42abdc79b3649e86
2020-11-13 16:20:00 +08:00
Treehugger Robot
13e33f7f80 Merge "Create a pool of 20 measurement files per library for coverage." 2020-11-12 19:57:36 +00:00
Martijn Coenen
afe86cc088 Call early-boot-ended from init.
To make sure it's always called after apexd has run.

Bug: 168585635
Bug: 173005594
Test: inspect logs
Change-Id: Iaff175dea6a658523cdedb8b6894ca23af62bcbf
2020-11-12 11:04:34 +01:00
Oliver Nguyen
ca54a7b7a6 Create a pool of 20 measurement files per library for coverage.
Reduces disk space usage for commonly used libraries by merging coverage
data across processes.

Bug: 171338125
Test: Forrest run of coverage tests
Change-Id: I2b9e94871fc5d66971c5b7e725b296bcd721ccf2
2020-11-11 14:55:58 -08:00
Kiyoung Kim
f81058343d Merge "List up libraries with system dependency in the configuration file" 2020-11-10 05:49:35 +00:00
Suren Baghdasaryan
c6baa19d6c init: Add cpu controller hierarchy to use utilclamp controller
For devices using utilclamp create cpu controller hierarchy. Do not
remove schedtune hierarchy yet because init.rc is generic and should
work with devices which still use schedtune.

Bug: 170507876
Test: cpuctl groups worked
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I8494b0b64336e0c882847d555c262814bef2ffa1
2020-10-29 16:52:18 +00:00
Kiyoung Kim
235ae0d931 List up libraries with system dependency in the configuration file
List up libraries which has dependency with system image in the
configuration file. The list was located in linkerconfig source code,
but this makes dependency between linkerconfig and system image. This
change will remove the dependency.

Bug: 168262631
Test: cuttlefish and crosshatch boot succeeded
Change-Id: Id0abc0070b475d834096a85b90a8e88e535c6171
2020-10-29 14:50:44 +09:00
Woody Lin
45215ae6e5 init/service_parser: Add arguments window' and target' for `critical'
The critical services can now using the interface `critical
[window=<fatal crash window mins>] [target=<fatal reboot target>]` to
setup the timing window that when there are more than 4 crashes in it,
the init will regard it as a fatal system error and reboot the system.

Config `window=${zygote.critical_window.minute:-off}' and
`target=zygote-fatal' for all system-server services, so platform that
configures ro.boot.zygote_critical_window can escape the system-server
crash-loop via init fatal handler.

Bug: 146818493
Change-Id: Ib2dc253616be6935ab9ab52184a1b6394665e813
2020-10-26 11:38:01 +08:00
Primiano Tucci
253289fe07 Introduce security.lower_kptr_restrict property
This is to allow the tracing service to temporarily
lower kptr_restrict for the time it takes to build
its internal symbolization map (~200ms), only on
userdebug/eng builds.
kptr_restrict unfortunately cannot be lowered by
the tracing service itself. The main reason for that
is the fact that the kernel enforces a CAP_SYS_ADMIN
capability check at write() time, so the usual pattern
of opening the file in init and passing the FD to the
service won't work.

For more details see the design doc go/perfetto-kallsyms.
Bug: 136133013
Test: perfetto_integrationtests --gtest_filter=PerfettoTest.KernelAddressSymbolization in r.android.com/1454882

Change-Id: Ib2a8c69ed5348cc436223ff5e3eb8fd8df4ab860
2020-10-22 16:18:41 +01:00
Chiachang Wang
7396fed802 Prevent using abstract terms in the property name
In many cases, it's a common practice to use the name of the
domain type of a process or the type of the usage category
instead of using ambiguous terms like sys, system, etc.
Update the property name with net. prefix for better naming to
fit the usage of the system property.

Bug: 170917042
Test: 1. m -j10
      2. Check if /proc/sys/net/ipv4/tcp_default_init_rwnd is
         updated as expected
Change-Id: I0267880d62cc504a419827732780d2db97b2dfef
2020-10-20 19:45:02 +08:00
Yifan Hong
14096bd924 Merge "Move GSI AVB keys to vendor_boot if BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT" 2020-10-20 01:51:11 +00:00
Tom Cherry
dd5184f858 Merge "init.rc: create /data/vendor* earlier" 2020-10-19 14:57:43 +00:00
Treehugger Robot
ac46ab3c93 Merge "Load boot image props." 2020-10-16 19:23:08 +00:00
Tom Cherry
2c9c8eb5ff init.rc: create /data/vendor* earlier
A recent change moved creating /data/vendor/tombstone earlier than
/data/vendor was created, which would cause /data/vendor/tombstone to
not be created until the second time a device boots, instead of the
first.

This change moves the creation of /data/vendor* earlier, allowing
/data/vendor/tombstone to be created on the first boot.

Bug: 169659307
Test: boot CF for the first time and see /data/vendor/tombstone is
      created
Change-Id: I53ee8fbc282bc533d50756ebb4cc65a5ca582088
2020-10-16 10:39:21 -07:00
Jack Yu
b5e565d29b Merge "Create folder to store nfc snoop data" 2020-10-16 07:56:10 +00:00
Yifan Hong
a68ee762f7 Load boot image props.
This change does the following:

- Create /second_stage_resources empty dir at root.
- At runtime:
  - At first stage init:
    - mount tmpfs to /second_stage_resources.
    - Copy /system/etc/ramdisk/build.prop to
      /second_stage_resources/system/etc/ramdisk/build.prop
  - At second stage init:
    - Load prop from the above path
    - umount /second_stage_resources

Test: getprop -Z
Test: getprop
Bug: 169169031

Change-Id: I18b16aa5fd42fa44686c858982a17791b2d43489
2020-10-15 13:12:52 -07:00
Yifan Hong
f536731e5a Merge "Refactor: Move GSI AVB keys selection logic to common code." 2020-10-14 18:25:31 +00:00
Yifan Hong
762d936911 Move GSI AVB keys to vendor_boot if BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT
If BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT is set, move GSI AVB keys
to vendor_boot. The existence of these keys are device-specific, and
should not exist in the generic boot image.

Test: manual
Bug: 156098440
Change-Id: Iabe002a9f1ecd2fdf109beed98db6edd3f092399
2020-10-12 13:01:14 -07:00
Yifan Hong
d65e4851e2 Refactor: Move GSI AVB keys selection logic to common code.
Test: pass
Change-Id: I5ac139ad171432e903c400077f7855d4e4bcf041
2020-10-12 13:01:14 -07:00
Mohammad Islam
f99f09eeda Merge "Activate encryption for /data/app-staging folder" 2020-10-05 16:01:59 +00:00
Josh Gao
81c94cdce6 Start tombstoned early in post-fs-data.
Bug: http://b/169659307
Test: manual
Change-Id: Ie19de31e7e2b6cd43402cfd3a2e9274728e9e6b4
2020-10-01 14:25:36 -07:00
Mohammad Samiul Islam
0098201dc3 Activate encryption for /data/app-staging folder
Without enabling the encryption on this folder, we will not be able to
rename files from this folder to /data/app folder, since /data/app
folder is encrypted. Trying to rename files between unencrypted folder
to encrypted folder throws EXDEV error.

Turning on encryption for /data/app-staging has the following concerns:

1. Turning on the encryption will erase all of its content. But this is fine
since during OTA we fail all staged sessions anyway.
2. We need to create hardlinks from /data/app-staging to
/data/apex/active. This is also fine since we will be creating link from
encrypted folder (/data/app-staging) to non-encrypted folder and this
does not throw EXDEV error.

Bug: 163037460
Test: atest StagedInstallTest
Change-Id: Ie78f6df0c0e08de54a39c5e406957ad0a56b7727
2020-09-24 19:37:21 +01:00
Yifan Hong
4fd78ec4b3 Merge changes from topic "revert-1413808-modules_partition-UXSIXCGPHZ"
* changes:
  Revert "rootdir: Add modules directory"
  Revert "fastboot: add modules partition"
2020-09-16 22:45:54 +00:00
Yifan Hong
d50c7374cc Revert "rootdir: Add modules directory"
Revert submission 1413808-modules_partition

Reason for revert: modules partition no longer needed
Reverted Changes:
Iceafebd85:Add modules partition
I2fa96199a:rootdir: Add modules directory
Ie397b9ec6:Add modules partition.
I4200d0cf5:fastboot: add modules partition

Bug: 163543381

Change-Id: Ic9a94892c3403675eeac694d9ca0af5654f1a5c8
2020-09-15 20:07:03 +00:00
Hridya Valsaraju
72a0f10f51 Setup ueventd to support DMA-BUF heaps
Test: tested on cuttelfish with DMA-BUF heaps enabled.
Bug: 168333162
Change-Id: I2e7ed71d329edbb77319ca3cfbc4f0bf6be8fd98
2020-09-11 14:42:31 -07:00
Treehugger Robot
3bede4f44f Merge "Remove persist.sys.fuse == false code paths" 2020-09-11 15:00:27 +00:00
vichang
277c702dc3 Merge "Add a new public library libicu.so" 2020-09-11 10:19:37 +00:00
Zim
c46c2350e5 Remove persist.sys.fuse == false code paths
Since Android R, the FUSE prop is always on and FUSE-off is no longer
supported

Test: m
Bug: 160159282
Change-Id: I6db20fe8cbf8d260ba21fed5da289eacd4e53ef5
2020-09-11 11:06:29 +01:00
Yifan Hong
135508168a Merge changes from topic "modules_partition"
* changes:
  fastboot: add modules partition
  rootdir: Add modules directory
2020-09-11 00:25:24 +00:00
Treehugger Robot
bc2fbe9ce4 Merge "Create directories under /data/local/tests at boot" am: 480335dfd6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1416432

Change-Id: I3136907e6137b8045e884b9cbffbe096951b8010
2020-09-03 03:07:06 +00:00
Colin Cross
7201ef820f Create directories under /data/local/tests at boot
Create directories under /data/local/tests at boot for atest to use
to execute tests on the device.

Bug: 138450837
Test: atest binderVendorDoubleLoadTest memunreachable_unit_test memunreachable_binder_test
Change-Id: Ic8e5031ad8701a063be14b6db760feb78f3eb412
2020-09-01 11:17:37 -07:00
Xin Li
0a112d52f8 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Id18cb0e2d2f3e776a42b566c4a1af2e250890896
Change-Id: Iba7cab32ab3aa6f47952c840ff6dc8492e8d0704
2020-08-29 01:42:13 -07:00
Victor Chang
f1d18ccc8e Add a new public library libicu.so
Bug: 160350521
Test: atest CtsJniTestCases
Change-Id: I9693dc225d2ccbdd55b5e609250534e541aaeb75
2020-08-28 15:17:08 +01:00
Gavin Corkery
c0d11aa73a Merge "Store userspace reboot info in /metadata" 2020-08-26 21:47:19 +00:00
Yifan Hong
6373d11b21 rootdir: Add modules directory
... as the mount point for the modules partition. If
the partition does not exist, just leave the directory
empty.

Test: on CF check /proc/mounts
Bug: 163543381
Change-Id: I2fa96199a029179395a2d655937728f4275ba2b3
2020-08-25 18:02:23 -07:00
Gavin Corkery
8c92256df5 Store userspace reboot info in /metadata
Store pertinent information about userspace reboot events in the case
of failure. This information is any services which failed to stop
cleanly, the output of the default fstab and /proc/mounts, and
a list of mounts which failed to unmount. This information is only
stored as necessary (i.e. mount information will not be stored if
everything unmounted, even if some services failed to stop).

Added new /metadata/userspacereboot directory to persist this
information. Information older than 3 days will be deleted.

Test: adb reboot userspace with sigterm/sigkill timeouts set to
      very low values
Test: Manual test of storing all other information
Bug: 151820675
Change-Id: I6cfbfae92a7fc6f6c984475cad2c50c559924866
2020-08-21 17:32:34 +01:00
Marco Ballesio
fdc03350f4 init.rc: remove initializations to cg2_bpf path
https://r.android.com/c/1324649/5 moves the cgroup folder to its sysfs
path. Directory access rights are defined by kernel code and sepolicy,
so remove the initialization lines from init.rc.

Test: manually booted the device and verified access rights for
/sys/fs/cgroup
Bug: 154548692

Change-Id: I67284dc651ed529cae69e413b66c6e1292a2d970
2020-08-21 09:18:58 -07:00
Marco Ballesio
1c755e22c8 libprocessgroup: switch freezer to cgroup v2
remove cgroup v1 freezer entries from init.rc, add a new cgroup v2
controller and modify plists to properly interact with it.

Bug: 154548692
Test: manually verified the the cgroup v1 freezer controller isn't
created and a new controller for cgroup v2 is created under the correct
sysfs directory.

Change-Id: I1b811300ade486f88fdbd157255a7f37750cc54d
2020-08-20 15:11:41 -07:00
Marco Ballesio
76eca5b4c1 freezer: allow dynamic changes to freezer.state
create new profiles to allowing thawing and freezing back the freezer
cgroup

Bug: 151225245
Test: Manually verified that using the SetTaskProfiles method on the
profiles thaws and freezes back the freezer cgroup.

Change-Id: I7f3e193ebe79b49c1f6ac52b6138ff4ec26fc570
2020-08-19 13:18:28 -07:00
Jack Yu
6097da8b76 Create folder to store nfc snoop data
Bug: 153704838
Test: nfc snooop could be stored in this folder
Change-Id: I0cb8ea1844e6774d47d3804ed6ddb3b2206be8c8
2020-08-14 17:53:56 +08:00
Jaegeuk Kim
43dca3c8be add generic symlink to access userdata sysfs
This patch adds fixed location to access sysfs entries by introducing:
/dev/sys/fs/by-name/userdata -> /sys/fs/f2fs/dm-<num>
/dev/sys/block/by-name/userdata -> /sys/block/dm-<num>

Bug: 144277579
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I1b3768005fc8720694bace05292a1b1171d60e3c
2020-07-27 23:58:36 +00:00
Jaegeuk Kim
8d8edad443 rootdir/init.rc: enable iostat by default
Bug: 152162885
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: If95e30c7d3bfec621dfde9452a6eda5211c64a2b
Merged-In: If95e30c7d3bfec621dfde9452a6eda5211c64a2b
2020-07-25 00:20:47 +00:00
Yifan Hong
30b52007e5 Merge changes from topic "odm_dlkm" am: 3e31ec8392 am: 8c3a7ca939
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1363939

Change-Id: I8cdd4583c894d7fb5168fce1df789f2973a57357
2020-07-17 22:52:14 +00:00
Yifan Hong
e306bce927 rootdir: add odm_dlkm symlinks
Test: builds and boots
Bug: 156020364
Change-Id: I678b787cbf81ea6038936a4059e0bf5adfe3274f
2020-07-15 17:15:49 -07:00
Yifan Hong
a8e5779e18 Merge changes from topic "vendor_dlkm" am: 7ca7680ec5 am: 0c1a242060
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1350785

Change-Id: I7db376a03c329023a626c1130b7a55dc74ae9ae1
2020-07-14 19:47:16 +00:00
Yifan Hong
9374a9c6f7 rootdir: add vendor_dlkm symlinks
Test: builds and boots
Bug: 156020364
Change-Id: I99b0eeda0066d6c885aefe181f233a97507a61a9
2020-07-09 15:06:44 -07:00
Keun-young Park
bf73d615f2 Merge "Start statsd before starting zygote" into rvc-dev am: 163548736a
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11975342

Change-Id: I71ad1f73f19e0ddf7e856ecd981132498f538fea
2020-06-24 21:39:10 +00:00
Keun-young Park
163548736a Merge "Start statsd before starting zygote" into rvc-dev 2020-06-24 21:18:18 +00:00
Nikita Ioffe
a462044ac8 Explicitly call restorecon_recursive on /metadata/apex
On some devices we see a weird in which /metadata/apex will have a wrong
selinux label. This will effectively prevent such devices from getting
any apex updates. Since we haven't figured out a root cause for this
bug, it's safer to explicitly call restorecon on /metadata/apex to make
sure it's correct.

This change shouldn't affect a normal boot flow, since /metadata/apex
will already have a correct label and restorecon_recursive will be a
no-op.

Test: rm -Rf /metadata/apex && \
    mkdir /metadata/apex &&
    mkdir /metadata/apex/sessions
Bug: 149317789
Merged-In: I971ffe35c93bb79d9e71106c24515ec0ee70333a
Change-Id: I971ffe35c93bb79d9e71106c24515ec0ee70333a
(cherry picked from commit cf7b6bad55)
2020-06-24 16:30:03 +01:00
Keun young Park
6423ccd96b Start statsd before starting zygote
- zygote needs statsd for logging boot time event.
- statsd starting later leads into stats logging failure which
  is reported by all child processes of zygote later.
  This brings lots of noise in statsd error.

Bug: 159664734
Test: reboot and check if error log does not show up
  E statsd  : Found dropped events: 1 error -19 last atom tag 240 from uid 10169
Change-Id: Ie585febb50a9668671c8fda41a872595baae8385
2020-06-23 20:40:19 -07:00
Maciej Zenczykowski
ae53160792 Merge "add a new trigger for launching the bpfloader" into rvc-dev am: 227635182f
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11976442

Change-Id: Iff982438e428ca5782f93a010c5ffd5ca15217ab
2020-06-24 03:10:31 +00:00
Maciej Zenczykowski
227635182f Merge "add a new trigger for launching the bpfloader" into rvc-dev 2020-06-24 02:52:51 +00:00
Maciej Żenczykowski
c1ca9f75f9 add a new trigger for launching the bpfloader
Test: built and booted
Bug: 150040815
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Merged-In: If80758b3d7bf499d428880efa5ed555076bfc291
Change-Id: If80758b3d7bf499d428880efa5ed555076bfc291
2020-06-23 14:08:27 -07:00
Nikita Ioffe
d9469bdcd5 Merge "Explicitly call restorecon_recursive on /metadata/apex" into rvc-dev am: 6a8602a8c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11955299

Change-Id: Ibbf598ea7aac33a50fc5c7b1cab87317284e7de5
2020-06-22 21:52:04 +00:00
Nikita Ioffe
cf7b6bad55 Explicitly call restorecon_recursive on /metadata/apex
On some devices we see a weird in which /metadata/apex will have a wrong
selinux label. This will effectively prevent such devices from getting
any apex updates. Since we haven't figured out a root cause for this
bug, it's safer to explicitly call restorecon on /metadata/apex to make
sure it's correct.

This change shouldn't affect a normal boot flow, since /metadata/apex
will already have a correct label and restorecon_recursive will be a
no-op.

Test: rm -Rf /metadata/apex && \
    mkdir /metadata/apex &&
    mkdir /metadata/apex/sessions
Bug: 149317789
Change-Id: I971ffe35c93bb79d9e71106c24515ec0ee70333a
2020-06-22 16:56:38 +00:00
Maciej Żenczykowski
6c72c16e3d add a new trigger for launching the bpfloader
Test: built and booted
Bug: 150040815
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If80758b3d7bf499d428880efa5ed555076bfc291
2020-06-22 01:11:39 -07:00
Tim Murray
e95e2ca22c Merge "Move zygote64 into the top-app stune group." into rvc-dev am: 4dc1d5f3de
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11884893

Change-Id: I05d064f1c4f7241a5c9efc09ee6af33985a1f857
2020-06-18 19:37:18 +00:00
Tim Murray
e2318a2fce Move zygote64 into the top-app stune group.
Improve app startup performance before the new app is in the top-app
cpuset.

Test: boots, zygote64 in top-app stune group
Bug: 159201879

Change-Id: I3aad4b4b1d2f54db9e7ba86db8a655d8552bad0a
2020-06-18 10:43:01 -07:00
Treehugger Robot
620a7053c5 Merge "init.rc: chmod pagetypeinfo to 440 to be captured in BRs" am: a5032be8e0 am: f9537f222b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1335693

Change-Id: Id9735c5b6677e25f29ea817da30a3df84bee9fed
2020-06-16 08:50:38 +00:00
Martin Liu
0abd0d6aa5 init.rc: chmod pagetypeinfo to 440 to be captured in BRs
Bug: 158928824
Test: Try BR
Change-Id: I2fa42780b77d86a234ae8b53d7264fbfd6a7906c
2020-06-15 15:24:43 +00:00
Elliott Hughes
cec2d69a0b Merge "Remove zygote configuration for 32-bit primary, 64-bit secondary." 2020-06-10 23:52:34 +00:00
Elliott Hughes
409bca11de Remove zygote configuration for 32-bit primary, 64-bit secondary.
Bug: https://issuetracker.google.com/138812821
Test: treehugger
Change-Id: I67c59f1956cec7ea46ded6e0a772ac1226e2a7b3
Merged-In: I67c59f1956cec7ea46ded6e0a772ac1226e2a7b3
2020-06-10 22:52:52 +00:00
Elliott Hughes
326f8e27db Remove zygote configuration for 32-bit primary, 64-bit secondary.
Bug: https://issuetracker.google.com/138812821
Test: treehugger
Change-Id: I67c59f1956cec7ea46ded6e0a772ac1226e2a7b3
2020-06-10 00:24:48 +00:00
Rick Yiu
11d167b575 Fine tune blkio setting to improve boot time
Bug: 133200996
Test: boot time test
Change-Id: I5262c28596adb7e849b202b8a163c190818f271a
Merged-In: I5262c28596adb7e849b202b8a163c190818f271a
2020-06-09 04:34:40 +00:00
Rick Yiu
20570fa261 Merge "Fine tune blkio setting to improve boot time" am: cb63bed8b5 am: 30ec7c391c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1322741

Change-Id: Id247a8523cf5a2dbb53e42b77c77af5406e02051
2020-06-06 00:41:19 +00:00
Rick Yiu
ad74d8dee0 Fine tune blkio setting to improve boot time
Bug: 133200996
Test: boot time test
Change-Id: I5262c28596adb7e849b202b8a163c190818f271a
2020-06-04 14:28:19 +08:00
Mohammad Samiul Islam
6e51de9840 Merge "Create /metadata/staged-install dir to store staged install failure reasons" into rvc-dev am: 000226f1d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11408963

Change-Id: I3b8fd6a68aad1300eaeb2dd03415b90216b3fa61
2020-06-03 10:19:32 +00:00
Mohammad Samiul Islam
000226f1d5 Merge "Create /metadata/staged-install dir to store staged install failure reasons" into rvc-dev 2020-06-03 09:57:18 +00:00
Martijn Coenen
4ff6531bc5 Merge changes from topic "fusectl" into rvc-dev am: 6030f2f016
Change-Id: I4888400ae48f4061e938832f49c8d1e453798244
2020-05-29 14:54:54 +00:00
Martijn Coenen
dd0440f4e5 Abort FUSE filesystem when Zygote restarts.
The FUSE filesystem is implemented by a Zygote child. If Zygote dies,
all of its children die along with it, including the FUSE daemon. The
FUSE filesystem is cleaned up automatically whenever the /dev/fuse file
descriptor of the FUSE daemon is closed. However, due to the way the
binder driver holds on to the 'struct files' of processes in the kernel,
the closing of FDs of all of Zygote's children is serialized.

That in turn means that, if a process has a file with dirty pages on
FUSE, and that FD is closed *before* the FUSE FD, the FUSE kernel driver
will happily issue a request to the FUSE daemon to serve that request.
But since the FUSE userspace daemon is already dead, it will never get
served. And because the closing of all FDs is serialized, we will never
close the FUSE fd to unblock this request.

Solve this particular case by manually aborting the FUSE filesystem when
Zygote restarts. Because we now explicitly close the FUSE fd, the FUSE
filesystem will be cleaned up, all outstanding requests to it will be
cancelled, and new ones will be skipped.

Bug: 153411204
Test: kill zygote manually
Change-Id: I2cb6c1a03cc1a932461ff33558894a428ff35180
2020-05-28 19:11:01 +02:00
Martijn Coenen
959dcf106d Mount fusectl filesystem.
To allow us to manually abort FUSE filesystems.

Bug: 153411204
Test: inspect /sys/fs/fuse/
Change-Id: I150597635d62932aa70ee696b4d978c822e6ea8d
2020-05-28 16:25:45 +02:00
Mohammad Samiul Islam
d192d5471c Create /metadata/staged-install dir to store staged install failure reasons
Bug: 146343545
Test: presubmit
Change-Id: I513d403f67643929bb8f90212c1054fb3024f12a
2020-05-20 18:55:13 +01:00
Nikita Ioffe
ae6cab0406 Merge "Make /data/apex/active world readable" 2020-05-13 20:15:12 +00:00
Orion Hodson
b0efc1f6c7 Merge "Add libnativehelper.so to public libraries" am: 2f448104d7 am: 278c9794ec
Change-Id: I8b9e113b50ad18bf54043cd619c41cc4dc52ff06
2020-05-04 07:43:37 +00:00
Orion Hodson
2f448104d7 Merge "Add libnativehelper.so to public libraries" 2020-05-04 07:23:19 +00:00
Kyle Lin
106d6fe775 rootdir: init.rc: mount tracefs
Bug: 153849221
Test: build and try to capture the trace by perfetto and systrace
Change-Id: Ie8a13e12038bd66afcd264079a2c5f25daaa20ee
Merged-In: Ie8a13e12038bd66afcd264079a2c5f25daaa20ee
(cherry picked from commit 9d19a05422)
2020-04-30 22:04:37 +08:00
Treehugger Robot
fd44bc6518 Merge "rootdir: init.rc: mount tracefs" am: a5fa1ae859 am: 8535d19357
Change-Id: I2770f5ef2a48f0430519c626d7d24464f93e30de
2020-04-30 03:16:44 +00:00
Kyle Lin
9d19a05422 rootdir: init.rc: mount tracefs
Bug: 153849221
Test: build and try to capture the trace by perfetto and systrace
Change-Id: Ie8a13e12038bd66afcd264079a2c5f25daaa20ee
2020-04-30 02:15:42 +08:00
Orion Hodson
e123b3ca5a Add libnativehelper.so to public libraries
Bug: 150252746
Bug: 151443957
Test: m & boot
Change-Id: If595a8af164cddb7d9471aa54607f878b3b4ed8c
2020-04-29 17:48:40 +01:00
Nikita Ioffe
b8591b5ace Make /data/apex/active world readable
This will allow Phonesky to read APEXes under /data/apex/active.

Test: adb shell su 10114 dd if=/data/apex/active/com.android.tzdata@300000000.apex of=/dev/null
Bug: 154635217
Merged-In: I5278897413ca0e32aed9d1c7f82e48138bc51404
Change-Id: I5278897413ca0e32aed9d1c7f82e48138bc51404
2020-04-24 23:40:34 +01:00
Nikita Ioffe
fb4ac314ec Merge "Make /data/apex/active world readable" into rvc-dev am: e343f439a3
Change-Id: Ic976bf67ad7bb28547903cc64617b250b3c35004
2020-04-24 21:59:40 +00:00
Nikita Ioffe
e343f439a3 Merge "Make /data/apex/active world readable" into rvc-dev 2020-04-24 21:44:40 +00:00