Commit graph

2699 commits

Author SHA1 Message Date
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
Treehugger Robot
6f735df0d1 Merge "init.rc: Move /system/bin/boringssl_self_test{32,64} call to early-init." 2019-09-13 08:22:29 +00:00
Tobias Thierer
bda0554bb2 init.rc: Move /system/bin/boringssl_self_test{32,64} call to early-init.
This should ensure that the self tests run before any other binaries
that load libcrypto and which would otherwise run into SELinux denials
trying to create the marker file /dev/boringssl/selftest/[hash]

The invocation of the self test binaries from the Conscrypt apex
requires the apex to be mounted so it remains at a later point in
the boot process.

Bug: 137267623
Test: Treehugger
Change-Id: I34266d6e9d2f394fffa8a2c7725479b5770d119c
2019-09-13 03:31:42 +01:00
TreeHugger Robot
8aeccd0deb Merge "Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master" into stage-aosp-master 2019-09-11 20:31:33 +00:00
Colin Cross
537e4af235 Merge changes from topic "protobuf-3.9.1"
* changes:
  Use installed paths of vndk libraries for ld.config.txt
  Adapt to google::protobuf::int64 type change
2019-09-11 18:00:15 +00:00
Tobias Thierer
9caa15b5c3 init.rc: drop spurious trailing ':'.
The accidental trailing ':' appears to stop the line
triggering.

Bug: 137267623
Test: Checked the /system/bin/boringssl_self_test32
      now runs on aosp_cf_x86_phone-userdebug

Change-Id: I7b4b1d6b838d8d1a7a0db7f104a94b34962df030
2019-09-10 13:38:55 +00:00
Nikita Ioffe
8bdbea8df5 Remove start vold action from post-fs-data
vold is already started during early-fs which happens before
post-fs-data.

Trying to start it again in post-fs-data is a little bit confusing.

Test: device boots
Change-Id: I5faefe6d1f1bb7472ea3d032b1f157c69da565f1
2019-09-09 14:50:33 +01:00
Xin Li
b13f817bb4 Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
Bug: 135460123
Change-Id: I0600f3b6f15c25247dc70b62d41f2dd6af2f33d8
Merged-In: I888fee03478bbf90a37cd9a905c49de614cc99ff
2019-09-08 13:07:02 -07:00
Tobias Thierer
983f76b3c6 Merge "Init: Run boringssl self test via separate binaries." 2019-09-07 23:46:00 +00:00
Victor Hsieh
8129f86141 Move fsverity_init to after class_start core
The script needs to run after keystore, which is now a core service.
Note the previous APEX requirement by ART is no longer needed.

Test: see keys loaded
Bug: 112038744
Change-Id: I02fb6ce193bb301488b259421f120e6aa6cd75b9
2019-09-06 15:49:58 -07:00
Colin Cross
6dfc460a41 Use installed paths of vndk libraries for ld.config.txt
The installed file name of modules may not match the module name.
Use module-installed-files to get the installed file name.

Bug: 117607748
Test: m checkbuild
Test: only libprotobuf-cpp-*-3.9.1.so changed in ld.config.R.txt
Change-Id: I83b7519f344b65b6cd98c4cabcf9bce0e753ba92
Merged-In: I83b7519f344b65b6cd98c4cabcf9bce0e753ba92
2019-09-05 14:46:16 -07:00
Treehugger Robot
50e408db2d Merge "Limit the compat symlinks to ART binaries." 2019-09-05 19:33:38 +00:00
Tobias Thierer
1136f1592a Init: Run boringssl self test via separate binaries.
Instead of init.cpp knowning about the boringssl self
test, use init.rc to exec dedicated self test executables.

Advantages:
 - The self test is run not only both the copy of libcrypto
   in /system but also /apex/com.android.conscrypt.
 - The self test is run not only for the primary (e.g. 64bit)
   ABI but also for a secondarry (e.g. 32bit) ABI.
 - The dependency on libcrypto is kept to the self test binary.
 - The self test binary abstracts the exact native API for
   running the self test (this will change soon because the
   self test will be run when the library is loaded).

Bug: 137267623
Test: Check that logcat shows both binaries being started as root,
      and finishing with exit code 0.

Change-Id: I1e716749ee2133993f0f7b2836483391fd1a62f0
2019-09-05 01:41:08 +01:00
Martin Stjernholm
c72fd9a9ca Limit the compat symlinks to ART binaries.
For now, keep symlinks only to the binaries demonstrably in use by apps
(dex2oat and dalvikvm).

