Commit graph

43933 commits

Author SHA1 Message Date
Mark Salyzyn
49398d3444 Merge "fs_mgr: overlayfs: test fix problems with runtime apex bind mounts" 2019-01-15 21:29:57 +00:00
Tom Cherry
bbf2a0d797 liblog: statically link tests
Some liblog tests test symbols that aren't otherwise used on the
platform.  Statically link the tests such that we can add version
scripts that expose only the symbols used by the platform, and still
allow the tests to test the rest.

Test: build + unit tests
Change-Id: I898280fa52d31a2c7ad4eafdaa85e8b5f2e87971
2019-01-15 13:12:44 -08:00
Treehugger Robot
4fc83b1885 Merge "Load build sysprops early" 2019-01-15 20:28:38 +00:00
Mark Salyzyn
7d6431d852 fs_mgr: overlayfs: test fix problems with runtime apex bind mounts
bind mounts create administrivia in /proc/mounts that can not be
easily discerned to confirm expectations.  We squash the stutter,
and filter out overlay backing references for /system/<path>/<file>.

Test: adb-remount-test.sh
Bug: 122737045
Change-Id: I61342f5f76f54a1a8201a52efb8054acde100a6f
2019-01-15 11:42:03 -08:00
dimitry
8c934c72a0 Fix sdk-mac build.
Do not use version_script for darwin

Bug: http://b/122886514
Test: make
Change-Id: I8a860e67b0768cce387de1257147e8989f711f06
2019-01-15 17:39:32 +01:00
Gary Bisson
8cbf6bb535 toolbox: getevent: disable stdout buffering
So that the getevent output can be redirected and still be responsive
when events occur.

A good example is when using 'adb shell getevent' command, this latter
would only display the events when the buffer is full. With this patch
as soon as an event is received/printed, it is flushed to stdout.

Change-Id: I77eee96ed1aa59bf8d82f17eab666976ce966def
Signed-off-by: Gary Bisson <gbisson@essential.com>
2019-01-15 16:42:59 +01:00
Treehugger Robot
0ae6d74436 Merge "Actually apply version script to libnativebridge" 2019-01-15 15:13:22 +00:00
Jiyong Park
3b316ee201 Load build sysprops early
*/build.prop files are now loaded much earlier than before; from 'on
post-fs' to the time when the property service is started which is
before init starts the action loop.

This ensures that all processes that are launched by init have a
consistent view of system properties. Previously, the processes that
started before 'on post-fs' were initially with the small number of
sysprops loaded from */default.prop and then suddenly get additional
sysprops from */build.prop while they are executing.

Bug: 122714998
Test: device boots

Change-Id: Ic07528421dfbe8d4f43673cea41175d33cfbf298
2019-01-15 22:40:49 +09:00
dimitry
b1197e9bf7 Actually apply version script to libnativebridge
This way the list of exported symbols will be limited by symbols
that need to be exported.

Test: make
Change-Id: Iffc8e0b3b589e78f5d213f75971a54b473760c94
2019-01-15 14:34:29 +01:00
Zimuzo Ezeozue
91fa140312 Merge "Identify post-apexd crashing processes" 2019-01-15 10:05:41 +00:00
Sandeep Patil
3fcb44b908 procmeminfo: use getline() instead of fgets() everywhere
Bug: 111694435
Test: libmeminfo_test 1 --gtest_filter=TestProcMemInfo.*

Change-Id: Idfc797aa65f45e0152765605c14622e2110dfdc1
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-14 18:11:53 -08:00
Sandeep Patil
d03244ab89 meminfo: test: delete SmapsOrRollupReturn test
The test has become invalid due to addition of IsSmapsRollupSupported()
and its internal usage by SmapsOrRollup() method. The method now returns
success and returns statistics even if 'smaps_rollup' doesn't exist. It
does that by internally checking for it's existence and falls back to
using /proc/<pid>/smaps

Bug: 111694435
Test: mma -j

Change-Id: I1983a23f1f617aee126bc66a4c1fbd4abb50f565
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-14 18:11:29 -08:00
David Anderson
42c32bf9af init: Allow first-stage mounts in the second stage if they're formattable.
If /metadata is wiped, but is specified as a first-stage mount, it'll
fail to mount and then skipped as a mount in the second stage. Rather
than add a new flag, this patch piggy-backs on "formattable" since
otherwise there is no way the file system will be formatted.

