Commit Graph

65040 Commits

Author SHA1 Message Date
Elliott Hughes 2acdc9de33 Merge "Use freecon() with getcon()/getfilecon()." 2020-12-09 19:03:16 +00:00
Treehugger Robot 25f322d353 Merge "Add Android Studio Emulator team mebers to OWNERS" 2020-12-09 16:46:02 +00:00
Tom Cherry 6cf3695502 Merge "ueventd: add no_fnm_pathname option" 2020-12-09 15:50:16 +00:00
Tom Cherry 0608e36fb9 Merge "ueventd: add the import option from the init parser" 2020-12-09 15:47:25 +00:00
Elliott Hughes d92c6a12da Use freecon() with getcon()/getfilecon().
Bug: https://issuetracker.google.com/175090444
Test: treehugger
Change-Id: Ia2b8102f1c9a4fd56ec1ff026ba5b4f375102b9b
2020-12-08 22:30:17 -08:00
Roman Kiryanov d61738e8f1 Add Android Studio Emulator team mebers to OWNERS
qemu_pipe is an Android Studio Emulator (aka goldfish)
implementation detail.

Bug: 175046060
Test: none
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I7a80cdf1a2cd6b5af0d9544648b9d25e6abf9fad
2020-12-08 16:08:59 -08: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
Treehugger Robot bca7bfcc54 Merge "ueventd: Add support for updating permissions on bind" 2020-12-08 18:53:44 +00:00
Tom Cherry 47031c8c88 ueventd: add no_fnm_pathname option
If a `*` appears within (but not at the end) of a /dev or /sys path in
a ueventd.rc file, then that path is matched with fnmatch() using the
FNM_PATHNAME, which means `*` will not match `/`.  That is not always
the intended behavior and this change creates the no_fnm_pathname
option, which will not use the FNM_PATHNAME flag and will have `*`
match `/`.

Bug: 172880724
Test: these unit tests
Change-Id: I85b813d89237dbf3af47564e5cbf6806df5d412f
2020-12-07 14:58:19 -08:00
Treehugger Robot 77692aeea2 Merge "Make libcutils' thread local stuff more clearly deprecated." 2020-12-07 17:58:30 +00: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
Treehugger Robot 0a9aff2315 Merge "Fix visibility rules for apex/statsd" 2020-12-04 07:25:42 +00:00
Baligh Uddin 1b5888ee02 Fix visibility rules for apex/statsd
The //frameworks/base/apex/statsd path is being migrated to
//packages/modules/StatsD/apex.
BUG: 167962588
TEST: TH

Change-Id: Ifa64bd8268f1515597b11376cdf08828983e0c60
2020-12-04 06:07:38 +00:00
Jonglin Lee ac216acad5 Merge "Revert "libprocessgroup: uid/pid hierarchy for cgroup v2"" 2020-12-04 04:47:39 +00:00
Daniel Rosenberg 2e67e77752 Merge changes Ia3aa8b3b,I6e8b80a8,I28552889
* changes:
  libsnapshot: Support cluster_ops in make_cow_from_ab_ota
  libsnapshot: Add silent option to inspect_cow
  libsnapshot: Group CowOperations into clusters
2020-12-04 03:47:57 +00:00
Jonglin Lee 4bbabe4ca4 Revert "libprocessgroup: uid/pid hierarchy for cgroup v2"
Revert "sepolicy: rules for uid/pid cgroups v2 hierarchy"

Revert submission 1511692-cgroup v2 uid/pid hierarchy

Reason for revert: Causing intermittent cgroup kernel panics
Reverted Changes:
I80c2a069b:sepolicy: rules for uid/pid cgroups v2 hierarchy
I73f3e767d:libprocessgroup: uid/pid hierarchy for cgroup v2

Bug: 174776875
Change-Id: I2af586d63bb0312407b90b52909330cde4b7b074
Test: Locally reverted and booted 100 times without kernel panic
2020-12-04 03:12:59 +00:00
Treehugger Robot a9e6057dad Merge "Add product_available to product available modules" 2020-12-04 02:54:47 +00:00
Treehugger Robot 78edd704ab Merge "Revert "libsnapshot: Don't package snapuserd.rc in /vendor/etc."" 2020-12-04 02:08:06 +00:00
Kiyoung Kim 2f3e936f72 Merge "Use bootstrap linkerconfig from early init" 2020-12-04 01:00:33 +00:00
Justin Yun feef4d390f Add product_available to product available modules
vendor_available modules were available to product modules.
However, not all vendor_available modules are required to be
available to product modules. Some modules want to be available only
to product modules but not vendor modules.