Test: adb shell ls -l /system/bin
Bug: 124106384
Change-Id: Id662beb4c13785ac9d44bf41f9f33907219b69be
2019-09-02 12:32:42 +00:00
Martin Stjernholm
9c72fb6f08 Merge changes from topic "art-without-bionic"
am: 0c100685dc

Change-Id: I814ac6be70ff8ec197b71d2b68578fba75ac3b4a
2019-09-02 03:46:05 -07:00
Martin Stjernholm
bb55e0776f Update paths and names for the new ART APEX.
am: df96e1f25c

Change-Id: I971a44846276c7e8432bf27fa9465c86f33a1cd2
2019-09-02 03:45:36 -07:00
Martin Stjernholm
df96e1f25c Update paths and names for the new ART APEX.
Test: Build & boot
Test: atest CtsJniTestCases
Bug: 135753770
Exempt-From-Owner-Approval: Approved internally
Change-Id: Ic59b7bc8aae7ce521cf3ec9df4ab72aa611d0b75
Merged-In: Ic59b7bc8aae7ce521cf3ec9df4ab72aa611d0b75
2019-08-30 17:47:31 +01:00
Martin Stjernholm
391332d276 Include com.android.runtime in the "runtime" linker namespace.
This is a temporary fix to keep the Bionic-associated libraries accessible
in the runtime namespace, pending a proper namespace split.

Test: Build & boot with taimen_hwasan-userdebug
Bug: 139408016
Bug: 139916951
Exempt-From-Owner-Approval: Approved internally
Change-Id: I27069b20f7c7068b931340f548b284ce1676466c
Merged-In: I27069b20f7c7068b931340f548b284ce1676466c
2019-08-30 17:47:31 +01:00
Jooyung Han
57b4d65eff Merge "ld.config.txt: remove link from rs to vndk"
am: 059b8dacfd

Change-Id: I647b726e70d2c0710b45b15f1bad08ebe2524b19
2019-08-29 09:40:42 -07:00
Treehugger Robot
059b8dacfd Merge "ld.config.txt: remove link from rs to vndk" 2019-08-29 16:18:27 +00:00
Tom Cherry
21fd368dc2 Merge "Start serial console at the 'init' trigger"
am: c70fc1cbfd

Change-Id: I18b1fc5fb667d4938e9d2a8fb9098444ef53259b
2019-08-29 09:07:37 -07:00
Tom Cherry
71c3ef135d Start serial console at the 'init' trigger
Start the serial console at the 'init' trigger instead of much later
when property triggers happen.  This will help debugging early boot
issues.

Test: serial console starts early for a userdebug build
Test: serial console still doesn't start on a user build
Change-Id: I7112a8e7171c9fa865c8787c9a3d14515bc59478
2019-08-28 14:43:07 -07:00
Paul Crowley
95e7252fd8 Merge "Move layout_version to /data/misc/installd"
am: 24f955155a

Change-Id: Icf3e304aff7e4e1e556c6372be932e3c357d1bbe
2019-08-28 13:35:54 -07:00
Paul Crowley
24f955155a Merge "Move layout_version to /data/misc/installd" 2019-08-28 19:56:15 +00:00
Paul Crowley
e7812e6787 Merge "Create the rollback directories in init"
am: 7a0948f6c4

Change-Id: Iee1c67c81b5809c645c35211431f5c003c07b167
2019-08-26 17:50:47 -07:00
Victor Hsieh
88da3c4943 Delete fsverity_init.sh for the C++ implementation
Test: fsverity keys are still loaded
Bug: 112038744
Change-Id: I0503ba6bfb7008872e30c1b5052b46d77b2b91d4
2019-08-26 11:22:46 -07:00
Paul Crowley
8184d7c2a5 Create the rollback directories in init
Init sets the encryption policy on these directores when created.

Bug: b/139193659
Test: Boot device without this, then try to boot with it without wiping.
Cherrypicked-From: 7bf42f148a
Change-Id: I6b26710674b51d62fa4a07b06e06c539571fb7ac
Merged-In: I6b26710674b51d62fa4a07b06e06c539571fb7ac
2019-08-25 11:24:40 -07:00
Xin Li
d62c31d3ac DO NOT MERGE - Merge build QP1A.190711.019 into stage-aosp-master
Bug: 139893257
Change-Id: Ib69c986e30b903cc48ca835fb307acf569930806
2019-08-23 06:45:26 +00:00
Tobias Thierer
93c7c97047 Merge "Let init create /dev/boringssl/selftest/"
am: c3847f599c

