Commit graph

44415 commits

Author SHA1 Message Date
Treehugger Robot
2dcb4160fa Merge "Fix 32-bit dmabuf_dump build" 2019-02-08 09:22:05 +00:00
Nicolas Geoffray
82503887fa Merge "Don't abort the build if a repo doesn't have the test/vts/tools/build/." 2019-02-08 08:48:28 +00:00
Nicolas Geoffray
646c6d902d Don't abort the build if a repo doesn't have the test/vts/tools/build/.
Test: build with master-art manifest
Exempt-From-Owner-Approval: Required for unbreaking ART development.
Change-Id: I6afc0e5444dfa21532a4c802f8c463091cab2b11
2019-02-08 08:47:12 +00:00
Treehugger Robot
9c4fda6cd2 Merge "adb: "support" O_CLOEXEC in adb_open on Windows." 2019-02-08 06:56:47 +00:00
Treehugger Robot
151499e47e Merge "adb: hopefully deflake test_adb.py." 2019-02-08 05:46:16 +00:00
Colin Cross
0a92453a14 Fix 32-bit dmabuf_dump build
Fixes:
system/core/libmeminfo/libdmabufinfo/tools/dmabuf_dump.cpp:109:39: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]

Test: lunch aosp_arm-eng && m dmabuf_dump
Change-Id: Ie605d9b94f5eff888f6a64801512216253a6babb
2019-02-07 21:35:03 -08:00
Wei Wang
575996837c Merge "bootstat: Update boot reason property earlier" 2019-02-08 02:55:13 +00:00
Wei Wang
4e9c653c93 bootstat: Update boot reason property earlier
bootstat updates boot reason upon boot_complete, however users of the
updated properties e.g. getLastShutdownReason from PowerManager could
be called before boot_complete. This introduces a inconsistency and
racing for those APIs.

In this CL, we change boot reason to be updated at the same time when
zygote starts where persist properties have been loaded already. Also
the initialization of bootloader's boot reason is pulled into post-fs
where all kernel command line arguments have been parsed in init already.

Bug: 122696730
Bug: 119509425
Test: trigger thermal shutdown and see warnings
Test: verify boot reason properties updated correctly post boot
Change-Id: Ia393b98ea072bc0ae6e4110d111393b34be0ee5d
Signed-off-by: Wei Wang <wvw@google.com>
2019-02-08 02:55:06 +00:00
Treehugger Robot
708d45979c Merge "meminfo: add tools/dmabufinfo_dump to dmabufinfo" 2019-02-08 02:53:54 +00:00
Jooyung Han
c624621554 Mark libs as double_loadable
libs(libasyncio libmemtrack libprocinfo libusbhost) have
vendor variants and they are also used by LLNDK(libmediandk)
which means these libs can be double-loaded.

deps:
- libmediandk -> libmedia_jni -> libmtp -> libasyncio
- libmediandk -> libmedia_jni -> libandroid_runtime -> libmemtrack
- libmediandk -> libmedia_jni -> libandroid_runtime -> libdebuggerd_client -> libprocinfo
- libmediandk -> libmedia_jni -> libmtp -> libusbhost

Bug: 121280180
Test: m -j
Change-Id: I2c2b5d67cf47b85a2aa8c08f85c7e1a84490cf4e
2019-02-08 11:48:04 +09:00
Treehugger Robot
a0b17a3d8b Merge "vts test for /proc/<pid>/smaps_rollup" 2019-02-08 02:05:55 +00:00
Josh Gao
aa95aa063f adb: hopefully deflake test_adb.py.
The reconnection test is spuriously failing on test infrastructure for
unclear reasons, which might be due to a race between the connection
attempt and the first command we send. Insert a sleep to hopefully
reduce the flakiness.

