Commit graph

3067 commits

Author SHA1 Message Date
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
Oli Lan
7c59fc4fb4 Observe new apexd status value of "activated" as required.
- Cherry pick of aosp/1228482

As of aosp/1224611, there is a new step in the preparation of APEXes
where init calls back into apexd after DE user data is unencrypted to
allow DE apex data to be snapshotted or restored.

aosp/1228581 introduces a new apexd.status value of "activated" that
is set once APEXes are activated but before this snapshot has occurred.

init may execute "perform_apex_config" once this has occurred, so this
CL changes init to wait for "activated" rather than "ready" before
doing this.

Bug: 148672144
Test: build & flash, check boot completes and check in logs that init
waits on the correct status value.
Merged-In: I339580bf593d3b09a5dff749ac2a5d1952bcb210
Change-Id: I71b62c9dd2f7951811606002f38612784d3d9086
2020-04-22 12:37:27 +00:00
Nikita Ioffe
71278019d1 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
Change-Id: I5278897413ca0e32aed9d1c7f82e48138bc51404
2020-04-21 21:14:59 +01:00
Jaegeuk Kim
fc80e8c42b Merge "rootdir/init.rc: enable iostat by default" into rvc-dev am: 418f28dbe4
Change-Id: I256d5b864a824c36eb77e3d767c89488876059bf
2020-04-16 00:58:14 +00:00
Jaegeuk Kim
418f28dbe4 Merge "rootdir/init.rc: enable iostat by default" into rvc-dev 2020-04-16 00:48:11 +00:00
Nikita Ioffe
0a5ed30d7e Merge "Manually unmount /data_mirror mounts in the right order" am: 9cd3c84dc1 am: 6cdf64a2ef
Change-Id: I6d7e3f2ebf77a29c5f54ea3ad4c284df551403c2
2020-04-07 18:03:26 +00:00
Nikita Ioffe
a680e261e6 Manually unmount /data_mirror mounts in the right order
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 152823078
Change-Id: I57ff9182807630d8cbcf3ca6374fdd6dc6379da5
Merged-In: I57ff9182807630d8cbcf3ca6374fdd6dc6379da5
(cherry picked from commit bf66f433d6)
2020-04-07 18:54:48 +01:00
Nikita Ioffe
bf66f433d6 Manually unmount /data_mirror mounts in the right order
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 152823078
Change-Id: I57ff9182807630d8cbcf3ca6374fdd6dc6379da5
2020-04-07 15:43:10 +00:00
Jaegeuk Kim
767c723c25 rootdir/init.rc: enable iostat by default
Bug: 152162885
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: If95e30c7d3bfec621dfde9452a6eda5211c64a2b
2020-04-02 05:06:00 +00:00
Jaegeuk Kim
701add4103 Merge "rootdir: init.rc: use default dirty writeout policy" am: a76ee8b929 am: 6fa02ca30a
Change-Id: Icec865962b9463d9303d2367b97f074b3b17e8cb
2020-03-31 16:19:48 +00:00
Jaegeuk Kim
58ff5075ac rootdir: init.rc: use default dirty writeout policy
This patch removed the old writeout policy tune which was never touched since
2009. In the meantime, most of Android devices are equipped with over 4GB DRAM
and very fast flash storages like UFS, which becomes more like desktop or
servers in 2009. So, it'd be worth to go back to use the default kernel configs.

Bug: 129751503
Change-Id: Idb58f5b01bbc4afd270cffba5b8912ea3565819f
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2020-03-31 01:49:13 +00:00
Jeffrey Huang
c262d79974 Add new directory for stats metadata
Also reordered the directories in alphabetical order

Test: m -j
Bug: 149838525
Merged-In: I1a918d189d8bcb394ec6f818d033dbf7e4518713
Change-Id: I4b10a01ed6b3285aec6d87765f225c41ec55be96
2020-03-19 10:13:11 -07:00
Automerger Merge Worker
ab43bfb170 Merge "freezer: allow dynamic changes to freezer.state" into rvc-dev am: 3eb99ecf0f
Change-Id: Ic3db6564a360117d748fabcec29106e695e737a8
2020-03-17 16:24:31 +00:00
Marco Ballesio
c1e763a95b 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-03-16 09:11:36 -07:00
Eric Biggers
fcdaee4861 Merge "init.rc: disable kernel module autoloading" into rvc-dev 2020-03-13 19:10:19 +00:00
Automerger Merge Worker
35cb5cc14a Merge "init.rc: disable kernel module autoloading" am: e7f014da9c am: 0cef47636d
Change-Id: Ia597709b939a6a1699e364c448430b646a1dcd5e
2020-03-12 21:49:39 +00:00
Eric Biggers
b6545b80a0 init.rc: disable kernel module autoloading
There is a longstanding bug where file-based encryption causes spurious
SELinux denials of module_request because it uses the kernel's crypto
API, and the crypto API tries to autoload kernel modules.

While this sometimes indicate missing kconfig options, it can still
happen even if all needed kconfig options are enabled.  This is because
a crypto algorithm can be a composition like "hmac(sha512)", and the
crypto API will first look for the full composition before it
instantiates it using the components like "hmac" and "sha512".  But
often an implementation of the full composition doesn't exist.

However, as far as I can tell, Android doesn't actually use kernel
module autoloading at all.  First, Android never changes
/proc/sys/kernel/modprobe from the default of "/sbin/modprobe", yet this
isn't where modprobe is located on Android.  Android's SELinux policy
contains a neverallow rule that ensures that only init (not even
vendor_init) can write to this setting, so vendors can't be changing it.

Vendors could potentially be setting CONFIG_STATIC_USERMODEHELPER_PATH,
which overrides the path of all usermode helpers including modprobe.
But this is a relatively new kconfig option, available only in
android-4.14 and later.  Also, for a vendor to actually do this they'd
also need to extend the SELinux policy with a domain_auto_trans rule to
allow their usermode helper to be executed by the kernel.

Android does increasingly use kernel modules, and GKI (Generic Kernel
Image) will require them.  However, the modules are actually inserted by
userspace by 'init', not autoloaded.

It's possible to disable kernel module autoloading completely by setting
/proc/sys/kernel/modprobe to an empty string.  So, let's do that.

This prevents lots of spurious SELinux denials, and allows removing
unnecessary rules to allow or dontaudit the module_request permission.