Change-Id: I0eb2b4e57a7d5ba7e9bdcb7e3720d13d01c71a9e
2019-08-22 15:55:22 -07:00
Tobias Thierer
3536fdb927 Let init create /dev/boringssl/selftest/
This directory is intended to be used by boringssl
(through the bssl_self_test{,64} binaries) to create /
check for the existence of marker files indicating that
the self test has successfully run.

It appears that because this is an .rc script for init
rather than a shell,
  mkdir -p /dev/boringssl/selftest 0755 root root
wouldn't work.

Bug: 139348610
Bug: 136262690
Test: Checked that after booting, /dev/boringssl/selftest
  exists:
  $ su root ls -l /dev/boringssl
  total 0
  drwxr-xr-x 2 root root 40 1972-02-11 03:27 selftest
Test: Checked that if I instead try:
  mkdir -p /dev/boringssl/selftest 0755 root root
  in init.rc then the directory isn't created (there is
  no error message in logcat because logd is only
  started in line 311).

Change-Id: I12fdd08c8ead152ac4e62cbd0a2099a9d6170ddb
2019-08-22 21:51:09 +01:00
Jooyung Han
52c5aafb21 ld.config.txt: remove link from rs to vndk
Linker namespace 'rs' has /system/lib/vndk-sp in its search paths.
So we don't need to link 'rs' namespace to 'vndk' namespace.

Bug: 139706981
Test: run RS-using apps from Play
Change-Id: I14c1d6c4e7624bbd6551731ea88de1b4c2e5edb6
2019-08-22 12:18:16 +00:00
Paul Crowley
26aabfd1ed Move layout_version to /data/misc/installd
Bug: 139543295
Test: Boot, ensure file is properly created
Change-Id: I919b5599484b4c77f222e640a1f1b5d65198a0c7
2019-08-21 10:12:18 -07:00
Jiyong Park
5652f3898f Merge "neuralnetworks namespace links to system namespace in [vendor] section" am: 12b0eb363d am: 70961c7b9d
am: e9ea0ee930

Change-Id: I69af175c35ce33817c9c70ec41e7026c5452ab1e
2019-08-15 01:11:30 -07:00
Jiyong Park
e9ea0ee930 Merge "neuralnetworks namespace links to system namespace in [vendor] section" am: 12b0eb363d
am: 70961c7b9d

Change-Id: I0fc571fce30a0a987f4969e023a3ad7ec55bbd88
2019-08-15 00:50:28 -07:00
Jiyong Park
70961c7b9d Merge "neuralnetworks namespace links to system namespace in [vendor] section"
am: 12b0eb363d

Change-Id: I4186ec14731331410edad536f1d5b3250ecf41a1
2019-08-15 00:41:38 -07:00
Jiyong Park
1d89a7e899 neuralnetworks namespace links to system namespace in [vendor] section
This change fixes a bug that neuralnetworks namespace is linked to the
default namespace in [vendor] section. Default namespace is for
/vendor/lib in [vendor] section. System libraries are available in the
'system' namespace.

Bug: 139113342
Test: N/A
Change-Id: I1b6751e5e33522f9829f3d9ad7371efdce01b0f0
2019-08-15 09:48:07 +09:00
Kiyoung Kim
534b2dd436 Merge "Remove unused link from postinstall section" am: a91d84b6c4 am: 48a396b390
am: 2a508a8705

Change-Id: I6f23fcf6000097c67273325c191f3b3c570c3b4e
2019-08-13 23:18:53 -07:00
Kiyoung Kim
2a508a8705 Merge "Remove unused link from postinstall section" am: a91d84b6c4
am: 48a396b390

Change-Id: I73194d3941ba4cbffd0622913cc7553ea41c3faa
2019-08-13 23:03:00 -07:00
Kiyoung Kim
48a396b390 Merge "Remove unused link from postinstall section"
am: a91d84b6c4

Change-Id: I8c3b4df50daccc79e08726a175a3752fdc98e2e9
2019-08-13 22:52:03 -07:00
Kiyoung Kim
a91d84b6c4 Merge "Remove unused link from postinstall section" 2019-08-14 05:16:06 +00:00
Zimuzo Ezeozue
a42fe44038 Merge "Allow switching between sdcardfs and FUSE mounts" am: 6c62ae7adb am: 1562c6cd8c
am: ce2f329675

