Commit graph

52347 commits

Author SHA1 Message Date
Tobias Thierer
983f76b3c6 Merge "Init: Run boringssl self test via separate binaries." 2019-09-07 23:46:00 +00:00
Treehugger Robot
c8eadff1de Merge "Add stub code to read MS OS 2.0 descriptors." 2019-09-07 03:22:15 +00:00
Wei Wang
d5dff26049 Merge "init: boot into thermal shutdown target on supported devices" 2019-09-06 22:59:07 +00:00
Josh Gao
3b8cd67dff Add stub code to read MS OS 2.0 descriptors.
Linux doesn't seem to actually support emitting them, so we can't check
that they're actually there, but commit the code to read them so that
if and when Linux gets support, it's easier to check.

This also adds some error checking for ill-formed binary object store
entries.

Test: check_ms_os_desc
Change-Id: I4baf6a16f0f96acbec468b843db65d4ab3a589fe
2019-09-06 14:45:11 -07:00
Josh Gao
4118221c66 Merge "adb: add host tool to check for WinUSB descriptor." 2019-09-06 20:19:31 +00:00
Treehugger Robot
edf8e5715b Merge "Remove libhwbinder/libhidltransport deps" 2019-09-06 20:04:32 +00:00
Yifan Hong
233c32a454 Merge changes from topic "libsnapshot_prep"
* changes:
  libsnapshot: MapPartitionWithSnapshot cleanup itself if failed
  libsnapshot: MapPartitionWithSnapshot: fix timeout
  libsnapshot: require ex lock for {Create}{CowImage,Snapshot} / DeleteSnapshot
  libsnapshot: Refactor: add {Create,Map,Unmap}CowImage