Bug: 121209697
Test: flashall -w && reboot
Change-Id: If36a12251f398a99b9423713a8bfbe8c33523b66
2019-01-14 17:36:02 -08:00
Treehugger Robot
a0ca0191d6 Merge "Add eaeltsin to OWNERS" 2019-01-14 23:25:37 +00:00
Sandeep Patil
e16c2ce649 Merge changes from topic "meminfo-apis"
* changes:
  meminfo: Add IsSmapsRollupSupported Api
  meminfo: Add SmapsOrRollupPss
  meminfo: Remove unnecessary working set stats
  meminfo: Fix ProcMemInfo ForEachVmaFromFile
2019-01-14 23:16:00 +00:00
Mark Salyzyn
365b43b933 Merge "adb remount documentation error" 2019-01-14 22:40:28 +00:00
Mark Salyzyn
71df3ca70f adb remount documentation error
It is not adb reboot -R, it is adb remount -R

Bug: 122602260
Test: view file in gitties
Change-Id: I7c419b0b7f98cc0f5bb69284f5998515e9b8408e
2019-01-14 13:25:01 -08:00
Steven Moreland
ebae0d3ad9 Merge "Init: error on oneway calls." 2019-01-14 20:50:12 +00:00
Bo Hu
400c71fccd Merge "disable darwin build for libfstab" 2019-01-14 19:04:39 +00:00
Sandeep Patil
dfd34be42b meminfo: Add IsSmapsRollupSupported Api
Consolidate the checking of /proc/<pid>/smaps_rollup support
in libmeminfo and do it in a thread safe way.

Use the API in ProcMemInfo as well to eliminate the extra
parameters passed to SmapsOrRollup* methods.

Bug: 111694435
Test: libmeminfo_test 1 --gtest_filter=TestProcMemInfo.IsSmapsSupportedTest
Test: Tested with and without the smaps_rollup support in kernel.

Change-Id: I992057f06b54569025fa0cdade9618da2675d1de
Merged-In: I992057f06b54569025fa0cdade9618da2675d1de
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-14 09:43:32 -08:00
Sandeep Patil
8871e7e90f meminfo: Add SmapsOrRollupPss
Adds SmapsOrRollup parsing methods to only read Pss of the
process fomr /proc/<pid>/{smaps, smaps_rollup}.

Bug: 111694435
Test: libmeminfo_test 1 --gtest_filter=TestProcMemInfo.*

Change-Id: I31b982ae5ff2bb5b165ea33f6c57755ee34cbbc7
Merged-In: I31b982ae5ff2bb5b165ea33f6c57755ee34cbbc7
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-14 09:43:12 -08:00
Sandeep Patil
56c414e872 meminfo: Remove unnecessary working set stats
The Vma and ProcMemInfo objects do not need separate stats
objects for storing working set. The Vma either has working set
or memory usage information and never both.

Bug: 111694435
Test: libmeminfo_test 1

Change-Id: I2df05f7e750bbba4325474633e705d6d68dd2ccb
Merged-In: I2df05f7e750bbba4325474633e705d6d68dd2ccb
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-14 09:42:50 -08:00
Sandeep Patil
002f02ea49 meminfo: Fix ProcMemInfo ForEachVmaFromFile
Caused by passing invalid parameters to getline(3) and the test
failure went unnoticed.

Bug: 111694435
Test: libmeminfo_test 1 --gtest_filter=TestProcMemInfo.ForEachVmaFromFileTest
Change-Id: Ideb39604c58f89237b05d2f7c8edb67c5ae65768
Merged-In: Ideb39604c58f89237b05d2f7c8edb67c5ae65768
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-14 09:42:17 -08:00
Thierry Strudel
5424cade40 Merge "healthd.h: add ignorePowerSupplyNames to healthd_config" 2019-01-14 17:14:10 +00:00
Elliott Hughes
965294bc47 Merge "Initial "janitors" owner group." 2019-01-14 17:04:29 +00:00
Nicolas Geoffray
dea312bf14 Merge "Move the template out of extern "C"." 2019-01-14 16:29:43 +00:00
Zimuzo
c661b660fe Identify post-apexd crashing processes
I7d47ea1223f7792a834981c729694242ab3f28c9 tried to identify processes that crash
after apexd is ready by introducing an 'updatable' class. However, after
I7ca67755dc0656c0f0c834ba94bf23ba9b1aca68 we now have a pre_apexd_ field we can
reuse instead of introducing a new class type.

