Commit graph

2503 commits

Author SHA1 Message Date
Kiyoung Kim
f2098870c1 Merge "Temporary add ld.config.txt build" 2019-10-07 05:48:03 +00: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
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
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
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
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
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
4b45eab15b Merge "Find or guess installed libraries for VNDK library list" 2019-09-26 00:58:15 +00: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
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
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
5cdf2ef310 Merge "Add libneuralnetworks_packageinfo to neuralnetworks apex dependencies." 2019-09-24 15:08:09 +00: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
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
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
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
21b00b31d4 Merge "Create /data/per_boot" 2019-09-17 05:40:05 +00: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
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
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
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
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