Commit graph

43372 commits

Author SHA1 Message Date
Treehugger Robot
9b6da16849 Merge "adb: Use a default _SC_GETPW_R_SIZE_MAX size" 2018-10-25 00:24:56 +00:00
Howard Ro
d173009c74 Make native metrics logger write to statsd socket
Previous submission of this change, aosp/790068, caused a failure in
sdk_mac for CLOCK_REALTIME and <endian.h> not being available.

Bug: 110537511
Test: compiles without failures and verified the correct metric
Change-Id: Iba1dc920ad82e88a4bcdd2feaee9a06202a440c2
2018-10-24 15:19:14 -07:00
Bill Yi
d4e20cd0f9 Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: I413bb086f5ff064430c061bdd5d0fe3d02925304
2018-10-24 14:48:45 -07:00
Elliott Hughes
514edae27c libbase: remove ARRAYSIZE_UNSAFE.
Also fix the indentation of a neighboring comment.

Bug: N/A
Test: builds
Change-Id: Iebe5f518b2ac14718f3cae91007e62b61bed9dc0
2018-10-24 14:34:52 -07:00
David Anderson
7a6c511a6d liblp: Add an abstraction layer for opening partitions.
This change introduces an IPartitionOpener abstraction. Methods that
interact with live metadata, such as ReadMetadata, UpdatePartitionTable,
and FlashPartitionTable, now require an IPartitionOpener object. Its
purpose is dependency injection: it will make these methods much easier
to test when the super partition spans multiple block devices.

All non-test consumers should be using PartitionOpener, and as such,
some helper methods have been added that automatically create one.

Bug: 116802789
Test: liblp_test gtest
      device with super partition boots
Change-Id: I76725a5830ef643c5007c152c00ccaad8085151f
2018-10-24 14:18:38 -07:00
David Anderson
9a5324178e liblp: Store device information in a new block device table.
This patch removes the alignment, block device size, and starting sector
fields from LpGeometry into a new LpMetadataBlockDevice struct. The
metadata now contains a table of these structs, and the table will have
exactly one entry representing the super partition.

This refactoring will make it easier to have logical partitions span
multiple physical partitions. When that happens, the table will be
allowed to have more than one entry, and the first entry of the table
will be considered the "root" of the super partition.

Bug: 116802789
Test: liblp_test gtest
      device with logical partitions flashes and boots
Change-Id: I97f23beac0363182cb6ae78ba2595860950afcf0
2018-10-24 14:18:35 -07:00
Elliott Hughes
32df7ee5c8 libbase: add O_CLOEXEC to <android-base/file.h>.
We already expose O_BINARY, and O_CLOEXEC seems equally legitimate.

Bug: N/A
Test: builds
Change-Id: I7f07e1bb2a5d6b5c5f293783c39ceab148fabefb
2018-10-24 14:06:45 -07:00
Suren Baghdasaryan
a1c684be4f Merge "lmkd: Add command to get number of kills" 2018-10-24 20:58:28 +00:00
Treehugger Robot
19fb58ce57 Merge "adb: correct tcpip help message" 2018-10-24 20:19:09 +00:00
Elliott Hughes
48a0e186a7 Merge "Add a simple MappedFile to libbase and switch fastboot and libziparchive over." 2018-10-24 20:16:59 +00:00
Robert Yang
88c997d4eb adb: Use a default _SC_GETPW_R_SIZE_MAX size
sysconf(_SC_GETPW_R_SIZE_MAX) may return −1 if there is no hard limit
on the the buffer size. Some libc implementations such as musl don't
define this limit and will return -1.

Use a default buffer size to handle this case.

Change-Id: I997b13a2c2dca00574e049a259135e61c8ed8e03
Signed-off-by: Robert Yang <decatf@gmail.com>
2018-10-24 15:23:55 -04:00
Treehugger Robot
0064e9ca1a Merge "Add adbd_test to presubmit test mapping" 2018-10-24 18:33:16 +00:00
bohu
ea0c3cbc18 adb: correct tcpip help message
'adb tcpip <mode>' is meant to affect adbd, not
the host adb server.

BUG: 111434128
Change-Id: I78c958bfbede60b20fb7e0f2444e5b21ecb90f7a
2018-10-24 10:38:33 -07:00
Suren Baghdasaryan
d4a29903c0 lmkd: Add command to get number of kills
Intrduce LMK_GETKILLCNT command for ActivityManager to get the number of
kills from lmkd.

Bug: 117126077
Test: used lmkd_unit_test to verify correct reporting
Change-Id: I09c720a7176b4df95efc544177cd2694f8d791be
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-24 17:18:32 +00:00
Anton Hansson
ac305c82d6 Merge "Create /data/preloads on post-fs-data" 2018-10-24 17:09:11 +00:00
Martin Stjernholm
0b4d4826a6 Merge "Remove unnecessary dynamic dependency on libbase." 2018-10-24 16:49:13 +00:00
Tom Cherry
76b4299943 Merge "init: if vendor_init can read a property, let it be a trigger too" 2018-10-24 15:52:06 +00:00
Martin Stjernholm
53aec482aa Remove unnecessary dynamic dependency on libbase.
This code only uses android-base/macros.h.