Change-Id: I18edc45447f921af541c02a64eff2f44a88b0468
2019-08-13 02:47:53 -07:00
Zimuzo Ezeozue
ce2f329675 Merge "Allow switching between sdcardfs and FUSE mounts" am: 6c62ae7adb
am: 1562c6cd8c

Change-Id: Iece2009781c52ba7b24eecb45324981b83968cf6
2019-08-13 02:41:26 -07:00
Zimuzo Ezeozue
1562c6cd8c Merge "Allow switching between sdcardfs and FUSE mounts"
am: 6c62ae7adb

Change-Id: I707ad8146f4318fd3adf0e641aaac68e76d790b4
2019-08-13 02:35:36 -07:00
Zim
c9f8e5dfed Allow switching between sdcardfs and FUSE mounts
This change is part of enabling upcoming platform changes that are
described in the bug linked below.

Bug: 135341433
Test: builds, boots successfully and external storage remains
an sdcardfs mount by default and works correctly
Test: cat /proc/1/mountinfo is unchanged

Change-Id: Idf851b3a42910e0ce8fdd75daea1cce91dd1aa98
2019-08-12 21:37:12 +01:00
Kiyoung Kim
d3a3097927 Remove unused link from postinstall section
Linker ignores link configuration if either namespace is not valid.
However there was a link configuration from postinstall section which
target link namespace does not exist. Also, there was no binary within
postinstall from hwasan build (checked with bonito), so there may be no
usage for this section now. Removing this line for better human
readability, and behavior of the linker would be same as before.

Test: m -j && tested from cuttlefish
Change-Id: I0c7b2949d055ba767e1429238e8764ee7798fe44
2019-08-12 03:56:42 +00:00
vichang
6c4a7d3380 Merge "Move ICU .dat" am: ef0bc63043 am: d9153800b4
am: 90954c62d0

Change-Id: Ie0331af8bbef316f0500d8924b91ce2929e7024d
2019-08-08 04:44:25 -07:00
vichang
90954c62d0 Merge "Move ICU .dat" am: ef0bc63043
am: d9153800b4

Change-Id: If12a24762dd0cfce6b82cb7313813daad6d8f6e5
2019-08-08 04:34:24 -07:00
vichang
d9153800b4 Merge "Move ICU .dat"
am: ef0bc63043

Change-Id: I263e6dd27acf9c322756bb0111873f7efe156d5c
2019-08-08 04:24:56 -07:00
vichang
ef0bc63043 Merge "Move ICU .dat" 2019-08-08 11:06:53 +00:00
David Anderson
bdd8164a5f Merge "Implement basic libsnapshot functionality." am: 23a87716b5 am: aa6b5176fb
am: e5878ed97e

Change-Id: I19c8b7b81e44899dc8dbe375bfd58d18cfdf8b3a
2019-08-04 01:59:49 -07:00
David Anderson
e5878ed97e Merge "Implement basic libsnapshot functionality." am: 23a87716b5
am: aa6b5176fb

Change-Id: I80df3b72007f52ed761fae0565d94fb21bc75106
2019-08-04 01:41:19 -07:00
David Anderson
aa6b5176fb Merge "Implement basic libsnapshot functionality."
am: 23a87716b5

Change-Id: I2c29c0839d7cfefbc4791ab9a447c648e3ed73c0
2019-08-04 01:24:24 -07:00
David Anderson
456e50193b Implement basic libsnapshot functionality.
This CL implements some of the libsnapshot internals necessary to work
with update_engine. In particular it implements snapshot and update
state, as well as creating and mapping snapshot devices. It does not
implement anything related to merging, nor does it implement the full
update_engine flow.

Update state is stored in /metadata/ota/state. To synchronize callers of
libsnapshot, we always flock() this file at the top of public functions
in SnapshotManager. Internal functions are only called while the lock is
held, and a "LockedFile" guard object is always passed through to
indicate proof-of-lock.

Low-level functions, such as snapshot management, have been moved to
private methods. Higher-level methods designed for update_engine will
ultimately call into these.

This CL also adds some functional tests for SnapshotManager. Test state
is stored in /metadata/ota/test to avoid conflicts with the rest of the
system.

Bug: 136678799
Test: libsnapshot_test gtest
Change-Id: I78c769ed33b307d5214ee386bb13648e35db6cc6
2019-08-02 13:30:08 -07:00
Victor Chang
7ea6c1691c Move ICU .dat
Move the symlink destination of /system/usr/icu from Runtime APEX to
i18n APEX

