Commit graph

2615 commits

Author SHA1 Message Date
Suren Baghdasaryan
8106c8e09f Merge changes from topic "native process registration"
* changes:
  init: Add support for native service registration with lmkd
  lmkd: Support process types when registering a process
  lmkd: Add library function to unregister a process
  lmkd: Prepare lmkd to support connection from init process
  lmkd: Restrict process record modifications to the client that created it
2019-11-08 17:25:10 +00:00
Treehugger Robot
7e5fb6b322 Merge "migrate *.libraries.txt from Make to Soong" 2019-11-08 04:04:14 +00:00
Paul Crowley
449282c021 Merge "Make encryption action an argument to mkdir" 2019-11-07 20:06:47 +00:00
Suren Baghdasaryan
c29c2baa69 init: Add support for native service registration with lmkd
init should be able to register native services with lmkd so that they
can be killed when needed. Only processes with oom_score_adjust not
equal to the default -1000 will be registered with lmkd because with the
score that low the process is unkillable anyway.
Inform lmkd when a registered process is killed so that the record can be
removed.
Change init.rc to start lmkd during init phase so that it is there to
register other services.
Replace hardcoded oom_score_adj values with appropriate definitions.

Bug: 129011369
Test: boot and verify native service registration
Change-Id: Ie5ed62203395120d86dc1c8250fae01aa0b3c511
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-11-07 18:19:31 +00:00
Nikita Ioffe
42697d3f18 Make remount into checkpointing for ext4 userdata a no-op
We are going to teamfood userspace reboot soon, and in order to gather
as much data as possible we are fine with ignoring checkpointing for the
devices with ext4 (teamfood will be a very limited set of people that
are aware what they've signed for).

As result of this, we don't need to reset vold and kill zram backing
device. Added a TODO to restore that functionality if needed.

Since I was there, fixed yet another typo in userspace-reboot-resume -_-

Bug: 135984674
Test: adb reboot userspace
Change-Id: I2b7a93aaf738fe9bec9d606d7e11aefb325550b1
2019-11-06 20:12:08 +00:00
Jooyung Han
c2b56dc10e migrate *.libraries.txt from Make to Soong
Migrating these files to soong modules and those modules are defined
under /packages/modules/vndk since they are highly coupled with vndk.

Bug: 141450808
Test: m llndk.libraries.txt
Change-Id: Id33366f604e3e6696a9be95dc50f40d143325697
2019-11-06 16:55:32 +09:00
Paul Crowley
68258e8444 Make encryption action an argument to mkdir
FscryptSetDirectoryPolicy no longer tries to infer the action from the
filename. Well mostly; it still assumes top-level directories in /data
should be encrypted unless the mkdir arguments say otherwise, but
it warns.

Bug: 26641735
Test: boot, check log messages
Change-Id: Id6d2cea7fb856f17323897d85cf6190c981b443c
2019-11-05 16:26:43 -08:00
Josh Gao
594f70ffb8 Move adbd to an apex.
Test: adb shell "su 0 readlink /proc/\`pidof adbd\`/exe"
Change-Id: I84dfe4d1b28b619f98c03a2c8eeef2c783d30af2
2019-11-04 15:52:16 -08:00
Nikita Ioffe
ac692148e5 Fix typo in userspace-reboot-requested trigger
It should userspace-reboot-requested, not userspace-reboot

Test: adb reboot userspace
Bug: 135984674
Change-Id: I1e844b7705eb70ee3702a1dc0432644592666364
2019-11-01 20:56:33 +00:00
Jooyung Han
a18363cb97 Use soong-generated vndk*libraries.txt files
linkerconfig reads vndk-related libraries.txt files. Now these files are
generated by soong.

Bug: 142963962
Bug: 141450808
Test: m && device boots && TH
Change-Id: I98c2f934815238cacd4ec8536ce2f9f24bbf1b32
2019-10-31 11:40:22 +09:00
Treehugger Robot
f77c98a780 Merge "Revert "Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list""""" 2019-10-30 04:29:37 +00:00
Jooyung Han
e5811e8967 Revert "Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list""""
This reverts commit 3cb19a74f2.

Reason for revert: Fix b/143374795

Change-Id: I21dae5ff3c9bf05ac15ac26210d7c8d7f9c46e1c
2019-10-28 21:08:04 +00:00
Greg Kaiser
b6a3d3f9d3 Merge "Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list"""" 2019-10-28 17:12:33 +00:00
Nikita Ioffe
8a603a7f9b Merge "Userspace reboot: Support remounting userdata for f2fs" 2019-10-28 16:28:23 +00:00
Jooyung Han
3cb19a74f2 Revert "Revert "Revert "Use com.android.vndk.current variant for vndk list"""
This reverts commit 74f23d7ae6.

Reason for revert: b/143374795

Change-Id: I35cb387b87d3eb2eb0963b669e359ff538c28c90
2019-10-28 05:07:46 +00:00
Xin Li
128bbfc7be Merge Coral/Flame into AOSP master
Bug: 141248619
Change-Id: I32e18ca4131b81846dca976699df8be71549e4e1
Merged-In: I6b95cf1a731c4dc09a7897f3114e2ad6595d60bb
2019-10-25 10:28:40 -07:00
Nikita Ioffe
12a36076a7 Userspace reboot: Support remounting userdata for f2fs
Test: adb reboot userspace
Test: adb shell /system/bin/vdc startCheckpoint 1;
      adb reboot userspace
Bug: 135984674
Change-Id: I227f2c1cc18495d893decb2df5173fc7a7919df6
2019-10-25 16:27:10 +01:00
Jooyung Han
74f23d7ae6 Revert "Revert "Use com.android.vndk.current variant for vndk list""
This reverts commit 08f2376d70.

Bug: 141451661
Test: m && device boot
2019-10-19 02:32:28 +09:00
Jooyung Han
5d1428b437 Merge "Revert "Use com.android.vndk.current variant for vndk list""
am: 047a7d21d9

Change-Id: Ia4d7f11d7a76c34f42cb9e7bc940f0d9a87156f9
2019-10-17 05:08:27 -07:00
Treehugger Robot
047a7d21d9 Merge "Revert "Use com.android.vndk.current variant for vndk list"" 2019-10-17 11:50:47 +00:00
Jooyung Han
08f2376d70 Revert "Use com.android.vndk.current variant for vndk list"
This reverts commit 82f94d61cb.

Reason for revert: some targets are broken

Bug: 142773030
Change-Id: Ida59c52af3d2fd694855fcee60b5bb0d99c85f8d
2019-10-16 23:47:32 +00:00
Jiyong Park
07348eb619 Merge "Don't preload libneuralnetworks.so"
am: af15eff03b

Change-Id: Idade938fe6fb696b5a59c28ea25e630043dcac9f
2019-10-15 05:49:18 -07:00
Treehugger Robot
af15eff03b Merge "Don't preload libneuralnetworks.so" 2019-10-15 12:35:47 +00:00
Jooyung Han
abe56ba48d Merge "Use com.android.vndk.current variant for vndk list"
am: 9e52397825

Change-Id: I48b450dd17f9454cf12a68c0c217ee13daaed3ca
2019-10-15 02:44:11 -07:00
Jooyung Han
9e52397825 Merge "Use com.android.vndk.current variant for vndk list" 2019-10-15 09:21:19 +00:00
Jooyung Han
82f94d61cb Use com.android.vndk.current variant for vndk list
New linkerconfig reads some txt files which list various kinds of
vndk libraries. For example, vndksp.libraries.txt file has the list of
VNDKSP type libraries. The exact file names are retrieved from .vendor
variants.

With VNDK APEX, .vendor variants are not installed but
.com.android.vndk.current variants are packaged into VNDK APEX.

This CL changes the variant type from .vendor to
.com.android.vndk.current so that *.libraries.txt files can list the
installed files correctly.

Bug: 141451661
Test: m && device boot
Change-Id: Ibbc27b1ae6a44cc2337a0b14918caa27107a4c8e
2019-10-13 22:03:50 +09:00
Nikita Ioffe
0ee759cc4c Merge "userspace reboot: stop post-data services and wait for them to be killed"
am: 4592237300

Change-Id: I0f9e4a03f883c8cf301f3f918c921e91c9612f03
2019-10-11 03:39:10 -07:00
Jiyong Park
98b1c69253 Don't preload libneuralnetworks.so
The lib isn't used by most of the apps. Don't waste memory by preloading
it to all apps.

Bug: 142482121
Test: `lsof -p $(pidof zygote64) | grep libneuralnetwork` shows nothing
Change-Id: I4a6e3df838fa3b7a46271e548e9fdc87bea948ae
2019-10-11 10:31:12 +09:00
Nikita Ioffe
3f4b0d6113 userspace reboot: stop post-data services and wait for them to be killed
* Refactored code around stopping services a little bit to reuse it
  between full reboot and userspace reboot.
* Add a scope_guard to fallback to full reboot in case userspace reboot
  fails.
* In case of userspace reboot init will also wait for services to be
  terminated/killed and log the ones that didn't react to
  SIGTERM/SIGKILL in time.
* If some of the services didn't react to SIGKILL, fail userspace reboot.

Test: adb reboot userspace
Bug: 135984674
Change-Id: I820c7bc406169333b0f929f0eea028d8384eb2ac
2019-10-10 18:13:42 +01:00
Daichi Hirono
446e8a8133 Merge "Add a link from runtime ns to the neuralnetworks ns"
am: b18dc5d287

Change-Id: If606607fd6bae18483212b35da0ec989b0e9b8c2
2019-10-09 08:26:48 -07:00
Daichi Hirono
e76c0d2816 Add a link from runtime ns to the neuralnetworks ns
libneuralnetworks.so could be preloaded. In that case, it should be
accessible from libnativeloader which runs in the art namespace.

Bug: 141847343
Bug: 142089311
Test: m, cheets2 boots
Change-Id: I8710b624dff131f5cb797d53915f6597e3017c34
2019-10-09 07:43:52 +00:00
Nikita Ioffe
5e0e30db92 Merge "Add a skeleton of userspace reboot"
am: f1933c910d

Change-Id: I099d8bf703e13dacdb9717be77a3222541f02432
2019-10-08 07:51:16 -07:00
Nikita Ioffe
f1933c910d Merge "Add a skeleton of userspace reboot" 2019-10-08 14:42:36 +00:00
Nikita Ioffe
ba6968e636 Add a skeleton of userspace reboot
This CL only draws boundaries between userspace and full reboots, and
adds some functionality that will be required for userspace reboot:

* Whenever device is shutting down is now controlled in reboot.cpp,
  since during userspace reboot this state can change.
* Now it's also possible to restart handling of control messages inside
  property service. In case of userspace reboot, init will restart it
  after stopping post-data services.
* New userspace-reboot-requested trigger is added similar to shutdown
  one for full reboot.

Test: adb reboot
Test: adb reboot userspace
Bug: 135984674
Change-Id: Id55a53ba781d2b90ce40449037b6d8d47e72c476
2019-10-08 12:16:06 +01:00
Martin Stjernholm
87041ac24a Merge "Ensure all namespaces have links to /system/lib(64) for the sanitizer libs."
am: c14b27f22d

Change-Id: I59176f2691bd4185b72390883d87afebc10aa344
2019-10-08 04:13:46 -07:00
Martin Stjernholm
c14b27f22d Merge "Ensure all namespaces have links to /system/lib(64) for the sanitizer libs." 2019-10-08 11:06:05 +00:00
Martin Stjernholm
99736dc587 Merge "Rename the runtime linker namespace following ART/Runtime APEX split."
am: b7dee5d148

Change-Id: I2f62b8c8202503447c0905efcd23ef8d74709fff
2019-10-07 20:57:17 -07:00
Treehugger Robot
b7dee5d148 Merge "Rename the runtime linker namespace following ART/Runtime APEX split." 2019-10-08 03:33:29 +00:00
Kiyoung Kim
c467e46c4d Merge "Disable to build ld.config.txt with previous vndk version"
am: 59a9cef6a0

Change-Id: Iaa2d719a5a27ecd4c13c08c922f80766d2d72e34
2019-10-07 18:20:00 -07:00
Kiyoung Kim
59a9cef6a0 Merge "Disable to build ld.config.txt with previous vndk version" 2019-10-08 00:57:41 +00:00
Martin Stjernholm
39e65d5b05 Ensure all namespaces have links to /system/lib(64) for the sanitizer libs.
This CL updates ld.config.vndk_lite.txt, which still is not handled by
linkerconfig.

Test: presubmits
Bug: 140790209
Change-Id: Ia822f86aa0b853656555ade0bed191e07c07d09d
2019-10-07 12:14:57 +01:00
Martin Stjernholm
752a1e0408 Rename the runtime linker namespace following ART/Runtime APEX split.
Remove the kludge in libnativeloader to deal with the inconsistency wrt the
name of the APEX package.

Test: Build & boot
Test: atest system/core/libnativeloader (on cf_x86_phone)
Bug: 139408016
Change-Id: I6115b49237c78c2ea4aa943ca4fe0b296b5a2b62
2019-10-07 12:14:57 +01:00
Kiyoung Kim
7f5ec44dbc Disable to build ld.config.txt with previous vndk version
As generic ld.config.txt will be covered with linker config generator,
ld.config.txt with previous vndk build is no longer required. This
change removes this part so there will be no unnecessary build step for
multiple vndk version build. Also vndk snapshot will have vndkcore and
vndkprivate files with version number, update_and_install_ld_config.mk
has been updated temporary for vndk_lite build.

Bug: 142072719
Test: m -j passed with aosp_arm64 build
Change-Id: Ia7529c80b179dc262c6e7646a34c2a05a0d9be84
2019-10-07 17:30:42 +09:00
Kiyoung Kim
d4e55ce0f7 Merge "Temporary add ld.config.txt build"
am: f2098870c1

Change-Id: I9757cc321a114856efdf95b4fbb13a6dabee2151
2019-10-06 22:56:16 -07:00
Kiyoung Kim
f2098870c1 Merge "Temporary add ld.config.txt build" 2019-10-07 05:48:03 +00:00
Jiyong Park
8da88f0262 Merge "Add a link from runtime ns to the neuralnetworks ns"
am: 71f124dc54

Change-Id: I9da2e6105d416e15ff60446cf265ad7c1900c66f
2019-10-06 21:14:49 -07:00
Kiyoung Kim
7a190055cf Merge "Deprecate ld.config.txt for fully treblelized devices"
am: e5013de9ac

Change-Id: Id4dfa710bc8736fde3a3f913c59b4dd5625013a0
2019-10-06 21:14:23 -07:00
Treehugger Robot
71f124dc54 Merge "Add a link from runtime ns to the neuralnetworks ns" 2019-10-07 03:36:14 +00:00
Kiyoung Kim
2e7b3df686 Temporary add ld.config.txt build
Last generic ld.config.txt deprecation caused build error from
build_test build because of invalid ld.config.txt build target. To fix
this ld.config.txt build target should be enabled until
ld.config.vndklite.txt and ld.config.legacy.txt also become deprecated.

Bug: 138920271
Test: m ld.config.txt passed
Test: build_test passed
Change-Id: I7f45ee66d3ed70a1a698261e1e801a30729f592f
2019-10-07 11:10:37 +09:00
Kiyoung Kim
e5013de9ac Merge "Deprecate ld.config.txt for fully treblelized devices" 2019-10-07 01:07:58 +00:00