Note: when the kernel doesn't have CONFIG_ANDROID_BINDERFS enabled, this
change exposes a kernel bug that causes a WARNING in get_fs_type().  To
avoid this WARNING, a kernel fix should be applied too -- currently
under discussion upstream
(https://lkml.kernel.org/r/20200310223731.126894-1-ebiggers@kernel.org).

Bug: 130424539
Bug: 132409186
Bug: 144399145
Bug: 146477240
Bug: 148005188
Bug: 149542343

Test: Tested on cuttlefish and coral:

    - Checked that /proc/sys/kernel/modprobe contains /sbin/modprobe
      before this change, and the empty string after.

    - Checked that if all SELinux rules for module_request are removed,
      there are SELinux denials for module_request before this change
      but none after.

    - Ran lsmod both before and after and verified that the list is the
      same, i.e. checked that this change doesn't break how Android
      actually loads kernel modules.

Change-Id: I4132fe1a491e7b789311afcf693c1f6493fb9dc5
Merged-In: I4132fe1a491e7b789311afcf693c1f6493fb9dc5
2020-03-12 14:20:40 -07:00
Eric Biggers
843f46e674 init.rc: disable kernel module autoloading
There is a longstanding bug where file-based encryption causes spurious
SELinux denials of module_request because it uses the kernel's crypto
API, and the crypto API tries to autoload kernel modules.

While this sometimes indicate missing kconfig options, it can still
happen even if all needed kconfig options are enabled.  This is because
a crypto algorithm can be a composition like "hmac(sha512)", and the
crypto API will first look for the full composition before it
instantiates it using the components like "hmac" and "sha512".  But
often an implementation of the full composition doesn't exist.

However, as far as I can tell, Android doesn't actually use kernel
module autoloading at all.  First, Android never changes
/proc/sys/kernel/modprobe from the default of "/sbin/modprobe", yet this
isn't where modprobe is located on Android.  Android's SELinux policy
contains a neverallow rule that ensures that only init (not even
vendor_init) can write to this setting, so vendors can't be changing it.

Vendors could potentially be setting CONFIG_STATIC_USERMODEHELPER_PATH,
which overrides the path of all usermode helpers including modprobe.
But this is a relatively new kconfig option, available only in
android-4.14 and later.  Also, for a vendor to actually do this they'd
also need to extend the SELinux policy with a domain_auto_trans rule to
allow their usermode helper to be executed by the kernel.

Android does increasingly use kernel modules, and GKI (Generic Kernel
Image) will require them.  However, the modules are actually inserted by
userspace by 'init', not autoloaded.

It's possible to disable kernel module autoloading completely by setting
/proc/sys/kernel/modprobe to an empty string.  So, let's do that.

This prevents lots of spurious SELinux denials, and allows removing
unnecessary rules to allow or dontaudit the module_request permission.

Note: when the kernel doesn't have CONFIG_ANDROID_BINDERFS enabled, this
change exposes a kernel bug that causes a WARNING in get_fs_type().  To
avoid this WARNING, a kernel fix should be applied too -- currently
under discussion upstream
(https://lkml.kernel.org/r/20200310223731.126894-1-ebiggers@kernel.org).

Bug: 130424539
Bug: 132409186
Bug: 144399145
Bug: 146477240
Bug: 148005188
Bug: 149542343

Test: Tested on cuttlefish and coral:

    - Checked that /proc/sys/kernel/modprobe contains /sbin/modprobe
      before this change, and the empty string after.

    - Checked that if all SELinux rules for module_request are removed,
      there are SELinux denials for module_request before this change
      but none after.

    - Ran lsmod both before and after and verified that the list is the
      same, i.e. checked that this change doesn't break how Android
      actually loads kernel modules.

Change-Id: I4132fe1a491e7b789311afcf693c1f6493fb9dc5
2020-03-11 10:01:32 -07:00
Automerger Merge Worker
820ac89354 Merge "Add new directory for stats metadata" am: 3a4e3825f4 am: 17dd7ff06c
Change-Id: I6be0083e3d70c6e87d77af85dbfceec5b45be819
2020-03-09 20:19:08 +00:00
Jeffrey Huang
3a4e3825f4 Merge "Add new directory for stats metadata" 2020-03-09 18:09:21 +00:00
Jeffrey Huang
58c88615f2 Add new directory for stats metadata
Also reordered the directories in alphabetical order

Test: m -j
Bug: 149838525
Change-Id: I1a918d189d8bcb394ec6f818d033dbf7e4518713
2020-03-05 08:53:11 -08:00
Jeffrey Huang
8c20f9e6b5 Merge "Update init.rc for statsd setup" 2020-03-05 16:49:39 +00:00
Automerger Merge Worker
70b6a95619 Fix /data_mirror permission
Test: Able to boot without error
Bug: 150671726

Merged-In: If366d284f4f01ebfa660e85bad57861c120ada7e
Change-Id: I9d85c00d191dcaa46c0182b5a15cd89dcdb9ea5e
(cherry picked from commit 1a5ae50943)
2020-03-05 11:41:34 +00:00
Automerger Merge Worker
f13fd3b82d Merge "Fix /data_mirror permission" am: 541d0d28b1 am: b192a8111a
Change-Id: Id61f223d5427101f7084aa5dedbc2c29b1d0443d
2020-03-05 10:29:49 +00:00
Jeffrey Huang
8dccf3ffd1 Update init.rc for statsd setup
Apexes do not support "on" macros, so we are moving
them into the system partition

Bug: 145923087
Test: m -j
Change-Id: Ic671a51f2ec5b91f2f631bae0f509b4aa2d057b4
Merged-In: Ic84e77269f80097b675d6a1b0d206c2bae7d918d
2020-03-04 15:14:37 -08:00
Ricky Wai
1a5ae50943 Fix /data_mirror permission
Test: Able to boot without error
Bug: 150671726
Change-Id: If366d284f4f01ebfa660e85bad57861c120ada7e
2020-03-04 13:30:09 +00:00
Automerger Merge Worker
31a64ed187 Merge "Observe new apexd status value of "activated" as required." am: 2f11663fc9 am: f53cca4d26
Change-Id: I8ea819407b50d3ce632f5b987507a7807de60bd4
2020-03-02 10:47:07 +00:00
Oli Lan
2f11663fc9 Merge "Observe new apexd status value of "activated" as required." 2020-03-02 10:24:21 +00:00
Howard Ro
0aa2faf8b1 Merge "Revert^2 "Update init.rc for statsd setup"" 2020-02-20 08:00:53 +00:00
Automerger Merge Worker
a7634f5fa6 Merge "Adding new GSI public keys" am: c5c3f54806 am: 63f215d4c5 am: 290bb3368a
Change-Id: I9d1e5ba88c5c410f582f48fdc7cc4a4b88a6f4d4
2020-02-20 06:52:31 +00:00
Treehugger Robot
c5c3f54806 Merge "Adding new GSI public keys" 2020-02-20 06:18:41 +00:00
Howard Ro
78900ad658 Revert^2 "Update init.rc for statsd setup"
77a8d9f64e

Change-Id: Ic8dce44e6e83323381a39682b833acf8feb714a2
2020-02-20 04:57:00 +00:00
Howard Ro
77a8d9f64e Revert "Update init.rc for statsd setup"
Revert "Migrate Statsd to the apex"

Revert "Update statsd binary path for apex"

Revert submission 10356003-statsd_apex

Reason for revert: https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=build_test&lkgb=6221366&fkbb=6221428
Reverted Changes:
Ic84e77269:Update init.rc for statsd setup
I6f3fab4b4:Update statsd binary path for apex
Ib4ea98aed:Migrate Statsd to the apex

Change-Id: I0db7f3be927f379b70e0b68bcf1cfdab3f2f1ae0
2020-02-20 04:19:41 +00:00
Jeffrey Huang
8dcbcf13e4 Update init.rc for statsd setup
Apexes do not support "on" macros, so we are moving
them into the system partition

Bug: 145923087
Test: m -j
Change-Id: Ic84e77269f80097b675d6a1b0d206c2bae7d918d
2020-02-19 14:11:16 -08:00
Bowgo Tsai
b697d47eb3 Adding new GSI public keys
Adding two new public keys for R-Developer-GSI and S-Developer-GSI,
respectively.

Bug: 149805495
Test: m r-developer-gsi.avbpubkey
Test: m s-developer-gsi.avbpubkey
Change-Id: Iaa7521ef40b94f13fe3c9c61d276678f47c60b98
2020-02-19 08:50:26 +00:00
Suren Baghdasaryan
cb3003c1bc Merge "Set lowmemorykiller kernel driver parameters before lmkd is started" am: 36ef05cbde am: b3553f8963 am: 355db04b78
Change-Id: I585cac23b8bfe71db2e7a649f4c815a1dd88e091
2020-02-17 10:12:44 +00:00
Treehugger Robot
15c0b798bd Merge "bootstat: enhance last reboot reason property with file backing" am: 7550e6f882 am: ffd276388f am: c0210f1d0e
Change-Id: I6d953d6b9308dc46619e52f81cb5469b22df55d0
2020-02-17 10:12:25 +00:00
Suren Baghdasaryan
36ef05cbde Merge "Set lowmemorykiller kernel driver parameters before lmkd is started" 2020-02-15 01:02:08 +00:00
Mark Salyzyn
ee016ce0b3 bootstat: enhance last reboot reason property with file backing
Helps with support of recovery and rollback boot reason history, by
also using /metadata/bootstat/persist.sys.boot.reason to file the
reboot reason.

Test: manual
Bug: 129007837
Change-Id: Id1d21c404067414847bef14a0c43f70cafe1a3e2
2020-02-14 13:24:16 -08:00
Suren Baghdasaryan
6898682275 Set lowmemorykiller kernel driver parameters before lmkd is started
When kernel lowmemorykiller driver is enabled lmkd detects it by
checking write access to /sys/module/lowmemorykiller/parameters/minfree
parameter. By default this file does not have write access and init
process changes that from "on boot" section of init.rc. However
"on boot" is never executed in the charger mode, therefore lmkd fails
to detect the kernel driver. Fix this by setting lowmemorykiller kernel
driver parameters before lmkd is started.

Bug: 148572711
Test: boot into charger mode with kernel lmk driver enabled
Change-Id: Ifc3ef725b95bdb5f7d801031429dc26bae014d1f
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2020-02-14 01:40:29 +00:00
Zim
e48a55649c Revert "Explicitly disable FUSE"
This reverts commit a3209c5f57.

Should not have been merged into master

Test: m
Bug: 135341433
2020-02-13 19:38:06 +00:00
Automerger Merge Worker
c367388849 Merge changes from topic "snapshotctl_log" am: da8a404473 am: 6d3c0ef08c am: 9345bfb0b2
Change-Id: I0cb4d5a42e43cee95614cc9397faff9b9ad34a84
2020-02-12 18:51:48 +00:00
Yifan Hong
da8a404473 Merge changes from topic "snapshotctl_log"
* changes:
  libsnapshot callstack files readable by dumpstate
  snapshotctl logs readable by dumpstate
  snapshotctl_log dir readable by dumpstate
2020-02-12 18:18:59 +00:00
Zimuzo Ezeozue
6d3fa224af Merge "FUSE flag on by default" 2020-02-12 13:15:48 +00:00
Zimuzo Ezeozue
ec9c803503 Merge "Explicitly disable FUSE" 2020-02-11 21:17:53 +00:00
Yifan Hong
7d28688f96 snapshotctl_log dir readable by dumpstate
Set snapshotctl_log as 0755 so that it is
readable by dumpstate.

Test: bugreport
Bug: 148818798
Change-Id: I6ff52cf0a2e928c74df31aa054ae780f919d6eb0
2020-02-11 10:57:51 -08:00
Zim
a3209c5f57 Explicitly disable FUSE
It is already disabled, but having an explcit value in the prop makes
some code in the system_server, easier.

Will follow up with a cl to explicitly enable it on internal master,
aosp will remain this way since it doesn't have the additional
components to run FUSE.

Test: Freshly wiped and flashed device has persist.sys.fuse set to false
Bug: 135341433
Merged-In: I1493e2806823b5751794a9a17ee248dc72b857ff
Change-Id: Ibb955a543e367aa2f4518d5c1c4d070cd084eca0
2020-02-11 16:56:47 +00:00
Zim
8dacabe6b3 FUSE flag on by default
This will make the FUSE filesystem the default on the build

Test: https://android-build.googleplex.com/builds/forrest/run/L11100000458471772
Bug: 135341433
Change-Id: I1493e2806823b5751794a9a17ee248dc72b857ff
2020-02-11 13:40:34 +00:00
Jerry Chang
9272319714 Merge "Create directory to store pre-reboot information before reboot" 2020-02-11 02:49:29 +00:00
Treehugger Robot
c17c5b00e1 Merge changes I1bf07301,I48e8ebf3
* changes:
  Remove more duplicated symlinks
  Remove duplicated debugfs symlink
2020-02-10 23:10:08 +00:00
Luca Stefani
57909b4c30 Remove more duplicated symlinks
They're all created in rootdir/Android.mk

Test: m
Change-Id: I1bf07301434d8cf4f2e9226071983d7aeaf149ac
2020-02-10 22:23:29 +01:00
Luca Stefani
8c61e7da49 Remove duplicated debugfs symlink
* Currently it's created at build-time in rootdir/Android.mk

Test: m
Change-Id: I48e8ebf3412dfdfc2dff3b4fcf9b72de52726865
2020-02-10 21:56:03 +01:00
Miao Wang
c3991a7150 Add an stune group for NNAPI HAL
- schedtune.prefer_idle 1
 - schedtune.boost 1

Test: mm
Test: configure NNAPI HAL to use nnapi-hal stune
Test: measure perf difference using MLTS benchmark

Change-Id: I5f467c6a58f2c1da40ec8276e101defc808854a3
(cherry picked from commit 1d748feaec)
2020-02-10 11:47:49 -08:00
Nikita Ioffe
15e4f6fe5a Merge "Don't log userspace_reboot.started/finished properties from init" 2020-02-10 17:22:03 +00:00
Nikita Ioffe
c2bc1a3422 Reset dev.bootcomplete property during userspace reboot
Test: adb reboot userspace
Bug: 135984674
Change-Id: I7c6e433c819fc22e88820626768fe8832882386e
2020-02-07 17:42:27 +00:00
Nikita Ioffe
85ff4ab9a4 Don't log userspace_reboot.started/finished properties from init
Instead they will be logged from system_server. This CL just prepares
grounds for logging CL to land.

Test: adb reboot userspace
Bug: 148767783
Change-Id: Ie9482ef735344ecfb0de8a37785d314a3c0417ff
2020-02-07 14:41:39 +00:00
Oli Lan
3cb185e4a1 Observe new apexd status value of "activated" as required.
As of aosp/1224611, there is a new step in the preparation of APEXes
where init calls back into apexd after DE user data is unencrypted to
allow DE apex data to be snapshotted or restored.

aosp/1228581 introduces a new apexd.status value of "activated" that
is set once APEXes are activated but before this snapshot has occurred.

init may execute "perform_apex_config" once this has occurred, so this
CL changes init to wait for "activated" rather than "ready" before
doing this.

Bug: 148672144
Test: build & flash, check boot completes and check in logs that init
waits on the correct status value.

Change-Id: I339580bf593d3b09a5dff749ac2a5d1952bcb210
2020-02-06 11:55:51 +00:00
Jerry Chang
aedac7e625 Create directory to store pre-reboot information before reboot
Bug: 145203410
Test: Built and flashed, checked directory was created
Change-Id: Ic4d43fba62301bde23bec459b5b8b6332be2b6dc
2020-02-06 19:42:42 +08:00
Daniel Rosenberg
02e5e1ea22 Merge "Make /data/media case insensitive" 2020-02-04 23:03:38 +00:00
Yifan Hong
c19b08a66a Merge "Make snapshotctl logging better." 2020-02-04 22:18:33 +00:00
Yifan Hong
12fe03d470 Make snapshotctl logging better.
snapshotctl merge --logcat --log-to-file
- If --logcat, log to logcat
- If --log-to-file, log to /data/misc/snapshotctl_log/
- If both, log to both
- If none, log to stdout

Test: manually test these 4 cases
Bug: 148818798
Change-Id: I44b52936c0d095867acc6ee781c6bec04f6ebd6b
2020-02-04 14:01:24 -08:00
Treehugger Robot
b970633642 Merge "Mount binderfs" 2020-02-04 00:50:10 +00:00
Hridya Valsaraju
b237d76ae5 Mount binderfs
Mount binderfs at /dev/binderfs. Also add symlinks from /dev/binder,
/dev/hwbinder and /dev/vndbinder to /dev/binderfs/binder,
/dev/binderfs/hwbinder and /dev/binderfs/vndbinder respectively.

The symlink commands will fail harmlessly on a kernel
which does not support binderfs since /dev/{binder,hwbinder,vndbinder}
devices will exist on the same.

Bug: 136497735
Bug: 148696163

Test: Cuttlefish boots on Android Common Kernel 4.19 with kernel config
CONFIG_ANDROID_BINDERFS=y.

Change-Id: I8e04340dc4622b0a3c1fc4aa6bbefcb24eefe00b
2020-02-03 22:14:21 +00:00
Treehugger Robot
823beae16a Merge "Revert "Mount binderfs"" 2020-02-03 18:37:40 +00:00
Oli Lan
0460f65f78 Merge "Allow apexd to snapshot and restore DE data." 2020-02-03 17:50:51 +00:00
Oli Lan
a466ca8ff4 Allow apexd to snapshot and restore DE data.
This calls into apexd to allow it to snapshot and restore DE apex data
in the case of a rollback. See the corresponding apexd change for more
information.

Cherry-pick from (unsubmitted) internal CL: ag/10163227

Bug: 141148175
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_DeSys
Change-Id: Ia4bacc9b7b7a77038ba897acbc7db29e177a6433
2020-02-03 11:47:15 +00:00
Zimuzo Ezeozue
294c16024b Merge "Harden /mnt/pass_through paths" 2020-02-03 11:34:52 +00:00
Nikita Ioffe
03aaecbd99 Merge "Don't reset sys.usb.configfs during userspace reboot" 2020-02-03 08:12:38 +00:00
Daniel Rosenberg
ebfe359ca8 Make /data/media case insensitive
Use chattr to apply +F to /data/media
This will fail on devices who do not support casefolding on userdata.

Bug: 138322712
Test: /data/media is set to +F.
Change-Id: Ib341c23a0992ee97b23113b3a72f33a61e583b04
2020-01-31 18:34:03 -08:00
Maciej Żenczykowski
8fda5feb25 Merge "symlink /dev/net/tun -> ../tun" 2020-02-01 01:24:57 +00:00
Greg Kaiser
49a542a979 Revert "Mount binderfs"
This reverts commit 8e50be74ae.

Reason for revert: Several devices did not boot
Test: Local build with this reverted had the device boot
Bug: 148689473
Merged-In: I97e96bd86d02a9fe70c5ef02df85c604b0cfb3c3

Change-Id: Ic4a2990e7c0cb08c374a336422c08d9aad28049d
2020-01-31 23:37:21 +00:00
Treehugger Robot
938379de5b Merge "Mount binderfs" 2020-01-31 18:46:14 +00:00
Zim
a67b40bc2a Harden /mnt/pass_through paths
Only the FUSE daemon (with media_rw gid) needs access to paths on
/mnt/pass_through. And even then, it only needs execute access on the
dirs, since there will always be a bind mount either from sdcardfs or
the lower filesystem on it and that bind mount correctly handles ACLs
for the FUSE daemon.

Test: manual
Bug: 135341433
Change-Id: I999451e095da355e6247e9e18fb6fe1ab8fc45d6
2020-01-31 16:26:13 +00:00
Nikita Ioffe
4f8e05663e Don't reset sys.usb.configfs during userspace reboot
Test: adb reboot userspace (on blueline)
Test: adb reboot userspace (on cuttlefish)
Bug: 147726967
Change-Id: Id4a367e74b418a85e8454e952e12e0723efc9b8a
2020-01-31 15:59:19 +00:00
Maciej Żenczykowski
00a21e3d54 symlink /dev/net/tun -> ../tun
This is the expected location on Linux and this makes 'ip tuntap' work.

Before:
  vsoc_x86_64:/ # ip tuntap add dev tun0 mode tun
  open: No such file or directory
  vsoc_x86_64:/ # ip tuntap add dev tap0 mode tap
  open: No such file or directory
  vsoc_x86_64:/ # ip tuntap list

After:
  vsoc_x86_64:/ # ip tuntap add dev tun0 mode tun
  vsoc_x86_64:/ # ip tuntap add dev tap0 mode tap
  vsoc_x86_64:/ # ip tuntap list
  tap0: tap UNKNOWN_FLAGS:800
  tun0: tun UNKNOWN_FLAGS:800

  $ adbz shell ls -ldZ / /dev /dev/tun /dev/net /dev/net/tun
  drwxr-xr-x 25 root   root u:object_r:rootfs:s0         4096 2020-01-25 09:48 /
  drwxr-xr-x 21 root   root u:object_r:device:s0         1240 2020-01-25 09:48 /dev
  drwxr-xr-x  2 root   root u:object_r:device:s0           60 2020-01-25 09:48 /dev/net
  lrwxrwxrwx  1 root   root u:object_r:device:s0            6 2020-01-25 09:48 /dev/net/tun -> ../tun
  crw-rw----  1 system vpn  u:object_r:tun_device:s0  10, 200 2020-01-25 09:48 /dev/tun

Test: see above
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2aa215711454ce4f8a0ef1f34c17621629060fa1
2020-01-30 03:51:33 +00:00
Hridya Valsaraju
8e50be74ae Mount binderfs
Mount binderfs at /dev/binderfs. Also add symlinks from /dev/binder,
/dev/hwbinder and /dev/vndbinder to /dev/binderfs/binder,
/dev/binderfs/hwbinder and /dev/binderfs/vndbinder respectively.

Bug: 136497735
Test: Cuttlefish boots on Android Common Kernel 4.19 with kernel config
CONFIG_ANDROID_BINDERFS=y.

Change-Id: I349face22a2e73bfd79af0188e41188c323388f7
2020-01-29 17:59:17 -08:00
Alistair Delva
1fad2b39a3 Merge "Correct /sys/kernel/tracing permissions" 2020-01-30 00:08:02 +00:00
Alistair Delva
ebb5b3bd48 Correct /sys/kernel/tracing permissions
In Android kernels >4.4 we will see an empty /sys/kernel/tracing
directory which is notionally where you should mount tracefs if you
don't want to mount debugfs. As we move towards not mounting debugfs,
ensure that the non-legacy location also has adequate permissions to be
read by tracing tools.

Note that this change will be OK even if the board init.rc doesn't mount
tracefs here, because sysfs will always create this directory.

Bug: 148436518
Change-Id: I674587d0f08effdb8471a82e3b1ceec3af8588de
2020-01-29 09:10:50 -08:00
Nikita Ioffe
2d88794a7d Merge "Trigger boot animation on userspace reboot" 2020-01-29 11:24:01 +00:00
Nikita Ioffe
764c1ac8ba Trigger boot animation on userspace reboot
Also reset some more properties to make bootanimation work properly.

Test: adb reboot userspace
Bug: 148172262
Change-Id: I0154d4fe9377c019150f5b1a709c406925db584d
2020-01-28 10:42:44 +00:00
Zim
c1b53de450 Change gid bit of /mnt/media_rw to external_storage
To allow apps with MANAGE_EXTERNAL_STORAGE permission and therefore
external_storage gid to access unreliable volumes directly on
/mnt/media_rw/<volume>, they need access to the /mnt/media_rw path.

This change doesn't break the FUSE daemon, the only process that should
have media_rw gid in R because the FUSE daemon accesses the lower
filesystem from the pass_through bind mounts of the public volume mount
itself so it doesn't need to walk the /mnt/media_rw path itself

Test: With FUSE enabled, a reliably mounted public volume is accessible
on /storage
Bug: 144914977

Change-Id: Ia3fc9e7483894402c14fb520024e2acca821a24d
2020-01-24 22:13:58 +00:00
Oliver Nguyen
38b33c09f9 Merge "Set Clang coverage environment variables." 2020-01-22 22:34:35 +00:00
Treehugger Robot
eba798a767 Merge "Harden /mnt/pass_through permission bits" 2020-01-22 21:30:53 +00:00
Zim
6ca090e6b0 Harden /mnt/pass_through permission bits
It previously had 0755 permission bits

With such permissive bits, an unauthorized app can access a file using
the /mnt/pass_through path for instance even if access via /storage
would have been restricted.

It is now 0700

TODO: Change ACL for /mnt/user from 0755 to 0700 in vold only when
FUSE flag is on. Changing it with FUSE off breaks accessing /sdcard
because /sdcard is eventually a symlink to /mnt/user/0/primary

Test: adb shell ls -d /mnt/pass_through
Bug: 135341433
Change-Id: I3ea9655c6b8c6b4f847b34a2d3b96784a8f4a160
2020-01-22 17:54:45 +00:00
Ryan Savitski
cdebef1d2b Merge "init: add builtin check for perf_event LSM hooks" 2020-01-21 20:40:50 +00:00
Oli Lan
90c523b30b Give x permission on apex data directories.
This gives search (x) permission on the parent apex data
directory /data/misc/apexdata so that directories below it
may be opened. It also gives that permission on the apex
data directories themselves.

Bug: 147848983
Test: Build & flash, check perms are correct
Change-Id: I27c4ea01602002c89d0771a144265e3879d9041a
2020-01-17 11:41:04 +00:00
David Zeuthen
e83f386653 Add user for credstore.
The credstore system daemon is running as an unprivileged user. This
CL adds this user and also creates a directory (/data/misc/credstore/)
where this daemon can store its data.

Bug: 111446262
Test: N/A
Change-Id: I8da2c32dd04fef797870b8a7bbc5e499bed71f9e
2020-01-16 07:32:04 -05:00
Ryan Savitski
f0f7e70186 init: add builtin check for perf_event LSM hooks
Historically, the syscall was controlled by a system-wide
perf_event_paranoid sysctl, which is not flexible enough to allow only
specific processes to use the syscall. However, SELinux support for the
syscall has been upstreamed recently[1] (and is being backported to
Android R release common kernels).
[1] da97e18458

As the presence of these hooks is not guaranteed on all Android R
platforms (since we support upgrades while keeping an older kernel), we
need to test for the feature dynamically. The LSM hooks themselves have
no way of being detected directly, so we instead test for their effects,
so we perform several syscalls, and look for a specific success/failure
combination, corresponding to the platform's SELinux policy.

If hooks are detected, perf_event_paranoid is set to -1 (unrestricted),
as the SELinux policy is then sufficient to control access.

This is done within init for several reasons:
* CAP_SYS_ADMIN side-steps perf_event_paranoid, so the tests can be done
  if non-root users aren't allowed to use the syscall (the default).
* init is already the setter of the paranoid value (see init.rc), which
  is also a privileged operation.
* the test itself is simple (couple of syscalls), so having a dedicated
  test binary/domain felt excessive.

I decided to go through a new sysprop (set by a builtin test in
second-stage init), and keeping the actuation in init.rc. We can change
it to an immediate write to the paranoid value if a use-case comes up
that requires the decision to be made earlier in the init sequence.

Bug: 137092007
Change-Id: Ib13a31fee896f17a28910d993df57168a83a4b3d
2020-01-15 20:58:15 +00:00
Treehugger Robot
ec7be0dc0f Merge "Create /mnt/data_mirror/cur_profiles in init.rc" 2020-01-15 19:47:52 +00:00
Treehugger Robot
e4505960b9 Merge "Disable dm-verity hash prefetching." 2020-01-15 13:13:01 +00:00
Treehugger Robot
f7593a9a2a Merge "[incrementa;] set mode and encryption for /data/incremental" 2020-01-15 02:58:02 +00:00
Songchun Fan
73d9e7d666 [incrementa;] set mode and encryption for /data/incremental
To be consistent with /data/app.

Test: boots
BUG: 137855266
Change-Id: I8aa549155367edfad158924bcf7892ac7bb76f16
2020-01-13 15:04:41 -08:00
Oliver Nguyen
c1f7035c31 Set Clang coverage environment variables.
Bug: 143977934
Test: m CLANG_COVERAGE=true and check LLVM_PROFILE_FILE is set
Change-Id: I5aea5a38b9bec1670bf9c8d11d9c466c3b83e4d8
2020-01-13 14:38:15 -08:00
Martijn Coenen
9226bb304a Disable dm-verity hash prefetching.
Prefetching appears to have a slightly negative effect on boot time, and
actually makes boot time much worse when the available dm-bufio cache
shrinks. Since we anticipate the dm-bufio cache will shrink (because of
an increasing number of APEX dm-verity targets), disable prefetching
completely.

We've run this change on Pixel 2 since August, and haven't observed any
negative effects. Boot time slightly decreased. With the increased
amount of APEXes we already have, this should now result in an even more
significant boot time decrease.

Bug: 136247322
Test: atest google/perf/boottime/boottime-test
Change-Id: Id588669af1b0b9daaf15323dccf33411e03b8633
2020-01-06 09:41:49 +01:00
Kiyoung Kim
24ccfc244b Merge "Update linkerconfig to target out directory" 2020-01-02 04:18:31 +00:00
Nikita Ioffe
1131a211dc Reset sys.shutdown.requested property
Otherwise, if userspace reboot is triggered from the framework, it will
end up in userspace reboot loop until watchdog kicks in triggers full
reboot.

Bug: 135984674
Test: adb shell svc power reboot userspace
Change-Id: I0de451aad4ea236a3ff1c20b317b01c6529b6231
2019-12-30 16:06:35 +00:00
Kiyoung Kim
3b2dbe9d75 Update linkerconfig to target out directory
Current linkerconfig targets for specific output file. However,
linkerconfig will generate more than 1 file based on APEX modules, so it
should take argument for target directory rather than target file. This
change updates linkerconfig's argument to point output directory.

Bug: 146993126
Test: m -j passed & Cuttlefish succeeded to boot
Change-Id: I3a720a047077688582436aabd307adafeafc5398
2019-12-30 18:44:41 +09:00
Kiyoung Kim
3c0e06d829 Merge "Use generated linker config only" 2019-12-27 00:08:06 +00:00
Kiyoung Kim
32082a7e28 Use generated linker config only
Remove prebuilt ld.config.txt to use linker config from generator only,
including legacy and vndk_lite case.

Bug: 139638519
Test: m -j passed

Change-Id: I043d51daca8cde1977236f9fbda919176a18618d
2019-12-24 14:18:53 +09:00
Nikita Ioffe
018ddd7a6f Unify logic for resetting properties before userspace reboot
Since I was there, added two more properties to reset, and switched
ordering of sys.init.updatable_crashing and
sys.init.updatable_crashing_process_name setprops to make sure that
process name is already set when apexd/PackageWatchdog get's notified
about sys.init.updatable_crashing.

Also fixed a typo in what HandleUserspaceReboot function.

Test: adb reboot userspace
Bug: 135984674
Change-Id: I954ec49aae0734cda1bd833ad68f386ecd808f73
2019-12-20 17:55:13 +00:00
Kiyoung Kim
5bc7941be3 Merge "Remove ld.config.recovery.txt build" 2019-12-20 07:10:29 +00:00
Kiyoung Kim
80416f7a80 Merge "Generate linkerconfig per mount namespaces" 2019-12-20 03:30:33 +00:00
Kiyoung Kim
e4d3f2123f Generate linkerconfig per mount namespaces
There are two namespaces from init - bootstrap and default - and those
will have different set of APEX modules. To support difference between
two namespaces, linker config should be generated per namespace and each
namespace should use its own linker configuration. As a first step of
the work, this change will create different mount point for each
namespace, and re-generate linker config after APEX mount from each
namespaces.

Bug: 144664390
Test: m -j passed & tested from cuttlefish
Change-Id: Iac2e222376ec4b0ced6c29eed18b21d39ff0b1ba
2019-12-20 09:46:59 +09:00
Songchun Fan
a1344fa6d7 Merge "[incremental] create /data/incremental in init.rc" 2019-12-19 18:14:06 +00:00
Kiyoung Kim
986e453d9c Remove ld.config.recovery.txt build
Remove ld.config.recovery.txt build as this will be replaced to be
generated from linkerconfig during build time.

Bug: 146414198
Test: m -j passed
Test: Checked linker config generated under recovery's system/etc
Change-Id: I0d2aa121973c4c99e68f44f4e76e4eab74dc2f95
2019-12-19 16:37:43 +09:00
Songchun Fan
284962431b [incremental] create /data/incremental in init.rc
We use /data/incremental to keep all the directories that are mounted on
the Incremental File System.

Since system_server does not have permission to dynamically create dirs
directly under /data, we create /data/incremental in init.rc.

Test: boots
BUG: 136132412
Change-Id: Ic90cc8f652672a8d4459c0cd38db9c0872217af4
2019-12-18 09:26:51 -08:00
Martijn Coenen
0dbb2a75f2 Revert "Have /storage always point to sdcardfs by default."
This reverts commit 5d53bfce2d.

Reason for revert: for consistency, we've decided that for now, all code will have the same view of /storage: FUSE. Will address the TODO here later.

Change-Id: Ia75e23c91fb098f6309c160de2889f06507c3717
2019-12-17 13:45:10 +00:00
Ricky Wai
fdc0986554 Create /mnt/data_mirror/cur_profiles in init.rc
Also, bind mount /data/misc/profiles/cur to /mnt/data_mirror/cur_profiles

Bug: 143937733
Test: Directories are created and mounted
Change-Id: Idcf73b84db84dc671ec5a5025f4b4ec1bc5fd1fc
2019-12-13 17:32:18 +00:00
Martijn Coenen
5d53bfce2d Have /storage always point to sdcardfs by default.
This is a partial revert of change
Idf851b3a42910e0ce8fdd75daea1cce91dd1aa98, and brings us back to the
state we shipped in Q.

The default behavior for now is that we want native daemons to use the
default sdcardfs view, as they did before. Zygote-spawned apps will then
get the correct view assigned to them as they get spawned.

Bug: 146189163
Test: atest AdoptableHostTest
Change-Id: I2248f39e029138962a41a6ead944431414c901ad
2019-12-13 16:52:11 +01:00
rickywai
3014815103 Merge "Create /data_mirror in init.rc" 2019-12-13 14:22:37 +00:00
Treehugger Robot
8afa4a0637 Merge "Adding the AVB public key for Q-Developer-GSI" 2019-12-13 03:13:02 +00:00
Ricky Wai
3cca270e95 Create /data_mirror in init.rc
Mount a tmpfs on top of it, and serve as a mirror of /data/data
and /data/user_de, which will be used when zygote forks and
overlay its CE and DE storage to prevent app can see other applications.

Also, changed /data/user/0 from symlink to bind mount, so
/data_mirror/data_ce/null can just bind to /data/user directly.

Bug: 143937733
Test: Directories are created and mounted
Change-Id: Ic72c47c9d3dc0ffc98510f5bb351eccf76524232
2019-12-12 14:44:44 +00:00
Nikita Ioffe
5183983af2 Merge "Move setprop sys.usb.configfs 0 to on init action" 2019-12-12 02:41:16 +00:00
Kiyoung Kim
597eca8a8c Merge "Move linker config under /linkerconfig" 2019-12-11 02:55:06 +00:00
Nikita Ioffe
c796f918db Move setprop sys.usb.configfs 0 to on init action
This should solve the problem of
`property:sys.usb.config=adb && property:sys.usb.configfs=0` action
being wrongly triggered during userspace reboot.

Also reset some adbd-related property in `on userspace-reboot-requested`
action to make sure that userspace reboot sequence is as close as
possible to normal boot sequence w.r.t adbd.

Test: adb reboot userspace
Test: checked property:sys.usb.config=adb && property:sys.usb.configfs=0
  action is not triggered

Bug: 135984674
Change-Id: Icf40386399ee84d01228020e65f71ba473d72822
2019-12-10 19:16:15 +00:00
Elliott Hughes
3498578c4c Merge "Be more careful about symlinking a file that actually exists on the host." 2019-12-10 17:59:15 +00:00
Bowgo Tsai
bd0853602b Adding the AVB public key for Q-Developer-GSI
Bug: 144399552
Test: m q-developer-gsi.avbpubkey
Change-Id: If140c429c8b8324c0c2364aa67e72e41748b42b4
2019-12-10 13:02:31 +08:00
Oli Lan
4370ff58ae Create directory for snapshots of DE_sys apex data.
This creates the /data/misc/apexrollback directory which will
hold snapshots of DE_sys apex data directories (i.e. it will
hold backups of data from /data/misc/apexdata for particular
apexes).

See go/apex-data-directories for details.

Bug: 141148175
Test: Built and flashed, checked directory was created.
Change-Id: If45377a9b29cc1f52dd08ea1339829e3bb3032e9
2019-12-09 11:12:53 +00:00
Oli Lan
13e51e7f0b Create DE_sys APEX data directories.
This creates the directory /data/misc/apexdata, at the same time as other
directories under /data/misc. Then, when apexd has finished activating
APEXes, a directory is created under /data/misc/apexdata for every
APEX, with the same name as the APEX module name.

See go/apex-data-directories.

APEXes are discovered by scanning the /apex directory. It may be better
to delegate this process to a library, but it is proposed to defer that
change to a future CL.

Bug: 141148175
Test: Built and flashed, checked directories were created.
Change-Id: I639d6f490ae0b97f116ce38ff3ac348bd73aa20e
2019-12-09 11:10:42 +00:00
Kiyoung Kim
99df54be93 Move linker config under /linkerconfig
Currently linker config locates under /dev, but this makes some problem
in case of using two system partitions with chroot. To match system
image and configuration, linker config better stays under /linkerconfig

Bug: 144966380
Test: m -j passed && tested from cuttelfish
Change-Id: Iaae5af65721eee8106311c1efb4760a9db13564a
2019-12-09 19:45:11 +09:00
Elliott Hughes
3af236c693 Be more careful about symlinking a file that actually exists on the host.
Avoids this error on later runs:

  ln: cannot create symbolic link from '/sys/kernel/debug' to 'out/target/product/walleye/root/d/debug': Permission denied

Bug: http://b/145148158
Test: touch * ; mm -j32 -k
Change-Id: I0c1c0c6e7666c0bc3373687d8c1c7bdf0847913f
2019-12-06 17:43:23 -08:00
Jaegeuk Kim
7bf14bb932 Merge "rootdir: init.rc to limit discard size to 128MB" 2019-12-06 21:59:19 +00:00
Jaegeuk Kim
fe9e8a3fa5 rootdir: init.rc to limit discard size to 128MB
In any case, UFS storage suffers from long discard latency.

Change-Id: Iaa8ef6eb862934af43254bd10873a12c3d34e926
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2019-12-05 15:58:18 -08:00
Anton Hansson
3c5cc31824 Run the derive_sdk service
Run this process as early as possible in the boot -- right
after its config has been parsed from the apex. This ensures
the sdk prop is set as early as it can be, should some other
early process need to look at it.

Note: this is unlikely to be the permanent way this gets run,
as it's only needed when apexes update.

Bug: 137191822
Test: boot && adb shell getprop | grep sdk_info
Change-Id: Ia48ef89435ca165333b52d653e3131f71a522747
2019-12-05 15:38:37 +00:00
Martijn Coenen
58bd37f1e3 Merge "Remove bootstrapping the passthrough mount." 2019-11-29 08:41:37 +00:00
Shuo Qian
8834223ff8 Merge "A system folder for emergency number database OTA" 2019-11-27 19:14:50 +00:00
Shuo Qian
f0e65d852a A system folder for emergency number database OTA
Test: Manual; tested with the other CL in the same topic
Bug: 136027884
Change-Id: Ia5675613b9ae19927108d089955d2900d97c892c
2019-11-27 19:04:39 +00:00
Martijn Coenen
cc67ff5add Remove bootstrapping the passthrough mount.
This will be taken care of by vold (when necessary).

Bug: 135341433
Test: device boots, passthrough mount still works
      atest AdoptableHostTest
Change-Id: I5a144eff0e4220fa0154bfa7d62a2dec625c88bc
2019-11-22 13:13:50 +01:00
Nikita Ioffe
c5282e4c6b Merge "Add sysprops for start & end of userspace reboot" 2019-11-14 21:50:59 +00:00
Nikita Ioffe
c0df1874ad Add sysprops for start & end of userspace reboot
There will be useful in debugging/logging events to statsd.

Also as part of this CL, sys.init.userspace_reboot.in_progress property
is now used as a mean of synchronization. It is set directly in
DoUserspaceReboot, to make sure that all the setprop actions triggered
by userspace-reboot-requested were processed.

Test: adb reboot userspace
Test: adb shell getprop sys.init.userspace_reboot.last_started
Test: adb shell getprop sys.init.userspace_reboot.last_finished
Bug: 135984674
Change-Id: I9debcd4f058e790855200d5295344dafb30e496a
2019-11-14 01:38:05 +00:00
Marco Ballesio
726a68cb40 Add support for freezer cgroup
Adds the freezer cgroup to process groups

Change-Id: Ib7a8dbe776ff156ff3827b9a659365384f3e6ac8
Bug: 143308662
Test: manual - frozen processes aren't scheduled for execution until
unfrozen
2019-11-13 20:21:07 +00:00
Tom Cherry
47cdf6c078 Merge "Move init and ueventd scripts from / to /system/etc" 2019-11-13 14:36:47 +00:00
Tom Cherry
c9f5353ad3 Move init and ueventd scripts from / to /system/etc
There is no reason for these scripts to continue to exist in /, when
they are better suited for /system/etc.  There are problems keeping
them at / as well, particularly that they cannot be updated with
overlayfs.

Bug: 131087886
Bug: 140313207
Test: build/boot
Merged-In: I043d9a02ba588ca37ceba2c4e28ed631792b2586
Change-Id: I043d9a02ba588ca37ceba2c4e28ed631792b2586
2019-11-08 10:15:49 -08:00
Suren Baghdasaryan
8106c8e09f Merge changes from topic "native process registration"
* changes:
  init: Add support for native service registration with lmkd
  lmkd: Support process types when registering a process
  lmkd: Add library function to unregister a process
  lmkd: Prepare lmkd to support connection from init process
  lmkd: Restrict process record modifications to the client that created it
2019-11-08 17:25:10 +00:00
Treehugger Robot
7e5fb6b322 Merge "migrate *.libraries.txt from Make to Soong" 2019-11-08 04:04:14 +00:00
Paul Crowley
449282c021 Merge "Make encryption action an argument to mkdir" 2019-11-07 20:06:47 +00:00
Suren Baghdasaryan
c29c2baa69 init: Add support for native service registration with lmkd
init should be able to register native services with lmkd so that they
can be killed when needed. Only processes with oom_score_adjust not
equal to the default -1000 will be registered with lmkd because with the
score that low the process is unkillable anyway.
Inform lmkd when a registered process is killed so that the record can be
removed.
Change init.rc to start lmkd during init phase so that it is there to
register other services.
Replace hardcoded oom_score_adj values with appropriate definitions.

Bug: 129011369
Test: boot and verify native service registration
Change-Id: Ie5ed62203395120d86dc1c8250fae01aa0b3c511
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-11-07 18:19:31 +00:00
Nikita Ioffe
42697d3f18 Make remount into checkpointing for ext4 userdata a no-op
We are going to teamfood userspace reboot soon, and in order to gather
as much data as possible we are fine with ignoring checkpointing for the
devices with ext4 (teamfood will be a very limited set of people that
are aware what they've signed for).

As result of this, we don't need to reset vold and kill zram backing
device. Added a TODO to restore that functionality if needed.

Since I was there, fixed yet another typo in userspace-reboot-resume -_-

Bug: 135984674
Test: adb reboot userspace
Change-Id: I2b7a93aaf738fe9bec9d606d7e11aefb325550b1
2019-11-06 20:12:08 +00:00
Jooyung Han
c2b56dc10e migrate *.libraries.txt from Make to Soong
Migrating these files to soong modules and those modules are defined
under /packages/modules/vndk since they are highly coupled with vndk.

Bug: 141450808
Test: m llndk.libraries.txt
Change-Id: Id33366f604e3e6696a9be95dc50f40d143325697
2019-11-06 16:55:32 +09:00
Paul Crowley
68258e8444 Make encryption action an argument to mkdir
FscryptSetDirectoryPolicy no longer tries to infer the action from the
filename. Well mostly; it still assumes top-level directories in /data
should be encrypted unless the mkdir arguments say otherwise, but
it warns.

Bug: 26641735
Test: boot, check log messages
Change-Id: Id6d2cea7fb856f17323897d85cf6190c981b443c
2019-11-05 16:26:43 -08:00
Josh Gao
594f70ffb8 Move adbd to an apex.
Test: adb shell "su 0 readlink /proc/\`pidof adbd\`/exe"
Change-Id: I84dfe4d1b28b619f98c03a2c8eeef2c783d30af2
2019-11-04 15:52:16 -08:00
Nikita Ioffe
ac692148e5 Fix typo in userspace-reboot-requested trigger
It should userspace-reboot-requested, not userspace-reboot

Test: adb reboot userspace
Bug: 135984674
Change-Id: I1e844b7705eb70ee3702a1dc0432644592666364
2019-11-01 20:56:33 +00:00
Jooyung Han
a18363cb97 Use soong-generated vndk*libraries.txt files
linkerconfig reads vndk-related libraries.txt files. Now these files are
generated by soong.

Bug: 142963962
Bug: 141450808
Test: m && device boots && TH
Change-Id: I98c2f934815238cacd4ec8536ce2f9f24bbf1b32
2019-10-31 11:40:22 +09:00
Treehugger Robot
f77c98a780 Merge "Revert "Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list""""" 2019-10-30 04:29:37 +00:00
Jooyung Han
e5811e8967 Revert "Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list""""
This reverts commit 3cb19a74f2.

Reason for revert: Fix b/143374795

Change-Id: I21dae5ff3c9bf05ac15ac26210d7c8d7f9c46e1c
2019-10-28 21:08:04 +00:00
Greg Kaiser
b6a3d3f9d3 Merge "Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list"""" 2019-10-28 17:12:33 +00:00
Nikita Ioffe
8a603a7f9b Merge "Userspace reboot: Support remounting userdata for f2fs" 2019-10-28 16:28:23 +00:00
Jooyung Han
3cb19a74f2 Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list"""
This reverts commit 74f23d7ae6.

Reason for revert: b/143374795

Change-Id: I35cb387b87d3eb2eb0963b669e359ff538c28c90
2019-10-28 05:07:46 +00:00
Xin Li
128bbfc7be Merge Coral/Flame into AOSP master
Bug: 141248619
Change-Id: I32e18ca4131b81846dca976699df8be71549e4e1
Merged-In: I6b95cf1a731c4dc09a7897f3114e2ad6595d60bb
2019-10-25 10:28:40 -07:00
Nikita Ioffe
12a36076a7 Userspace reboot: Support remounting userdata for f2fs
Test: adb reboot userspace
Test: adb shell /system/bin/vdc startCheckpoint 1;
      adb reboot userspace
Bug: 135984674
Change-Id: I227f2c1cc18495d893decb2df5173fc7a7919df6
2019-10-25 16:27:10 +01:00
Jooyung Han
74f23d7ae6 Revert "Revert "Use com.android.vndk.current variant for vndk list""
This reverts commit 08f2376d70.

Bug: 141451661
Test: m && device boot
2019-10-19 02:32:28 +09:00
Jooyung Han
5d1428b437 Merge "Revert "Use com.android.vndk.current variant for vndk list""
am: 047a7d21d9

Change-Id: Ia4d7f11d7a76c34f42cb9e7bc940f0d9a87156f9
2019-10-17 05:08:27 -07:00
Treehugger Robot
047a7d21d9 Merge "Revert "Use com.android.vndk.current variant for vndk list"" 2019-10-17 11:50:47 +00:00
Jooyung Han
08f2376d70 Revert "Use com.android.vndk.current variant for vndk list"
This reverts commit 82f94d61cb.

Reason for revert: some targets are broken

Bug: 142773030
Change-Id: Ida59c52af3d2fd694855fcee60b5bb0d99c85f8d
2019-10-16 23:47:32 +00:00
Jiyong Park
07348eb619 Merge "Don't preload libneuralnetworks.so"
am: af15eff03b

Change-Id: Idade938fe6fb696b5a59c28ea25e630043dcac9f
2019-10-15 05:49:18 -07:00
Treehugger Robot
af15eff03b Merge "Don't preload libneuralnetworks.so" 2019-10-15 12:35:47 +00:00
Jooyung Han
abe56ba48d Merge "Use com.android.vndk.current variant for vndk list"
am: 9e52397825

Change-Id: I48b450dd17f9454cf12a68c0c217ee13daaed3ca
2019-10-15 02:44:11 -07:00
Jooyung Han
9e52397825 Merge "Use com.android.vndk.current variant for vndk list" 2019-10-15 09:21:19 +00:00
Jooyung Han
82f94d61cb Use com.android.vndk.current variant for vndk list
New linkerconfig reads some txt files which list various kinds of
vndk libraries. For example, vndksp.libraries.txt file has the list of
VNDKSP type libraries. The exact file names are retrieved from .vendor
variants.

With VNDK APEX, .vendor variants are not installed but
.com.android.vndk.current variants are packaged into VNDK APEX.

This CL changes the variant type from .vendor to
.com.android.vndk.current so that *.libraries.txt files can list the
installed files correctly.

Bug: 141451661
Test: m && device boot
Change-Id: Ibbc27b1ae6a44cc2337a0b14918caa27107a4c8e
2019-10-13 22:03:50 +09:00
Nikita Ioffe
0ee759cc4c Merge "userspace reboot: stop post-data services and wait for them to be killed"
am: 4592237300

Change-Id: I0f9e4a03f883c8cf301f3f918c921e91c9612f03
2019-10-11 03:39:10 -07:00
Jiyong Park
98b1c69253 Don't preload libneuralnetworks.so
The lib isn't used by most of the apps. Don't waste memory by preloading
it to all apps.

Bug: 142482121
Test: `lsof -p $(pidof zygote64) | grep libneuralnetwork` shows nothing
Change-Id: I4a6e3df838fa3b7a46271e548e9fdc87bea948ae
2019-10-11 10:31:12 +09:00
Nikita Ioffe
3f4b0d6113 userspace reboot: stop post-data services and wait for them to be killed
* Refactored code around stopping services a little bit to reuse it
  between full reboot and userspace reboot.
* Add a scope_guard to fallback to full reboot in case userspace reboot
  fails.
* In case of userspace reboot init will also wait for services to be
  terminated/killed and log the ones that didn't react to
  SIGTERM/SIGKILL in time.
* If some of the services didn't react to SIGKILL, fail userspace reboot.

Test: adb reboot userspace
Bug: 135984674
Change-Id: I820c7bc406169333b0f929f0eea028d8384eb2ac
2019-10-10 18:13:42 +01:00
Daichi Hirono
446e8a8133 Merge "Add a link from runtime ns to the neuralnetworks ns"
am: b18dc5d287

Change-Id: If606607fd6bae18483212b35da0ec989b0e9b8c2
2019-10-09 08:26:48 -07:00
Daichi Hirono
e76c0d2816 Add a link from runtime ns to the neuralnetworks ns
libneuralnetworks.so could be preloaded. In that case, it should be
accessible from libnativeloader which runs in the art namespace.

Bug: 141847343
Bug: 142089311
Test: m, cheets2 boots
Change-Id: I8710b624dff131f5cb797d53915f6597e3017c34
2019-10-09 07:43:52 +00:00
Nikita Ioffe
5e0e30db92 Merge "Add a skeleton of userspace reboot"
am: f1933c910d

Change-Id: I099d8bf703e13dacdb9717be77a3222541f02432
2019-10-08 07:51:16 -07:00
Nikita Ioffe
f1933c910d Merge "Add a skeleton of userspace reboot" 2019-10-08 14:42:36 +00:00
Nikita Ioffe
ba6968e636 Add a skeleton of userspace reboot
This CL only draws boundaries between userspace and full reboots, and
adds some functionality that will be required for userspace reboot:

* Whenever device is shutting down is now controlled in reboot.cpp,
  since during userspace reboot this state can change.
* Now it's also possible to restart handling of control messages inside
  property service. In case of userspace reboot, init will restart it
  after stopping post-data services.
* New userspace-reboot-requested trigger is added similar to shutdown
  one for full reboot.

Test: adb reboot
Test: adb reboot userspace
Bug: 135984674
Change-Id: Id55a53ba781d2b90ce40449037b6d8d47e72c476
2019-10-08 12:16:06 +01:00
Martin Stjernholm
87041ac24a Merge "Ensure all namespaces have links to /system/lib(64) for the sanitizer libs."
am: c14b27f22d

Change-Id: I59176f2691bd4185b72390883d87afebc10aa344
2019-10-08 04:13:46 -07:00
Martin Stjernholm
c14b27f22d Merge "Ensure all namespaces have links to /system/lib(64) for the sanitizer libs." 2019-10-08 11:06:05 +00:00
Martin Stjernholm
99736dc587 Merge "Rename the runtime linker namespace following ART/Runtime APEX split."
am: b7dee5d148

Change-Id: I2f62b8c8202503447c0905efcd23ef8d74709fff
2019-10-07 20:57:17 -07:00
Treehugger Robot
b7dee5d148 Merge "Rename the runtime linker namespace following ART/Runtime APEX split." 2019-10-08 03:33:29 +00:00
Kiyoung Kim
c467e46c4d Merge "Disable to build ld.config.txt with previous vndk version"
am: 59a9cef6a0

Change-Id: Iaa2d719a5a27ecd4c13c08c922f80766d2d72e34
2019-10-07 18:20:00 -07:00
Kiyoung Kim
59a9cef6a0 Merge "Disable to build ld.config.txt with previous vndk version" 2019-10-08 00:57:41 +00:00
Martin Stjernholm
39e65d5b05 Ensure all namespaces have links to /system/lib(64) for the sanitizer libs.
This CL updates ld.config.vndk_lite.txt, which still is not handled by
linkerconfig.

Test: presubmits
Bug: 140790209
Change-Id: Ia822f86aa0b853656555ade0bed191e07c07d09d
2019-10-07 12:14:57 +01:00
Martin Stjernholm
752a1e0408 Rename the runtime linker namespace following ART/Runtime APEX split.
Remove the kludge in libnativeloader to deal with the inconsistency wrt the
name of the APEX package.

Test: Build & boot
Test: atest system/core/libnativeloader (on cf_x86_phone)
Bug: 139408016
Change-Id: I6115b49237c78c2ea4aa943ca4fe0b296b5a2b62
2019-10-07 12:14:57 +01:00
Kiyoung Kim
7f5ec44dbc Disable to build ld.config.txt with previous vndk version
As generic ld.config.txt will be covered with linker config generator,
ld.config.txt with previous vndk build is no longer required. This
change removes this part so there will be no unnecessary build step for
multiple vndk version build. Also vndk snapshot will have vndkcore and
vndkprivate files with version number, update_and_install_ld_config.mk
has been updated temporary for vndk_lite build.

Bug: 142072719
Test: m -j passed with aosp_arm64 build
Change-Id: Ia7529c80b179dc262c6e7646a34c2a05a0d9be84
2019-10-07 17:30:42 +09:00
Kiyoung Kim
d4e55ce0f7 Merge "Temporary add ld.config.txt build"
am: f2098870c1

Change-Id: I9757cc321a114856efdf95b4fbb13a6dabee2151
2019-10-06 22:56:16 -07:00
Kiyoung Kim
f2098870c1 Merge "Temporary add ld.config.txt build" 2019-10-07 05:48:03 +00:00
Jiyong Park
8da88f0262 Merge "Add a link from runtime ns to the neuralnetworks ns"
am: 71f124dc54

Change-Id: I9da2e6105d416e15ff60446cf265ad7c1900c66f
2019-10-06 21:14:49 -07:00
Kiyoung Kim
7a190055cf Merge "Deprecate ld.config.txt for fully treblelized devices"
am: e5013de9ac

Change-Id: Id4dfa710bc8736fde3a3f913c59b4dd5625013a0
2019-10-06 21:14:23 -07:00
Treehugger Robot
71f124dc54 Merge "Add a link from runtime ns to the neuralnetworks ns" 2019-10-07 03:36:14 +00:00
Kiyoung Kim
2e7b3df686 Temporary add ld.config.txt build
Last generic ld.config.txt deprecation caused build error from
build_test build because of invalid ld.config.txt build target. To fix
this ld.config.txt build target should be enabled until
ld.config.vndklite.txt and ld.config.legacy.txt also become deprecated.

Bug: 138920271
Test: m ld.config.txt passed
Test: build_test passed
Change-Id: I7f45ee66d3ed70a1a698261e1e801a30729f592f
2019-10-07 11:10:37 +09:00
Kiyoung Kim
e5013de9ac Merge "Deprecate ld.config.txt for fully treblelized devices" 2019-10-07 01:07:58 +00:00
Jiyong Park
8ec6f59e62 Add a link from runtime ns to the neuralnetworks ns
libneuralnetworks.so could be preloaded. In that case, it should be
accessible from libnativeloader which runs in the runtime namespace.

Bug: 141847343
Bug: 142111172
Test: m, marlin/sailfish boots
Change-Id: I5b2f3073d0711d6049b4e1e1bd0bcc403949fe14
2019-10-07 09:34:41 +09:00
Bill Peckham
f8f67de2ae Merge "Moving recovery resources from /system to /vendor"
am: ac6672d49f

Change-Id: I1ba6acff9e90520acc752b5d27d279a28b28f88f
2019-10-04 20:24:37 -07:00
Bill Peckham
dea8c9c1ac Moving recovery resources from /system to /vendor
This change is part of a topic that moves the recovery resources from the
system partition to the vendor partition, if it exists, or the vendor directory
on the system partition otherwise. The recovery resources are moving from the
system image to the vendor partition so that a single system image may be used
with either an A/B or a non-A/B vendor image. The topic removes a delta in the
system image that prevented such reuse in the past.

The recovery resources that are moving are involved with updating the recovery
partition after an update. In a non-A/B configuration, the system boots from
the recovery partition, updates the other partitions (system, vendor, etc.)
Then, the next time the system boots normally, a script updates the recovery
partition (if necessary). This script, the executables it invokes, and the data
files that it uses were previously on the system partition. The resources that
are moving include the following.

* install-recovery.sh
* applypatch
* recovery-resource.dat (if present)
* recovery-from-boot.p (if present)

This change moves the recovery resources to vendor in libcutils/fs_config.cpp
and removes the flash_recovery service from rootdir/init.rc. This service moved
to a vendor init.rc file in bootable/recovery/applypatch.

Bug: 68319577
Test: Ensure that recovery partition is updated correctly.
Change-Id: I492f7989ea8042912e9d0e0eadeaa351affbee13
2019-10-04 00:04:08 +00:00
Victor Hsieh
651703706f Merge "Move fsverity_init to after class_start core"
am: 9a7e1eff5a

Change-Id: I219b538f4d8359cb9393261954a1b8e9aebbe427
2019-10-02 13:41:22 -07:00
Victor Hsieh
74043e4498 Merge "Delete fsverity_init.sh for the C++ implementation"
am: 6547c276fe

Change-Id: I2d4272c5f4f3e69337abb87370fc8a783e3e1f44
2019-10-02 13:41:15 -07:00
Treehugger Robot
9a7e1eff5a Merge "Move fsverity_init to after class_start core" 2019-10-02 16:17:47 +00:00
Treehugger Robot
6547c276fe Merge "Delete fsverity_init.sh for the C++ implementation" 2019-10-02 16:17:47 +00:00
Tom Cherry
4c66038ecb Merge "Remove references to /sys/android_power/*"
am: 88f50f536f

Change-Id: I2be021caf617fc5f66cf5432dc0a7a5b94bbd9bd
2019-10-01 15:34:55 -07:00
Tom Cherry
6ddce6b015 Remove references to /sys/android_power/*
It looks like these were deprecated a very long time ago.

Bug: 141939924
Test: tree-hugger
Change-Id: I4fc098b2a45c81fe2af49c0ed4248dc14489f8b1
2019-10-01 13:30:41 -07:00
Kiyoung Kim
f064a1dd8c Deprecate ld.config.txt for fully treblelized devices
From latest change fully treblelized devices started to use
ld.config.txt from generator instead of the one under /system/etc. As so
existing ld.config.txt is no longer required. This change removes all
ld.config.txt content and build script for it.

Bug: 138920271
Test: m -j passed
Test: Tested from Cuttlefish
Change-Id: I9e2d4b305442a4fccc4378a997ec92bfd6cddb84
2019-10-01 13:31:05 +09:00
Kiyoung Kim
990a619b0e Merge "Add library list for VNDK using core variant"
am: e99728fcf2

Change-Id: I2f21bfe0094b4ba82314c8b827955d4caf05b25f
2019-09-29 18:59:13 -07:00
Kiyoung Kim
862c07f22b Add library list for VNDK using core variant
Some device requires VNDK_USING_CORE_VARIANT list, but it was not
implemented in previous. Adding this library list to the build target so
it can be added to system image.

Bug: 141695559
Test: m -j passed & Tested from Cuttlefish
Change-Id: I52750583050401098ca8dacee9cf84e8c5727e36
2019-09-27 14:11:19 +09:00
Tri Vo
9d177091ef ueventd: duplicate /dev/ashmem
am: ff89b8d8c2

Change-Id: Ib3b7fc8dd94dcb499f99f3400d483f11cded9fd4
2019-09-26 11:35:21 -07:00
Treehugger Robot
f0d17fb50e Merge changes from topic "remove_ashmemd"
* changes:
  libcutils: route to /dev/ashmem<boot_id> instead of ashmemd
  ueventd: duplicate /dev/ashmem
2019-09-26 17:56:53 +00:00
Kiyoung Kim
19e70b0c38 Merge "Find or guess installed libraries for VNDK library list"
am: 4b45eab15b

Change-Id: I083920dc89cd83d92bac365caa03379e280e77de
2019-09-25 21:14:53 -07:00
Kiyoung Kim
4b45eab15b Merge "Find or guess installed libraries for VNDK library list" 2019-09-26 00:58:15 +00:00
Tom Cherry
51d8b8bf9d Merge changes from topic "boringssl-kmsg"
am: 993d07fc53

Change-Id: I42f2122241c4f15b751a76e5989a5ffe57791920
2019-09-25 13:21:11 -07:00
Tom Cherry
993d07fc53 Merge changes from topic "boringssl-kmsg"
* changes:
  Redirect boringssl_self_test stdio to kmsg
  init: add stdio_to_kmsg option
2019-09-25 19:56:03 +00:00
Tri Vo
ff89b8d8c2 ueventd: duplicate /dev/ashmem
We want ashmem to only be used via libcutils API, with long-term goal
being deprecation of ashmem with memfd. To do that we route libcutils to
a new source of ashmem fds. We then phase out uses of /dev/ashmem that
doesn't go through libcutils using SELinux.

In Q, we introduced ashmemd as the source of ashmem fds to libcutils.
However, having a separate process and, consequently, binder hops to
handle /dev/ashmem results in performance/memory overhead.

To address the overhead, replace ashmemd with a duplicate of
/dev/ashmem. Name it /dev/ashmem<boot_id>, where boot_id is a random
number generated on each boot. This way we make sure that developers
don't accidentally depend on /dev/ashmem<boot_id>, as that name can't be
hardcoded.

Bug: 139855428
Test: writing "add"/"remove" to /sys/class/misc/ashmem/uevent correctly
adds/removes /dev/ashmem and /dev/ashmem/boot_id
Change-Id: I36d23116048bfcd99903ba46cc133161835a2cfa
2019-09-25 12:49:38 -07:00
nelsonli
055273681c Merge "[vts-core] add copy rules for *-gsi.avbpubkey"
am: 92a9fbeeb6

Change-Id: I7b38b53a336ab4ae1a56e714ee81ab5a9bfbb281
2019-09-24 22:19:01 -07:00
Treehugger Robot
92a9fbeeb6 Merge "[vts-core] add copy rules for *-gsi.avbpubkey" 2019-09-25 04:54:48 +00:00
Kiyoung Kim
fce2838611 Find or guess installed libraries for VNDK library list
Current implementation just uses VNDK library list from variable.
However this does not match with expected library name as some libraries
change their names from initial one by appending extra information such
as version. To match this name each libraries should be searched from
installed module list.

Bug: 141584631
Test: m -j passed
Test: Tested from cuttlefish
Change-Id: If9685be59404226de4db16642781546e478694fb
2019-09-25 10:38:56 +09:00
Tom Cherry
f5e872e9e9 Redirect boringssl_self_test stdio to kmsg
To aid in debugging if there are failures.

Bug: 137267623
Test: add prints to boringssl_self_test and see them
Test: add failure prints to the linker and see them before
      boringssl_self_test runs
Change-Id: I89d50c6a46df994d6ea1fadf00e3a8a796043234
2019-09-24 12:47:14 -07:00
Martin Stjernholm
c82fce8c44 Merge "Rename ANDROID_RUNTIME_ROOT to ANDROID_ART_ROOT following APEX module name change."
am: 0560d0ef6f

Change-Id: I867e33382515b0ba2f10688d352d2057d46fabb6
2019-09-24 10:53:00 -07:00
Martin Stjernholm
0560d0ef6f Merge "Rename ANDROID_RUNTIME_ROOT to ANDROID_ART_ROOT following APEX module name change." 2019-09-24 17:40:04 +00:00
Przemyslaw Szczepaniak
8b66bfc203 Merge "Add libneuralnetworks_packageinfo to neuralnetworks apex dependencies."
am: 5cdf2ef310

Change-Id: I0b2324d857a3668229c2ebbcf83fd4afc0d89070
2019-09-24 08:24:49 -07:00
Przemyslaw Szczepaniak
5cdf2ef310 Merge "Add libneuralnetworks_packageinfo to neuralnetworks apex dependencies." 2019-09-24 15:08:09 +00:00
Zimuzo Ezeozue
92241d52ec Merge "Prepare pass_through mounts"
am: fc48a62d4c

Change-Id: I88ef97b82e60164027c1dbc93cdebfe1cbea35c3
2019-09-23 09:24:57 -07:00
Zim
fc64dad122 Prepare pass_through mounts
Execute mkdir -p /mnt/pass_through/0/emulated
and bootstrap the emulated volume for user 0.

The 'pass_through' paths allow us bind mount the lower
filesystem directly into /storage, bypassing any sdcardfs
of FUSE mounts.

This change is part of enabling upcoming platform changes that are
described in the bug linked below.

Bug: 135341433
Test: builds, boots and pass through directories are created
Change-Id: I46ce207d06a1ec550b8bacac259387371fc0b841
2019-09-23 14:21:27 +01:00
nelsonli
8abba2607b [vts-core] add copy rules for *-gsi.avbpubkey
For using Gtest to run vts_security_avb_test and test it in the
vts-core, we have to add this rule to copy the *-gsi.avbpubkey to the
testcase folder.

Bug: 132702215
Test: 1. add data: "q-gsi.avbpubkey" to Android.bp of the module
      2. m module_name

Change-Id: I810231f39c970da4d2b8ab63daeee02379c7f952
2019-09-23 16:23:50 +08:00
Tom Cherry
cfd87fe514 Merge changes Iff879def,I79c72346
am: 89562f11c8

Change-Id: Ibaee972370d7be10bd6ef973941365282880fb2e
2019-09-20 08:15:20 -07:00
Martin Stjernholm
96f16688c9 Rename ANDROID_RUNTIME_ROOT to ANDROID_ART_ROOT following APEX module name change.
Test: Boot
Bug: 135753770
Change-Id: Ie9a8043ee350164c01a66f1a7ab1b3205076a5c4
2019-09-20 16:07:04 +01:00
Tom Cherry
89562f11c8 Merge changes Iff879def,I79c72346
* changes:
  Simply reboot if the boringssl self test fails
  init: reboot immediately if /data isn't mounted
2019-09-20 14:59:42 +00:00
Martin Stjernholm
9e61e1fed9 Merge "Revert "Include com.android.runtime in the "runtime" linker namespace.""
am: 22784574fa

Change-Id: I7343bd238c39a2b898f79a001a8232c4213d6555
2019-09-20 06:14:06 -07:00
Martin Stjernholm
22784574fa Merge "Revert "Include com.android.runtime in the "runtime" linker namespace."" 2019-09-20 12:55:38 +00:00
Tom Cherry
a76bfb2d97 Simply reboot if the boringssl self test fails
If this check fails and an OTA or mainline module update has recently
happened, we want to rollback the recent change.  The easiest way to
handle this is to reboot, which will trigger the fallback mechanisms
that are already in place.

Bug: 141082587
Test: device reboots if self test fails
Test: device rolls back a recently applied OTA with failing self test
Test: device rolls back a recently applied conscrypt apex update with
      failing self test
Change-Id: Iff879deff09d347262dc7a2acadb9164a5029d4a
2019-09-19 14:59:07 -07:00
Dan Willemsen
a8414e8326 Merge "Add deps to files used by backwards compatibility checker"
am: bac7609c48

Change-Id: Ief39d264a21d410544908299bbb6f204b4a2123e
2019-09-19 14:00:17 -07:00
Martin Stjernholm
59b54f42bb Revert "Include com.android.runtime in the "runtime" linker namespace."
No longer required for hwasan builds, since b/140790209 is fixed.

This reverts change-id I27069b20f7c7068b931340f548b284ce1676466c.

This also reverts the identified change for the memory regression in
b/140648539.

Test: Build & boot on taimen_hwasan-userdebug
Test: Build & boot on crosshatch_hwasan-userdebug
Bug: 140790209
Bug: 139408016
Bug: 140648539
Change-Id: Ib61c53571a4de0970a86ebc391a2ce780247943a
2019-09-19 19:11:47 +01:00
Dan Willemsen
20de6c909f Add deps to files used by backwards compatibility checker
Any used files need to be in the dependencies list for rules. In this
case, this is more than what's actually read in the script, but the
older ones shouldn't change as much, and replicating the logic is
non-trivial.

Bug: 130111713
Test: run with RBE, no longer see error about file not found
Change-Id: I88baf541ce6250a5dbf7b8a7d6b8005ed7cf5cc6
2019-09-19 17:49:44 +00:00
Przemyslaw Szczepaniak
6122bc0037 Add libneuralnetworks_packageinfo to neuralnetworks apex dependencies.
Test: build & flash crosshatch
Bug: 139282353
Change-Id: Ia67aa4f74b1b7fe4f730995c42feb935cb3cd6c8
2019-09-17 16:35:58 +01:00
Paul Crowley
b07606a502 Merge "Create /data/per_boot"
am: 21b00b31d4

Change-Id: Ib849244dfbd7492ce05213b9086a07836f9496a8
2019-09-16 23:01:00 -07:00
Paul Crowley
21b00b31d4 Merge "Create /data/per_boot" 2019-09-17 05:40:05 +00:00
Tobias Thierer
b7bc7db6ee Merge "boringssl_self_test: Enable optimization."
am: d3268a71b8

Change-Id: Icfd75fcf425692f8a3f0fc8d6c9d7e9611ac8932
2019-09-15 21:43:19 -07:00
Paul Crowley
570d20d2ac Create /data/per_boot
Bug: 140882488
Test: Booted twice, checked logs to ensure encryption
    is different each time, adb created files in directory.
Change-Id: I44f746acd1040f7baa9123d4824ba39b194f287b
2019-09-13 15:50:23 -07:00
Tom Cherry
d05b5fd333 Merge "init: add reboot_on_failure service option"
am: a550e7f412

Change-Id: I106786e267f5ea4d855cd45c75667162a5d19ab6
2019-09-13 12:45:07 -07:00
Tobias Thierer
f0f9438d5b boringssl_self_test: Enable optimization.
libcrypto performs a self test when it is loaded, unless
a marker file /dev/boringssl/selftest/[hash] exists which
indicates that the self test has already successfully
completed since the last time the device was booted.

Before this CL topic, libcrypto attempted to create the
marker file when the self test successfully completed.
On Android, dedicated boringssl_self_test{32,64} binaries
are run early during boot and are the only binaries
(apart from init and vendor_int) that have permission to
create these files.

Another CL in this topic stops the boringssl self test
creating a marker file unless the environment variable
BORINGSSL_SELF_TEST_CREATE_FLAG is set to a nonempty value.
This CL sets that value to "true" when running the dedicated
self test binaries, but not for other binaries. This has
the effect that other binaries that run the self test
early during boot (before the dedicated self test binaries
have created the marker files) and which run the self test
will no longer attempt to create the marker file, which
SELinux would have denied anyway.

Bug: 137267623
Test: Treehugger

Change-Id: I99317df1a8c3496d33ae83f9ec346782b2286ac9
2019-09-13 16:51:57 +01:00
Tom Cherry
60971e6ce2 init: add reboot_on_failure service option
This replaces the recently added `exec_reboot_on_failure` builtin, since
it'll be cleaner to extend service definitions than extending `exec`.
This is in line with what we decided when adding `exec_start` instead
of extending `exec` to add parameters for priority.

Test: `exec_start` a service with a reboot_on_failure option and watch
      the system reboot appropriately when the service is not found and when
      the service terminates with a non-zero exit code.

Change-Id: I332bf9839fa94840d159a810c4a6ba2522189d0b
2019-09-13 16:48:35 +01:00
Tobias Thierer
79dcab5b1f Merge "init.rc: Move /system/bin/boringssl_self_test{32,64} call to early-init."
am: 6f735df0d1

Change-Id: I929c1cfc6158b26e7f4472205529ecb8a23c763a
2019-09-13 01:33:07 -07:00