Bug: 137009149
Test: Device boots
Change-Id: I86ff83a28d4124892d2b5d84ff09bc539f76c941
2019-07-26 18:40:33 +01:00
Kiyoung Kim
66c96a84ad Merge "Add libraries txt file to build target" am: becbf6cb5f am: 7e48c78a82
am: 3778a88cb0

Change-Id: If7bc2486444e9862f64b255d14b528196b70770b
2019-07-25 04:03:21 -07:00
Kiyoung Kim
3778a88cb0 Merge "Add libraries txt file to build target" am: becbf6cb5f
am: 7e48c78a82

Change-Id: Ib683165c48b76f2811125c64a2a041cf85e3ed46
2019-07-25 03:53:18 -07:00
Kiyoung Kim
7e48c78a82 Merge "Add libraries txt file to build target"
am: becbf6cb5f

Change-Id: Idb3ea1628ad7d46c60a66fb32954e83dc324f94a
2019-07-25 03:43:24 -07:00
Treehugger Robot
becbf6cb5f Merge "Add libraries txt file to build target" 2019-07-25 10:29:39 +00:00
Kiyoung Kim
178129d1c7 Add libraries txt file to build target
Linkerconfig requires more libraries txt files to get library list
related variable values. To make this available from runtime, those
should be added as build target and included in system image.

Bug: 137511540
Test: m -j && tested from cuttlefish
Change-Id: Id3304eea5a7d8f2ffc171cd3b110b7d65e881f8c
2019-07-24 19:19:01 +09:00
Przemyslaw Szczepaniak
e9495bb069 Merge "ld.config for com.android.neuralnetworks APEX." am: 2f40aa0f60 am: d91345d64c
am: 18c64a08d6

Change-Id: I522cb101e0dfbcd5a37b47a0f733a1e1aeddfc40
2019-07-24 02:44:41 -07:00
Przemyslaw Szczepaniak
18c64a08d6 Merge "ld.config for com.android.neuralnetworks APEX." am: 2f40aa0f60
am: d91345d64c

Change-Id: I4d0da2ec61249b6cb0f6a3b3d37f1047c444d43c
2019-07-24 02:35:39 -07:00
Przemyslaw Szczepaniak
d91345d64c Merge "ld.config for com.android.neuralnetworks APEX."
am: 2f40aa0f60

Change-Id: I64f4f2253d0bf0f789f80a17cecb62ed7a2eb997
2019-07-24 02:25:36 -07:00
Przemyslaw Szczepaniak
2f40aa0f60 Merge "ld.config for com.android.neuralnetworks APEX." 2019-07-24 09:12:18 +00:00
Przemyslaw Szczepaniak
0bb871dc9f ld.config for com.android.neuralnetworks APEX.
Makes updated libneuralnetworks.so in /apex/com.android.neuralnetworks/{LIB}
loadable from all relevant namespaces.

Test: Verified that right library is being loaded using lsof and
Test: verbose debug logs from bionic/ld.
Bug: 137320025
Change-Id: I38140bb9915a3f85f10456e15ed0f492dbdba802
2019-07-22 11:28:42 +01:00
Kiyoung Kim
91467658f1 Merge "Replace xargs with other shell command" am: 18545d3852 am: 6aa4d948b9
am: 08e56a5826

Change-Id: Idc1163dc5a6002addacf174c78c4f79af6192b4a
2019-07-18 19:00:38 -07:00
Kiyoung Kim
08e56a5826 Merge "Replace xargs with other shell command" am: 18545d3852
am: 6aa4d948b9

Change-Id: I5f9d7149598e14dd446bd63722152a0757c86dbe
2019-07-18 18:51:32 -07:00
Kiyoung Kim
6aa4d948b9 Merge "Replace xargs with other shell command"
am: 18545d3852

Change-Id: I08355acaa6c57a557ca53791c00a6e51c02020fb
2019-07-18 18:40:06 -07:00
Treehugger Robot
18545d3852 Merge "Replace xargs with other shell command" 2019-07-19 01:20:15 +00:00
David Anderson
f683ab3e97 Merge "Add a metadata folder for libsnapshot." am: 45a1c998d1 am: f1ce0e51bb
am: 888c5f53aa

Change-Id: I3e0f0c6b7e160c41a6006ef6dbd5b1e2c8979827
2019-07-18 16:20:23 -07:00