Bug: 120598832
Test: Killing a !pre_apexd_ process 4 times in 4mins sets the
ro.init.updatable.crashing prop while killing a pre_apexd_ process reboots
into the bootloader

Change-Id: Icb9f405b9b54d11546bbf6d3bc28212936a78b0e
2019-01-14 16:22:10 +00:00
Nicolas Geoffray
e7de61676c Move the template out of extern "C".
Fixes mac build

Test: rely on post-submit
Change-Id: I3a6e7fe7d81cd0dfa46e4ded5a543c4cb8c6ca64
2019-01-14 14:12:37 +00:00
Nicolas Geoffray
9e03e1d2dc Merge "Use cc_test, not art_cc_test." 2019-01-14 13:42:50 +00:00
Nicolas Geoffray
b6b910bbea Use cc_test, not art_cc_test.
This was a copy/paste mistake.

Test: build aosp-build-tools
Change-Id: I9f433644a54d06cb796c7432df6577eec885f95f
2019-01-14 13:40:16 +00:00
dimitry
445e09e033 Add eaeltsin to OWNERS
Test: n/a
Change-Id: I74b181f8aca536580b42e7c34f0473aef712dd0e
2019-01-14 14:10:04 +01:00
Nicolas Geoffray
108ab211fe Merge "Make the native bridge API a C API." 2019-01-14 13:00:24 +00:00
Nicolas Geoffray
d9b4d9b16a Make the native bridge API a C API.
In order to move the library into the runtime APEX.

Test: m and boot
Bug: 119840313
Bug: 122710865
Change-Id: I4aac5954d2fb5f9e3ba92e486d69f1e76614df92
2019-01-14 09:13:30 +00:00
Treehugger Robot
e5f61a9bcd Merge "Admit that there's more adb install help available." 2019-01-12 06:21:31 +00:00
Thierry Strudel
f73de6f037 healthd.h: add ignorePowerSupplyNames to healthd_config
In case some power supply paths should not be considered, add a black list
to the healthd_config to instruct BatteryMonitor of the power supply paths
to ignore on init.