2019-09-06 19:28:09 +00:00
Wei Wang
5f181bc503 init: boot into thermal shutdown target on supported devices
Bug: 137982557
Test: thermal shutdown
Change-Id: I4c7c4647e340be6be7a37a3dde6324b4d7903007
(cherry picked from commit 271014e832)
2019-09-06 11:26:43 -07:00
Treehugger Robot
7b968315ee Merge "init/fscrypt_init_extensions: remove redundant log message" 2019-09-06 17:34:05 +00:00
Treehugger Robot
0b18c6735f Merge "fs_mgr: overlayfs: README merge in public document" 2019-09-06 03:28:42 +00:00
Treehugger Robot
95773aa4b6 Merge "Moving skip_mount.cfg to system_ext partition" 2019-09-06 03:17:22 +00:00
Treehugger Robot
f613b4a9a6 Merge "Reland "libutils: Introduce StaticString16""" 2019-09-06 02:29:23 +00:00
Treehugger Robot
fd4fecc162 Merge "compare android::Vector and std::vector" 2019-09-05 23:42:53 +00:00
Josh Gao
27512c9e49 adb: add host tool to check for WinUSB descriptor.
Bug: http://b/68993980
Test: manual
Change-Id: I97395c9738a671dd136c6cf66f88fdb769ec7227
2019-09-05 15:56:54 -07:00
Yifan Hong
f35687df6e libsnapshot: MapPartitionWithSnapshot cleanup itself if failed
When we run MapPartitionWithSnapshot, intermediate devices aren't
cleaned up if the call fails. Hence, record these intermediate devices
we have created along the way using the new AutoDevices class. Upon
failure, the AutoDevices object will be destroyed, and all the
intermediate devices will be deleted from device mapper or image
manager. Upon success, AutoDevices::Release() makes sure the
intermediate devices aren't deleted.

Test: libsnapshot_test

Change-Id: Iff4c1297528288a27765c0224b67254b68c89776
2019-09-05 15:14:34 -07:00
Yifan Hong
5576f7cc13 libsnapshot: MapPartitionWithSnapshot: fix timeout
The MapPartitionWithSnapshot call doesn't respect params.timeout.
Fix it.

Test: libsnapshot_test
Change-Id: I2c5a2889e4687449319bb2018e39405682b458a6
2019-09-05 15:14:34 -07:00
Yifan Hong
caaf9a617a libsnapshot: require ex lock for {Create}{CowImage,Snapshot} / DeleteSnapshot
Create / Deleting the COW image / snapshot changes states, so it makes
sense to require an exclusive lock before doing so. If caller doesn't hold
an exclusive lock, parallel calls to MapCowImage / MapSnapshot / UnmapCowImage /
UnmapSnapshot may have weird results.

Test: libsnapshot_test

Change-Id: I4be660df1059ec24144f8baf43a1c8c05d9e372b
2019-09-05 15:14:34 -07:00
Yifan Hong
27fb95dedf libsnapshot: Refactor: add {Create,Map,Unmap}CowImage
Move operations on image manager in *Snapshot functions to their own
functions for finer granularity in control. *Snapshot functions only
changes snapshot state and snapshot devices, but not the supporting
devices.

Now, MapSnapshot can take a customized COW device path. We will have
a more complicated stack for the COW device in upcomming CLs.

Also, Change SnapshotManager::CreateSnapshot's signature to
accept a SnapshotStatus struct that includes all sizes, so that
cow_partition_size and cow_file_size can also be written to the snapshot
status file.

Test: libsnapshot_test

Change-Id: I388ecd4bcfbfcc3f379ecb6993615234f4fbcb4e
2019-09-05 15:14:34 -07:00
Steven Moreland
a4eaf64de8 Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I0bdffced6af52695c0ef98c9dd659348e56f7aa6
2019-09-05 14:17:42 -07:00
Mark Salyzyn
6ef0081fc6 fs_mgr: overlayfs: README merge in public document
A public facing document rewrite merged into the AOSP-facing README.

Test: none
Bug: 118781664
Change-Id: I6b9d3c4e274edc700dd587f2adc51147382d6b3f
2019-09-05 14:07:57 -07:00
Eric Biggers
7a5f6c5912 init/fscrypt_init_extensions: remove redundant log message
On every boot, there is a "duplicate" message logged at INFO level for
every system device-encrypted directory, e.g.:

    1     1 I init    : Setting policy on /data/app-private
    1     1 I init    : Encryption policy of /data/app-private set to 3a19970b1aa3abed modes 127/4

Or:

    1     1 I init    : Setting policy on /data/app-private
    1     1 I init    : Verified that /data/app-private has the encryption policy 3a19970b1aa3abed modes 127/4

(Before I51ee70706bc9ccb216ccefd7bdfbbfc57faae14d the second messages
were slightly different, but were similar and still at INFO level.)

The issue is that set_system_de_policy_on() prints its own log message,
then calls fscrypt_policy_ensure() which prints a message too; and the
second message is essentially a superset of the first.

Clean this up by removing the message from set_system_de_policy_on().

Test: Booted and checked the log.
Change-Id: I2786ba7e2dbb355f159ac9d8fe5ad1f0a4cdbfea
2019-09-05 13:20:25 -07:00
Vic Yang
9fb93edd5b Reland "libutils: Introduce StaticString16""
This reverts commit 1270e4fbf1.

Bug: 138856262
Test: Run unit tests.
Change-Id: I37be01d7d4f98a83078870cb0917275336fa2bbd
Merged-In: I8da93f2c9b95183e32d4a2ea895f90c449abbe4d
2019-09-05 13:19:14 -07:00
Treehugger Robot
50e408db2d Merge "Limit the compat symlinks to ART binaries." 2019-09-05 19:33:38 +00:00
Tobias Thierer
8bea425845 Merge "init: add exec_reboot_on_failure builtin" 2019-09-05 18:04:14 +00:00
Xin Li
d0a45dbc9a Merge "DO NOT MERGE - Merge Android 10 into master" 2019-09-05 16:53:23 +00:00
Steven Moreland
915521c7d8 Merge "libcutils: Implement ashmem_valid on host." 2019-09-05 15:57:46 +00:00
Xin Li
d4ef92d866 DO NOT MERGE - Merge Android 10 into master
Bug: 139893257
Change-Id: Id5c7c0c40d29884640b649db217be1eb86ee9147
2019-09-04 22:08:17 -07:00
Tom Cherry
4375597f95 Merge "liblog: run liblog#enoent only as root"
am: 8412deda51

Change-Id: I5b179babe5324bcd63a5303f65a72e9e4bb6e9c2
2019-09-04 19:30:02 -07:00
Treehugger Robot
8412deda51 Merge "liblog: run liblog#enoent only as root" 2019-09-05 02:04:33 +00:00
Steven Moreland
c0660668e7 libcutils: Implement ashmem_valid on host.
Was missing.

Bug: 124524556
Test: build host code with dependency on this
Change-Id: I0074923e9ec53e42f9479fff47df0a24c8750164
2019-09-05 01:26:19 +00:00
Daniel Colascione
2378575dac Merge "Improve codegen slightly when doing FD validity checks"
am: 9ad079ba58

Change-Id: I4262f086b9041bb28536cf2c7598817fac63b8cc
2019-09-04 18:20:24 -07:00
Daniel Colascione
9ad079ba58 Merge "Improve codegen slightly when doing FD validity checks" 2019-09-05 00:56: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
Tom Cherry
7896e7adcc init: add exec_reboot_on_failure builtin
Add exec_reboot_on_failure builtin and refactor the VDC commands that
had similar functionality.  These will now also reboot in the case
that the program cannot be found or run for any reason.

Test: boots normally, reboots if command is not found or if command
      returns status '1'

Change-Id: I1c99498c2b741512a50188e1a325c25e9ec8fba0
2019-09-04 16:23:15 -07:00
Yifan Hong
362853af1a Merge "libsnapshot: Refactor CreateLogicalAndSnapshotPartitions"
am: dccd6b3389

Change-Id: I6222327558d2fc9f0bad1056ef4d53e4e8a5fa48
2019-09-04 15:11:48 -07:00
Yifan Hong
fb0386f76c Merge "liblp: Indicate usable regions in ResizePartition"
am: d6c426c0f5

Change-Id: Ia555bc10e05cd60fec50f7974581ff9a1269c67d
2019-09-04 15:10:54 -07:00
Yifan Hong
dccd6b3389 Merge "libsnapshot: Refactor CreateLogicalAndSnapshotPartitions" 2019-09-04 21:55:39 +00:00
Yifan Hong
d6c426c0f5 Merge "liblp: Indicate usable regions in ResizePartition" 2019-09-04 21:53:57 +00:00
Alessio Balsini
ab92aeb61b Merge "CreateSnapshot: reduce zero-filling for CoW images"
am: 2dc25441e2

Change-Id: Ia97c9c1888bcb751de5b2fccde30e036c2618591
2019-09-04 14:35:35 -07:00
Christopher Ferris
f0edee5933 Merge "Add test mapping to run the libunwind tests."
am: c3163e7664

Change-Id: Ib82965bef7d9e9a983cbc7d282fa59abab083ece
2019-09-04 14:21:22 -07:00
Treehugger Robot
2dc25441e2 Merge "CreateSnapshot: reduce zero-filling for CoW images" 2019-09-04 21:19:44 +00:00
Daniel Colascione
7c706baedb Improve codegen slightly when doing FD validity checks
See https://gcc.godbolt.org/z/hGUZIk

Test: inspection
Bug: 140506797
Change-Id: I6fe87b16e18c93b7fc3ca28edbbc68c245e7e5e5
2019-09-04 13:46:50 -07:00
Tom Cherry
0bf41672e9 liblog: run liblog#enoent only as root
Previously this test would rely on ro.debuggable being true, but there
are now some circumstances where ro.debuggable is true, yet `su` does
not exist.  Therefore we only run this test when it is root.

Also simplify some of the test macros.

Bug: 140446213
Test: passes as root, skips as non-root
Change-Id: I0651963d5c7d4f5308989ab6b04aab1042094e5a
2019-09-04 13:39:06 -07:00
Christopher Ferris
c3163e7664 Merge "Add test mapping to run the libunwind tests." 2019-09-04 20:28:37 +00:00
Yifan Hong
44d025d928 Merge "libsnapshot: Don't accidentally delete snapshot when collapsing"
am: 48eb2ee176

Change-Id: Ibe795625cd858e7cf72dc0a7ac4d08bf2f081d7b
2019-09-04 13:08:13 -07:00
Yifan Hong
ab13ed350e Merge "libsnapshot: Allow multiple calls to FinishedSnapshotWrites"
am: 09a0c98506

Change-Id: If259e2d4a9663575198aa1b14e13a4c9a50cf1e7
2019-09-04 13:05:48 -07:00
Yifan Hong
48eb2ee176 Merge "libsnapshot: Don't accidentally delete snapshot when collapsing" 2019-09-04 18:53:23 +00:00
Yifan Hong
09a0c98506 Merge "libsnapshot: Allow multiple calls to FinishedSnapshotWrites" 2019-09-04 18:52:30 +00:00
Bowgo Tsai
79f875f240 Moving skip_mount.cfg to system_ext partition
We're now adding a core CSI system.img that is common across different
targets. So GSI-specific files should be moved to system_ext partition.

Note that GSI is a system.img that includes the contents of product and
system_ext partitions, under /system/product and /system/system_ext,
respectively. That's why it's under /system/system_ext instead of
/system or /system_ext.

Bug: 137711197
Test: boot GSI on crosshatch
Change-Id: I1ee54c1a434f2d7cf34b4ea2cbda9c732ec932a1
2019-09-04 22:28:47 +08:00
Yifan Hong
a93ac6b9c8 libsnapshot: Allow multiple calls to FinishedSnapshotWrites
If update_engine crashes at certain point, it may
call FinishedSnapshotWrites multiple times. Allow
this to happen.

Test: apply OTA
Change-Id: Ib36cfe38328fd5d6ca408c97024c81569a4bd440
2019-09-03 21:07:30 -07:00