Commit graph

44067 commits

Author SHA1 Message Date
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
Ramon Pantin
c02be81efc Fixed a few minor nits in liblp
Bug: 122616553
Test: built and ran liblp_test on Pixel 3 with Q weekly build

Added missing __attribute__((packed)) in two metadata structures.
Fixed error logging message when repairing primary metadata.
Few very minor additions related to metadata validation.
Fixed an off by one error in the validation of partition name length.

Change-Id: Ic777baf97871c786a209da7c32bc13c1360a8482
Signed-off-by: Ramon Pantin <pantin@google.com>
2019-01-10 13:36:59 -08: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
David Anderson
c6c6e66813 liblp: Add helpers for modifying groups.
These are needed for non-A/B OTAs.

Bug: 122473283
Test: liblp_test gtest
Change-Id: Ib30614f1691dbea0a56c5a98aadc84fc26d1e639
2019-01-10 11:49:15 -08:00
Yifan Hong
ccdba57545 fs_mgr: overlayfs clears readonly on scratch devices
Fixes adb-remount-test and flashstation because the scratch device
was set to readonly before.

Test: adb-remount-test

Change-Id: I12551d1ed99fb7cfd04f84fcc2b77d3cb94275b2
Fixes: 122454600
Fixes: 122602260
2019-01-10 10:49:05 -08:00
Tom Cherry
2f171cc69e Merge "init: remove the restriction of arguments" 2019-01-10 18:47:53 +00:00
Tom Cherry
d1febd3316 liblog: remove LOGGER_LOCAL
No users ever signed up to use this, so remove it to ease the
refactoring of liblog/libbase.

Bug: 119867234
Test: liblog unit tests
Change-Id: I37b99644112bae7b4a2e3f4d06749db08de4ea14
2019-01-10 10:39:35 -08:00
Treehugger Robot
b9d6cef75e Merge "liblog: convert README to markdown" 2019-01-10 18:34:23 +00:00