To cover the requirement, we separate product_available from
vendor_available.
vendor_available will not provide product available module.

Rename libcutils/include_vndk to libcutils/include_outside_system as
it provides the headers to the modules outside the system partition
including /product.

Bug: 150902910
Test: build
Change-Id: I791b5a6a1dc99442065debfce6fa0f54a335fcea
2020-12-04 09:59:20 +09:00
Marco Ballesio 382d70e770 Merge "libprocessgroup: move freezer to uid/pid hierarchy" 2020-12-03 22:52:19 +00:00
Suren Baghdasaryan 42fcd76e6c Merge "libprocessgroup: Change per-API level task profiles to override the diffs" 2020-12-03 22:50:57 +00:00
Yifan Hong f76e65f286 Revert "libsnapshot: Don't package snapuserd.rc in /vendor/etc."
This reverts commit 68ba6695bd.

Bug: 174587489
Test: build and manual inspect

Reason for revert: revert workaround. Fix is in I71227d807244b.

Change-Id: I71b1c0f933eeba9dd8d8fbef3a682657f005cc3b
2020-12-03 22:29:41 +00:00
Marco Ballesio 1414a0d4d8 libprocessgroup: move freezer to uid/pid hierarchy
Migrate the freezer controller as an attribute for the uid/pid hierarchy

Bug: 168907513
Test: manually verified that the freezer behavior was as expected after
applying the enablers in ActivityManager

Signed-off-by: Marco Ballesio <balejs@google.com>
Change-Id: Ica2c4bfd20190fb2f2dc0a530eb47e1a8427c522
2020-12-03 22:00:33 +00:00
Suren Baghdasaryan 756a60459c libprocessgroup: Change per-API level task profiles to override the diffs
Current per-API level task profiles replace the latest task profiles
rather than overriding the diffs. This poses an issue when a new
feature is added which is applicable to older devices as well we
have to change all per-API level profiles. Change the per-API task
profile support to load the latest task profiles first and then override
with per-API task profiles, similar to how vendor task profiles override
system task profiles. This minimizes the changes we need to do to the
per-API level task profiles going forward and is more consistent with
how vendor task profiles work.

Bug: 170507876
Test: boot with per-API task profiles
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I08cc4b374cede7363cf96a30ac96971d49bb7847
2020-12-03 19:39:31 +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
David Anderson b27b678195 Merge "libsnapshot: Don't package snapuserd.rc in /vendor/etc." 2020-12-03 05:35:28 +00:00
Daniel Rosenberg 8603df2668 libsnapshot: Support cluster_ops in make_cow_from_ab_ota
Allows make_cow_from_ab_ota to specify cluster sizes with the
-cluster_ops flag.

Bug: 172026020
Test: make_cow_from_ab_ota -cluster_ops [n] [source] [dest folder]
Change-Id: Ia3aa8b3bb602944a9d4e9954be37afb262caf060
2020-12-02 21:31:23 -08:00
Daniel Rosenberg d97386c3ad libsnapshot: Add silent option to inspect_cow
This adds the -s option to not print out Cow information, providing a
simple benchmark for reading and iterating through a cow file one time.

Bug: 172026020
Test: inspect cow -s [file]
Change-Id: I6e8b80a80c71155364b8467acd556d00f1dd2a42
2020-12-02 21:31:22 -08:00
Daniel Rosenberg c62fdd91c0 libsnapshot: Group CowOperations into clusters
This introduces clusters of CowOperations to the Cow Format, improving
reader performance by allowing many operations to be read at once.

When the header's cluster_ops is a nonzero value, operations will be
clumped into packs of that number, where the last op is a special
CowClusterOp, which points to the start of the next cluster. Each
cluster is immediately followed by it's data, with the footer following
at the end of the file.

cluster_ops must not be 1, as we must include a CowClusterOp in each
group.

Change-Id: I2855288958d56569d4078f377ef0b8c01ca5c6e7
Bug: 172026020
Test: cow_api_test
2020-12-02 21:31:22 -08:00
Akilesh Kailash dd58ffd1a6 Merge changes I1dc28606,I4d77c435
* changes:
  libsnapshot:VABC: Allow batch merge
  libsnaphot: Refactor cow_snapuserd test