Bug: 117903348
Change-Id: I6f9ddeff9351ad01772b43728ddc2627da81df2a
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2019-01-11 18:08:23 -08:00
Treehugger Robot
1c4ad71dff Merge "Remove dependency on libdexfile internal header." 2019-01-12 00:33:41 +00:00
Elliott Hughes
3a46ae3c77 Initial "janitors" owner group.
This will let us clean up a lot of external/*/OWNERS files by
indirecting them through here.

Test: N/A
Change-Id: Ieda353b78deeb94baeab6306b6a734b63484d351
2019-01-11 16:33:25 -08:00
Treehugger Robot
a89bd8b721 Merge "Adds atomic install support to adb" 2019-01-12 00:12:07 +00:00
Steven Moreland
dc1f24777a Init: error on oneway calls.
Before, this process had no threadpool, so it could make blocking
calls, but if it did, they would block forever. Now when this
happens, an error is logged so that we can easily see this happen.

Bug: 36424585
Test: boot
Change-Id: I7d2fa12b6d5a243bdde13ce4d974a444133749f7
2019-01-11 14:41:34 -08:00
bohu
91c4bd75c8 disable darwin build for libfstab
It broke mac sdk build

Change-Id: I5435cea7747d36c2ea46ed2e6c1c51bb032c6585
2019-01-11 14:26:56 -08:00
Josh Gao
61f872f2a8 adb: switch install to unique_fd.
Test: mma
Change-Id: I9474c003e0eb4a8cb183090a2e525d78932d3bea
2019-01-11 13:57:36 -08:00
Elliott Hughes
0d4bf80968 Admit that there's more adb install help available.
Test: adb --help
Change-Id: I1e4d4250ef8bc55cfa660f87ebdbd7d664509266
2019-01-11 13:50:05 -08:00
Martin Stjernholm
2677b802bf Remove dependency on libdexfile internal header.
Also remove some tests for implementation details in the libdexfile API that
are now covered by unit tests there (http://r.android.com/867370).

Test: mmma system/core/{libunwindstack,libbacktrace} and run host gtests
Bug: 119632407
Change-Id: Ie731bb929a564de56ce1c78385da12a43d0954ff
2019-01-11 21:05:50 +00:00
Sudheer Shanka
987e732fe8 Create new mount directory /mnt/runtime/full.
This will be used for system internals to access
secondary volumes without having to bypass sdcardfs.

Bug: 121277410
Test: manual
Change-Id: I6546fa8df419157b3c2adcf5ff3faa4db4458cff
2019-01-11 11:32:34 -08:00
Mark Salyzyn
6a56a2a94f fs_mgr: avb check avb_slot_data
Damaged avb metadata can result in avb_slot_verify returning a
nullptr in avb_slot_data.  Instead of an illegal access
violation in first_stage_init, we return the verify_result so
that it can be acted upon.

Test: confirm happenstance damaged vbmeta does not crash init.
Change-Id: I15be5bd32760bcc3418c5d8a943b016c0ddd56bc
2019-01-11 10:19:29 -08:00
Patrick Baumann
dc58b0a388 Adds atomic install support to adb
This change adds an install-atomic command to adb that is shorthand for
creating an atomic install session and an individual session for each
APK supplied to the command.

Bug: 109941548
Test: run command with multiple APKs, observe atomic install
Change-Id: I2817a1ed2d312925d9c7bd621e6c82670a6275fd
2019-01-11 18:13:36 +00:00
Treehugger Robot
d75913a371 Merge changes from topic "move_bionic_to_apex"
* changes:
  Don't create separate mount namespaces for pre-apexd processes
  Bionic libs are located at /system/lib
  Bionic libs and the dynamic linker are bind mounted
2019-01-11 16:59:15 +00:00
Martin Stjernholm
810c57d610 Merge "Some minor updates in the libdexfile external API." 2019-01-11 10:28:03 +00:00
Jiyong Park
5ab1300481 Don't create separate mount namespaces for pre-apexd processes
It is causing problem to the sdcardfs. Specifically, re-mounting events
for /mnt/runtime/{runtime|write} done by the vold process (which is a
pre-apexd process) are not being propagated to other mount namespaces.
As a result, SDCard access isn't working.

The propagation problem is a bug in sdcardfs which is fixed by [1].
However, we can't make all Android devices to have the patch at the same
time. Therefore, by default the separate mount namespace is not created
and will be created only for the devices where the kernel patches are in and
ro.apex.bionic_updatable sysprop is set to true.

[1]
d73d07673edbdbe78e1a7d00e7827ba9bfd86a59 ("ANDROID: mnt: Fix next_descendent")
b5858221c1c4f4bdc9ef67eb75ecf22580368820 ("ANDROID: mnt: remount should propagate to slaves of slaves")

Bug: 122559956
Test: m
Test: device boots
Test: sdcard works (e.g. camera can take pictures)
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Change-Id: I7a309bab46356ee5782f34c5963d1760963c0b14
2019-01-11 15:17:04 +09:00
Jiyong Park
3fa8415b37 Bionic libs are located at /system/lib
Bionic libs, regardless of whether they are bootstrap ones or from the
runtime APEX, are available via /system/lib. Since /system/lib is in the
search paths of the default(platform) namespace, there is no need to
list the bionic libs to the namespace link to the runtime namespace.

Bug: 120266448
Test: m; device boots
Test: atest CtsJniTestCases CtsCompilationTestCases CtsBionicTestCases
all passing except for following tests that are also failing at ToT
dl#exec_linker
dl#exec_linker_load_from_zip
dl#exec_linker_load_self
dl#exec_linker_load_file

Change-Id: Ib67acd4f384b2f0e70b5fe8ec6b45a5506367223
2019-01-11 15:17:04 +09:00