Commit graph

43968 commits

Author SHA1 Message Date
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
Jiyong Park
2599088ff6 Bionic libs and the dynamic linker are bind mounted
This change makes the bionic libs and the dynamic linker from the
runtime APEX (com.android.runtime) available to all processes started
after apexd finishes activating APEXes.

Specifically, the device has two sets of bionic libs and the dynamic
linker: one in the system partition for pre-apexd processes and another
in the runtime APEX for post-apexd processes. The former is referred as
the 'bootstrap' bionic and are located at
/system/lib/{libc|libdl|libm}.so and /system/bin/linker. The latter is
referred as the 'runtime' bionic and are located at
/apex/com.android.runtime/lib/bionic/{libc|libdl|libm}.so and
/apex/com.android.runtime/bin/linker.

Although the two sets are located in different directories, at runtime,
they are accessed via the same path: /system/lib/* and
/system/bin/linker ... for both pre/post-apexd processes. This is done
by bind-mounting the bootstrap or the runtime bionic to the same path.
Keeping the same path is necessary because there are many modules and
apps that explicitly or implicitly depend on the fact that bionic libs
are located in /system/lib and are loaded into the default linker
namespace (which has /system/lib in its search paths).

Before the apexd is started, init executes a built-in action
'prepare_bootstrap_bionic' that bind-mounts the bootstrap bionic to the
mount points. Processes started during this time are provided with the
bootstrap bionic. Then after the apexd is finished, init executes
another built-in action 'setup_runtime_bionic' which again mounts the
runtime bionic to the same mount points, thus hiding the previous mounts
that target the bootstrap bionic. The mounting of the runtime bionic
(which is only for post-apexd processes) is hidden from pre-apexd
processes by changing propagation type of the mount points to 'private'
and execute the pre-apexd processes with a new mount namespace using
unshare(2). If a pre-apexd process crashes and re-launched after the
apexd is on, the process still gets the bootstrap bionic by unmounting
the runtime bionic which effectively un-hides the previous bind-mounts
targeting the bootstrap bionic.

Bug: 120266448
Test: device boots
Test: cat /proc/`pidof zygote`/mountinfo shows that
/system/lib/{libc|libdl|libm}.so and /system/bin/linker are from the
runtime APEX
Test: cat /proc/'pidof vold`/mountinfo shows that the same mount points
are from system partition.

Change-Id: I7ca67755dc0656c0f0c834ba94bf23ba9b1aca68
2019-01-11 15:17:04 +09:00
Treehugger Robot
d220cdc71f Merge "libpackagelistparser: export profileable_from_shell flag." 2019-01-11 05:00:27 +00:00
Bowgo Tsai
db2bc1a9df Merge "Skip building libfs_avb for darwin host" 2019-01-11 03:55:03 +00:00
Treehugger Robot
5a790d69d5 Merge "run-as: add shared app gid in supplementary groups." 2019-01-11 03:48:25 +00:00
Bowgo Tsai
1b1a1fdbb1 Skip building libfs_avb for darwin host
Bug: 112103720
Bug: 117960205
Test: build
Change-Id: If0bb8d15a62947e3af3bf02485a210715db90fdd
2019-01-11 11:41:01 +08:00
David Anderson
34ad8ca773 Merge "liblp: Add helpers for modifying groups." 2019-01-11 01:45:21 +00:00
Treehugger Robot
89e2aa94b7 Merge "Add conditional class starting" 2019-01-11 00:58:18 +00:00
Yabin Cui
b9fcfc8b98 libpackagelistparser: export profileable_from_shell flag.
Bug: 118835348
Test: test manually on apps that the flag is set properly.
Change-Id: Idd86dca6c7d767be985bb27f4dd3116d79029868
2019-01-10 16:24:20 -08:00
Treehugger Robot
fce33ca0bf Merge "libfs_avb: Switch to range-for for GetHashtreeDescriptor" 2019-01-11 00:14:52 +00:00
Treehugger Robot
29bc428f28 Merge "libfs_avb: refactoring" 2019-01-11 00:14:15 +00:00
Treehugger Robot
333ab452f7 Merge "llkd: do not call sync()" 2019-01-10 23:36:42 +00:00
Tom Cherry
82b8e518e3 Merge "Support mounting same mount points with different fstab config" 2019-01-10 23:36:16 +00:00
Yabin Cui
3a60e68b72 run-as: add shared app gid in supplementary groups.
This is to read profile guide compiled oat files of debuggable apps, which is
needed by simpleperf for profiling.

Bug: none
Test: run run-as manually.
Change-Id: I8ec8897b882be650f02124413c7d20ed8b1b444b
2019-01-10 15:08:22 -08:00
Tom Cherry
37b5edf61b Merge "liblog: remove LOGGER_LOCAL" 2019-01-10 22:46:30 +00:00
Treehugger Robot
d9e73a009b Merge "Libbase: NOLINT legacy unique_fd operator int" 2019-01-10 21:22:55 +00:00
Treehugger Robot
3c1cdaf54d Merge changes from topic "fsmgr_system_other"
* changes:
  fs_mgr: overlayfs clears readonly on scratch devices
  liblp: BLKROSET 0 prior to FlashPartitionTable
  fs_mgr: system_other does not want overlayfs.
2019-01-10 21:11:20 +00:00
Mark Salyzyn
16649d22ca llkd: do not call sync()
sync() will never return if the io subsystem is locked up, drop it.

Test: llkd_unit_test
Bug: 122263600
Change-Id: Ib378124415ce94da987d73391b027dc10317dbe9
2019-01-10 12:52:35 -08:00