2020-12-02 22:36:38 +00:00
Treehugger Robot e248d1fa02 Merge "Add visibility for statsd in prep for migration." 2020-12-02 21:47:17 +00:00
Treehugger Robot 8d92971688 Merge "libprocessgroup: uid/pid hierarchy for cgroup v2" 2020-12-02 19:50:11 +00:00
Elliott Hughes 0675702c62 Make libcutils' thread local stuff more clearly deprecated.
libcutils' thread local stuff is almost unused already, so let's try
harder to prevent new users. (In parallel I'll try to actually move the
four existing users off it, so we can actually remove this.)

Test: treehugger
Change-Id: Ib5445a43cff1f161ce1c7a45959d5b126f6f6980
2020-12-02 11:22:29 -08:00
Marco Ballesio 4d45b59f80 libprocessgroup: uid/pid hierarchy for cgroup v2
Enable the uid/pid hierarchy for all groups when using cgroup v2. Mount
the hierarchy under the cgroup v2 root. Make sure that all files under
the hierarchy are accessible by the system user.

Test: booted the device, tested the freezer cgroup, manually verified
the working of the freezer from logs and by checking statuses of
processes.

Bug: 168907513
Test: Booted the device, verified no regressions on process group access
Change-Id: I73f3e767d377902af6e12facb503b9136fb39e08
2020-12-02 09:51:42 -08:00
Sriharsha Allenki e6094789b4 ueventd: Add support for updating permissions on bind
Current implementation updates the permissions of sysfs
nodes of a device upon the following actions: "add",
"change" and "online".
But certain sysfs nodes (ex: wakeup capabilities under
power management) of devices are not present when the
device is added, but these are generally dependent on
the device driver and are added once the driver is bound.
This is particularly common in USB host stack.
If the bind action events are not parsed the ueventd
will not update the permissions of these nodes.

Hence, add the support for updating permissions on
bind action as well.

Bug: 174215510
Test: Verified permissions updated on bind action
Change-Id: Ic1a147e3993ef78dd6c539bbae652e8107207b87
2020-12-02 18:07:41 +05:30
Treehugger Robot 0029d3f6c0 Merge "Follow vdc naming convention: earlyBootEnded" 2020-12-02 07:49:38 +00:00
David Anderson 68ba6695bd libsnapshot: Don't package snapuserd.rc in /vendor/etc.
This is happening accidentally because of a bug in Soong. In the
meantime, add a separate snapuserd.vendor_ramdisk that does not have an
init_rc section.

Bug: N/A
Test: manual test
Change-Id: I9dcafb681f209932fa13c5c55478f0e486e53306
2020-12-01 22:11:19 -08: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
Wenhao Wang 36d45bbfd5 Merge "trusty-ut-ctrl: Make it as binary" 2020-12-02 03:28:58 +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
Akilesh Kailash 37641374e8 libsnapshot:VABC: Allow batch merge
Kernel will batch the merge operations only when
block numbers of source and cow device are contiguous.

Daemon will read the COW file and post-process
the operations so that kernel can batch merge the potential
operations.

There are two key changes done in post-processing:

1: COW file contains all the copy operations at the
beginning of the file. We cannot allow batch
merging of COPY operations as a crash in between
the overlapping copies can result in a corrupted state.
Hence, allow copying individual blocks at a time.

2: Replace and Zero operations can be batch merged.
However, reading our existing COW format as-is
will not allow kernel to batch merge. Hence,
process the operations in such a way that kernel can batch
merge them.

Furthermore, it is observed that sync() after every
merge is a overhead. Hence, we will only sync()
for copy operations only. For replace and zero
operations, we will not explicitly sync. This is ok as
crash in between replace/zero merge operations can
redo those operations. However for copy, we have
to make sure that sync is completed before next copy
operation is initiated.

Merge time of a full OTA on bramble is around ~60
seconds as compared to ~10+ minutes prior to this
optimization.

Note that we still have copy operations which are not
batch merged. Hence, OTA with significant number of
copy operations can still have overhead on merge timings.

Bug: 174112589

Test: vts_libsnapshot, cow_snapuserd_test
Full OTA on bramble.

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I1dc286067a26ea399fa5d4e8e826e5622ce3fa58
2020-12-02 02:29:38 +00:00
Baligh Uddin 5be28efc34 Add visibility for statsd in prep for migration.
BUG: 167962588
TEST: TH
Change-Id: If8579f0942eb051e41105a56891953eda00920d2
2020-12-02 01:57:08 +00:00
Kiyoung Kim e11663f483 Merge "Remove provide libs from file" 2020-12-02 00:28:25 +00: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