Bug: http://b/123247844
Test: ./test_adb.py (but it didn't fail for me in the first place)
Change-Id: Ic36924c16bae424accfec700af4623794fd1f123
2019-02-07 17:53:29 -08:00
Erick Reyes
32afafa67e Merge "meminfo: Fix dmabufinfo total ref accounting" 2019-02-08 01:48:01 +00:00
Steven Laver
57a740eca2 Allow properties to be derived from partition-specific properties during init
If not present, ro.product.[brand|device|manufacturer|model|name] and
ro.build.fingerprint will be resolved during init from
partition-specific properties.

Test: booted system image, verified properties
Test: booted recovery image, verified properties
Bug: 120123525
Change-Id: I7fe2793a7d9eb65645d92ceb408f1f050acf9a81
2019-02-07 16:15:55 -08:00
Treehugger Robot
3dbdf65afc Merge "Freshen libsystem/OWNERS" 2019-02-07 22:33:39 +00:00
Josh Gao
4b019a5f25 adb: "support" O_CLOEXEC in adb_open on Windows.
Previously, we were rejecting the flag and failing with EINVAL. File
handles aren't inherited by default, so just ignore the flag.

Bug: http://b/123753498
Test: adb install --streaming foo.apk
Change-Id: I17401fcdd58024956d47a5c4c0c57b06831d9817
2019-02-07 14:23:39 -08:00
Jiyong Park
a2159c493b fs_config supports shell wildcard patterns
It now supports shell wildcard pattern matching using fnmatch(3).

Bug: 123743953
Test: atest libcutils_test
Change-Id: Ib82ae3bf717cbdba267024e1c9d3da004274b95c
2019-02-08 03:53:52 +09:00
Mark Salyzyn
c6a2d7d5cd Merge "fs_mgr: overlayfs: fs_mgr_overlay_setup true if already mounted" 2019-02-07 18:25:55 +00:00
Jesse Hall
9c8e3c3a93 Freshen libsystem/OWNERS
Test: none
Change-Id: I6ce1f28bdc6553910a4e4dafb125d05d9e11035a
2019-02-07 10:19:01 -08:00
Mark Salyzyn
4e3a5f61a4 Merge "fs_mgr: overlayfs support legacy devices (marlin)" 2019-02-07 18:03:55 +00:00
Jiyong Park
186661d135 Merge "Configure /system/apex/com.android.runtime.[debug|release]/bin/*" 2019-02-07 16:08:24 +00:00
Elliott Hughes
5f5ffc8e19 Merge "MappedFile and FileMap should support zero-length mappings." 2019-02-07 15:45:03 +00:00
Martin Stjernholm
a015ad2779 Revert^2 "Enable APEX stubs for libnativeloader."
This reverts commit 5c8c6a90fd.

Reason for revert: Another try with http://r.android.com/892234 in place.

Test: Flash and boot
Bug: 113373927
Change-Id: I508c217a177e9cdd65d8a405d1315aeeacabe18d
2019-02-07 15:23:49 +00:00
Joel Fernandes
3133b695e0 Merge changes from topic "memfd-support"
* changes:
  init: set the sys.use_memfd property to false
  Add support for memfd
2019-02-07 14:17:13 +00:00
Treehugger Robot
d338c1f8e6 Merge "Add some overview docs for classloader-namespace." 2019-02-07 05:35:46 +00:00
Suren Baghdasaryan
3a22225ac6 Merge "libprocessgroup: Fix file mode parsing that requires octal values" 2019-02-07 04:54:28 +00:00
Erick Reyes
c4cac8f17f meminfo: make dmabuf_dump dependency on debugfs optional
dmabuf_dump had a hard dependency on debugfs to gather the initial list
of buffers for all proceses, make it optional.

Change-Id: I1d271297c0ad6124b321a1ee8aa01d3e88ca9fed
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-02-06 18:47:38 -08:00
Erick Reyes
2f6792e286 libmeminfo: make libdmabufinfo and dmabuf_dump vendor available
Removed dependency on libc++fs and changed liblog to shared linkage to
cope with build errors derived from the change.

Removed dmabuf_dump unnecessary dependencies and made it soc_specific.

Removed reference to std::filesystem::is_symlink to workaround the
following error when linking with the library:

ld.lld: error: undefined symbol:
std::__1::__fs::filesystem::__symlink_status(std::__1::__fs::filesystem::path
const&, std::__1::error_code*)
>>> referenced by filesystem:1743
(external/libcxx/include/filesystem:1743)
>>>
dmabufinfo.o:(android::dmabufinfo::AppendDmaBufInfo(int,
std::__1::vector<android::dmabufinfo::DmaBuffer,
std::__1::allocator<android::dmabufinfo::DmaBuffer> >*)) in archive

Bug: 63860998

Change-Id: Ieafdc87c64f153625df9e21fc8299292b2447aef
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-02-06 18:47:31 -08:00
Suren Baghdasaryan
40673c9250 Merge "libprocessgroup: Fix cgroup directory ownership setup" 2019-02-07 01:42:00 +00:00
Joel Fernandes
ae7f052328 init: set the sys.use_memfd property to false
The sys.use_memfd property is set by default to false in Android
to temporarily disable memfd, till vendor and apps are ready for it.
The main issue: either apps or vendor processes can directly make ashmem
IOCTLs on FDs they receive by assuming they are ashmem, without going
through libcutils. Such fds could have very well be originally created with
libcutils hence they could be memfd. Thus the IOCTLs will break.

Set default value of sys.use_memfd property to true once the issue is
resolved, so that the code can then self-detect if kernel support is present
on the device. The property can also set to true from adb shell, for
debugging.

Bug: 113362644

Change-Id: I0f572ef36cac2a58fe308ddb90bbeffbecdaed3b
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-02-07 00:40:22 +00:00
Joel Fernandes
519440468b Add support for memfd
This patch adds support to make libcutils create and use memfd where
possible, instead of ashmem.

The libcutils library is made dynamic, since apps are still sending over
ashmem FDs to processes and we are working on moving those apps away
from ashmem. The best we can do for that is make the library work, and
force apps in the long run to move away from directly using ashmem.

Due to further complications mentioned in the 'NOTE' section of the
patch, memfd is kept disabled for now, so nothing changes yet. To enable
it, set the sys.use_memfd property (check user_debug build).

Bug: 113362644
Change-Id: I491cb7841b664db5b1c26b3e07a440a14810e182
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-02-07 00:40:13 +00:00
Tom Cherry
500b6c0e86 Merge "init: allow services to have no capabilities set" 2019-02-06 23:48:36 +00:00
Mark Salyzyn
fab9f08ea5 fs_mgr: overlayfs: fs_mgr_overlay_setup true if already mounted
fs_mgr_overlayfs_setup return false second time around if all
are setup. It should report true if candidate list is all done.

Test: adb-remount-test.sh
Bug: 122602260
Change-Id: Ic9e16489e2c8ac4d3de91fcf8cfceedc23595e94
2019-02-06 15:35:45 -08:00
Mark Salyzyn
6d109ecba3 fs_mgr: overlayfs support legacy devices (marlin)
Expand the tests to deal with the boot environment for marlin.
Recognize that older overlayfs drivers do not report to /sys/module
and the parsing /proc/filesystem is another place to interrogate this.

Suppress adb push and pull noise during testing.  Resolve APEX
failures.  Add some cleanup to test script.

NB: Running test to completion is difficult because marlin's USB
    driver is flakey enough through the multitude of reboots and
    may not reconnect.  The tester will have to notice when a reboot
    is stalling and manually disconnect and reconnect the USB
    connection to trigger discovery and to continue through the
    test sequences.  To make this easier, report when we are
    waiting for the device to make it easier to babysit.

Test: system/core/fs_mgr/tests/adb-remount-test.sh
Bug: 120448575
Bug: 123079041
Change-Id: I5fc5f01b4e4788ac57541cb5235f7ac4e4284d71
2019-02-06 15:35:29 -08:00
Erick Reyes
fd79d4305a meminfo: add tools/dmabufinfo_dump to dmabufinfo
Adding tool to dump the dmabuf information using the dmabufinfo library.

Test: run "dmabuf_dump" and "dmabuf_dump <pid>" on crosshatch
Bug: 63860998

Change-Id: I16fe0a701deb5086ca0e1a8ceecb70dbc17934e6
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-02-06 15:26:05 -08:00
Erick Reyes
e3518d41d8 meminfo: Fix dmabufinfo total ref accounting
The number of references to a buffer total_refs was not accounting for
a process holding multiple references to the same buffer.

Also, clarify AppendDmaBufInfo functionality in comments

Change-Id: I044a18acad1570492a925d51b9464d5b0e60ca35
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-02-06 15:26:05 -08:00
Pirama Arumuga Nainar
425e238ee0 Make inlines static
Bug: http://b/116873221

If not, building with coverage (and -O0) is broken since Clang does not
inline these functions, and does not emit a definition because they are
not static or extern.

Test: Build with coverage (-O0)

Change-Id: I2880119834f764164a1aac10b696e76a2b462b71
2019-02-06 15:19:00 -08:00
Elliott Hughes
eb0ef145fd MappedFile and FileMap should support zero-length mappings.
Bug: http://b/119818070 "app crashes when reading asset of zero length"
Test: ran tests
Change-Id: Idd2ad6f6e72c8e445aff78a460fac96dea41c950
2019-02-06 14:29:35 -08:00
Suren Baghdasaryan
e3ad888011 libprocessgroup: Fix cgroup directory ownership setup
When cgroup directory is created its user and ownership gets set, however
because previous code was storing getpwnam() return value the second
invocation would effectively override the previous ones result. Fix this
by copying necessary results. Also change getpwnam() to getgrnam() when
group name is converted into gid. getpwnam() works because of the way
Android uses these ids, however more generally this is incorrect and
getgrnam() should be used instead.

Bug: 111307099
Test: verified user/group membership of the cgroup directories
Change-Id: I78668bc1a36a74f53d8e9825e2d06e3e09501e7a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-06 14:28:23 -08:00
Martin Stjernholm
b78f6ec7ef Add some overview docs for classloader-namespace.
Courtesy of jiyong@.

Test: n/a
Change-Id: I4ee239c63a5b5f90516b05af25b32ff22b147d53
2019-02-06 21:51:27 +00:00
Suren Baghdasaryan
c760231891 libprocessgroup: Fix file mode parsing that requires octal values
JSON supports only decimal values and therefore file mode which should
use octal values has to be represented as strings. Fix the implicit
octal-to-decimal conversion and convert from string to octal in the code.

Bug: 111307099
Test: confirmed by verifying correct file permissions

Change-Id: I3ef9de0aea259f93bf74efeffca72d37d4740e15
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-06 21:01:41 +00:00
Tom Cherry
1cd082d421 init: allow services to have no capabilities set
In particular, this allows services running as the root user to have
capabilities removed instead of always having full capabilities.

Test: boot device with a root service with an empty capabilities
      option in init showing no capabilities in /proc/<pid>/status
Change-Id: I569a5573ed4bc5fab0eb37ce9224ab708e980451
2019-02-06 11:25:18 -08:00
Treehugger Robot
bece53e515 Merge "fs_mgr: fstab: logspam from empty flags" 2019-02-06 17:59:42 +00:00
Treehugger Robot
4fdc2ce2bb Merge "apexd: Create top-level /data/apex folders at boot" 2019-02-06 16:58:23 +00:00
Greg Kaiser
54801442bd Merge "libprocessgroup: Disable file descriptor caching temporarily" 2019-02-06 13:48:03 +00:00
Nikita Ioffe
bc744dc98f apexd: Create top-level /data/apex folders at boot
- package manager needs to read from /data/apex/active, hence 0750
- both /data/apex/backups and /data/apex/sessions are internal to apexd,
  hence 0700

Bug: 123927167
Fixes: 123927167
Test: apex_e2e_tests, flashall -w & checked folders were created
Change-Id: I06c28328afe4945d082acd890401651bd37fcb20
2019-02-06 11:49:46 +00:00
Treehugger Robot
54f7e57bac Merge "init: print property/value for wait_for_property" 2019-02-06 07:28:00 +00:00
Treehugger Robot
c03169caea Merge "fs_mgr: Remove fs_mgr_flags #define's" 2019-02-06 02:53:32 +00:00
Suren Baghdasaryan
bee9f5718b libprocessgroup: Disable file descriptor caching temporarily
File descriptor caching breaks boot on Android Go and Svelte targets.
Disable it temporarily to fix the builds and investigate the root cause
further.

Bug: 123868658
Test: Android Go device boots after this change

Change-Id: Idd0209029cde8454ea99b9de030f7a317c2988d7
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-06 02:15:37 +00:00
Wei Wang
c9352bb383 init: print property/value for wait_for_property
Bug: 123772265
Bug: 123788098
Test: Build
Change-Id: Ice130d7efab1f227a2f9021136621ad08f84fd23
2019-02-06 01:03:53 +00:00