Bug: 118374951
Test: mmma system/core/libnativebridge && for f in out/host/linux-x86/nativetest{,64}/*/*; do $f; done
Change-Id: Ifa5a5a3c9370bd128ddd301ea352746699715929
2018-10-24 16:11:45 +01:00
Anton Hansson
c38a63646b Create /data/preloads on post-fs-data
This directory is used for preloads that are typically placed in
the system_other image and copied to /data on first boot if the
cppreopts script is installed.

Bug: 80508492
Test: make
Change-Id: I4121b07ee2fc96d533075d1907557de7e4be4ee0
2018-10-24 15:29:16 +01:00
Treehugger Robot
551efd11f7 Merge "Fix off by one error." 2018-10-24 00:52:15 +00:00
Christopher Ferris
afd6e7712f Merge "Always init gnu_debugdata interface if it exists." 2018-10-24 00:38:51 +00:00
Julien Desprez
2045bbbfb6 Add adbd_test to presubmit test mapping
Onboard device side gtest of adbd to test mapping to be
run in presubmit.

Test: atest adbd_test
Bug: 112104122
Change-Id: Iefb6be0fb0ecea5a95aadce923c223e40f92bdab
2018-10-23 14:03:15 -07:00
Elliott Hughes
e8f4b14301 Add a simple MappedFile to libbase and switch fastboot and libziparchive over.
This allows us to remove libziparchive's dependency on libutils.

Bug: http://b/79112958
Test: ran libbase and libziparchive tests, ran fastboot manually
Change-Id: I95c651976dad222863e5b8c37d4514b778f5dce7
2018-10-23 13:20:49 -07:00
Christopher Ferris
e8c4ecf49e Always init gnu_debugdata interface if it exists.
Every real call always sets the value to true to init the gnu_debugdata
interface, so remove this parameter.

Test: Builds, unit tests pass.
Change-Id: I07fb3adbbd5b65b51c0dc7608561e820a5095051
2018-10-23 12:13:54 -07:00
Josh Gao
b59a38d343 Merge "Add feature flag for b/110953234 fix." 2018-10-23 18:30:11 +00:00
Treehugger Robot
74cdc8a542 Merge "Accept apex packages as argument." 2018-10-23 18:29:53 +00:00
Josh Gao
fb08510784 Add feature flag for b/110953234 fix.
Bug: http://b/110953234
Bug: http://b/117946501
Test: adb features
Test: test_device.py
Change-Id: I340a30544a6d0ab1b2545e5371c8f98d04158c56
2018-10-23 18:28:46 +00:00
Treehugger Robot
6153677ff5 Merge "llkd: Skip apexd for process checks" 2018-10-23 17:13:28 +00:00
Florian Mayer
9c36a99ebc Fix off by one error.
Change-Id: I18a2d177f3212626b7091150f42dfe151e47570e
2018-10-23 18:10:41 +01:00
Tao Bao
bebeb7e951 Merge "healthd: GRSurface now is a class." 2018-10-23 17:06:35 +00:00
Dario Freni
29814deaa7 Accept apex packages as argument.
Bug: 112669193
Test: Successfully reaches PackageManager. Doesn't break existing flows.
Change-Id: If4a173e290ebf0b70beb97111a6d75400da7ec8d
2018-10-23 11:07:16 +01:00
Treehugger Robot
33eb652783 Merge "adb: don't use <error.h>." 2018-10-23 03:53:50 +00:00
Treehugger Robot
6d6d9a8052 Merge "Remove bcp_dep." 2018-10-23 02:23:09 +00:00
David Anderson
3e77d7a960 Merge "liblp: Add MetadataBuilder helpers for pruning unused groups." 2018-10-23 01:50:39 +00:00
Elliott Hughes
d2aaede610 adb: don't use <error.h>.
This should fix the bloody Mac build, which doesn't have <error.h>. Since
we weren't entirely happy with error(3) anyway, switch to the toybox
style of error_exit and perror_exit, which are slightly briefer and quite
a bit more intention-revealing.

Bug: N/A
Test: builds
Change-Id: Ic8e411906c363af51657da5ce947b25a0b6bb1f3
2018-10-22 17:04:32 -07:00
Treehugger Robot
fa677f573a Merge "liblp: Move free-region calculation into a separate function." 2018-10-22 23:41:27 +00:00
Tom Cherry
b35f827c97 init: if vendor_init can read a property, let it be a trigger too
There is a list of 'stable_properties' that vendor_init can use as
property triggers for Treble property compliance.  This list came about
since init parses init scripts before all partitions are mounted and
therefore before all property context files are available, such that
init cannot use the normal SELinux mechanisms for determining if a
given property is vendor_init readable.

Currently though, we require all partitions that would contain
property context files to be mounted during first stage mount, so we
can use the normal SELinux mechanisms here, so this change deprecates
the stable_properties list and moves init to use SELinux to determine
if a property can be a trigger.

Bug: 71814576
Test: vendor_init fails to use non-readable properties as a trigger
Test: vendor_init successfully uses readable properties as a trigger
Change-Id: I6a914e8c212a3418cbf4a8a07215056aad2e0162
2018-10-22 16:16:03 -07:00
Mark Salyzyn
e81ede85c7 llkd: Skip apexd for process checks
apexd is a sensitive daemon, and the ability to ptrace this domain is
restricted by SELinux policy.  apexd spawns a binder thread which
makes matching difficult, as we would instead need to use
/system/bin/apexd as the blacklist key.

Change llkd to also check for a match on the basename of the
executable path.  This will solve a gotcha expectation when creating
a blacklist key.

Without this change, llkd continues to generate SELinux denials of

type=1400 audit(0.0:1764): avc: denied { ptrace } for comm="llkd" scontext=u:r:llkd:s0 tcontext=u:r:apexd:s0 tclass=process permissive=0

Commit 5390b9add4 was originally intended
to fix these denials, but it seems to have had no effect and the denials
are still being generated.  This change will fix it.

Test: none
Change-Id: I00aa10dfff30c65a120ad30582b820e2d4b1bb38
2018-10-22 16:11:02 -07:00
Evgenii Stepanov
d33653a26e Remove bcp_dep.
Since the build system move to kati/ninja, build command is an
implicit dependency of a target. This makes the bcp_dep / bcp_md5
thing obsolete.

Test: make

Change-Id: I4ce9ebdabfc72b188e49f12888054d63b3cda64d
2018-10-22 16:08:01 -07:00
Treehugger Robot
190fd10913 Merge "fs_mgr: overlayfs unit test" 2018-10-22 22:02:36 +00:00
Tao Bao
777af95c4e healthd: GRSurface now is a class.
Test: mmma -j system/core/healthd
Change-Id: I696542535cf4707c707c4f024de504ce343b1e69
2018-10-22 13:20:33 -07:00
Josh Gao
f5518d04f1 Merge "adb: set main thread in transport tests." 2018-10-22 20:01:44 +00:00
Josh Gao
95a3916ef9 Merge changes I9b77c105,I0b369d16,I59602c20,Iae4f3d55
* changes:
  adbd: implement a nonblocking USB Connection.
  adbd: rename daemon/usb.cpp to daemon/usb_legacy.cpp.
  adbd: open functionfs ep0 as O_RDWR.
  adbd: extract functionfs fd creation.
2018-10-22 19:45:33 +00:00
Elliott Hughes
f2b170573f Merge "adb: rationalize fatal/error logging." 2018-10-22 19:44:11 +00:00
Mark Salyzyn
7f47e4bac3 fs_mgr: fs_mgr_overlayfs_teardown access to dynamic partition data
If fs_mgr_overlayfs_teardown is called with a specific mount_point
reference (eg: /vendor, /product, /system) when /mnt/scratch is not
mounted (eg: in recovery or fastboot mode), then mount it to perform
the directory teardown.

Test: manual on future changes: fastboot flash vendor -> fastbootd
Bug: 109821105
Bug: 117605276
Change-Id: I5735008e33b57d35345a799dc68bb43c9189135a
2018-10-22 12:38:17 -07:00
Mark Salyzyn
0b23968e25 fs_mgr: overlayfs unit test
Provide a means to test out overlayfs work

Test: adb-remount-test.sh
Bug: 109821105
Bug: 117605276
Change-Id: Ia6114c8f4d0c3424cb869d002cc61cfc6863151c
2018-10-22 12:36:10 -07:00
Treehugger Robot
abdf6f2938 Merge "logcat: include 'kernel' and 'security' buffers in logcat --help" 2018-10-22 19:33:15 +00:00
David Anderson
5cb50a24bc liblp: Add MetadataBuilder helpers for pruning unused groups.
These will help update_engine clear the target slot before applying an OTA.

Bug: 117182932
Test: liblp_test gtest
Change-Id: I6ad370e617f22f2098245a0028a93488f9ac8674
2018-10-22 12:00:23 -07:00
David Anderson
11440493a7 liblp: Move free-region calculation into a separate function.
In preparation for supporting multiple block devices, this factors out
the free-list calculation for resizing partitions.

Additionally, it fixes a bug where space in between the first usable
sector and the first extent wasn't added to the free list.

Bug: 116802789
Test: liblp_test gtest
Change-Id: I965760eef0176020e9a5691ce1be2c8b5e0c8bc8
2018-10-22 12:00:13 -07:00
Tom Cherry
d2c7613fc0 logcat: include 'kernel' and 'security' buffers in logcat --help
Bug: 115798272
Test: documentation looks right
Change-Id: I35dcc51e6779e7382843d4d92fb6182ddf0e0202
2018-10-22 11:16:07 -07:00