Commit graph

91 commits

Author SHA1 Message Date
Yifan Hong
7f9ba18e25 Merge "BOARD_USES_PRODUCT_SERVICES_IMAGE => BOARD_USES_PRODUCT_SERVICESIMAGE"
am: d5f825c78b

Change-Id: Ica5d41ee4832b3da6420b730d20b91057d2452e4
2018-07-30 09:26:44 -07:00
Yifan Hong
bcdfe0d795 BOARD_USES_PRODUCT_SERVICES_IMAGE => BOARD_USES_PRODUCT_SERVICESIMAGE
This is the name used by envsetup.sh.

Test: `m init.environ.rc` and see directory
$OUT/root/product-services and see symlink $OUT/system/product-services

Change-Id: Ie615b6d76e2c60e6472900c33d9a87cfe99c4064
2018-07-27 11:14:43 -07:00
Dario Freni
3613710099 Add support for /product-services partition.
This CL is largely and adaptation of
Ie996def20e25dc1afe0c74af2096af844934b2dc

Bug: 80741439
Test: Successfully built product-services.img with one module in it, and
flashed on device. Also successfully built image with
/system/product-services and no dedicated /product-services partition.

Change-Id: I1046dfe19bf874da929c9131b76a1f85422fbb80
Merged-In: I1046dfe19bf874da929c9131b76a1f85422fbb80
2018-07-26 16:27:28 +00:00
Dario Freni
4fa866a467 Add support for /product-services partition.
This CL is largely and adaptation of
Ie996def20e25dc1afe0c74af2096af844934b2dc

Bug: 80741439
Test: Successfully built product-services.img with one module in it, and
flashed on device. Also successfully built image with
/system/product-services and no dedicated /product-services partition.
Change-Id: I1046dfe19bf874da929c9131b76a1f85422fbb80
2018-07-23 16:14:36 +01:00
Doheon Lee
ac7756307f Merge "Determine product partition path on build time"
am: 2bf8328c54

Change-Id: I773864c5dcf6adbea8e1947b969de69d25454521
2018-06-19 14:49:21 -07:00
Doheon Lee
cccad0bf84 Determine product partition path on build time
Path of product partitoin can be set as /product or /system/product
whether generate extra product partition or not.
Substitute %PRODUCT% to relevant path to know linker which path should
search and permit.

Bug: 110286945
Test: m -j # Check /system/etc/ld.config.$(PLATFORM_VNDK_VERSION).txt
Change-Id: I6ca177d0c9c5af00ad821879fece40848331fc8d
2018-06-19 08:10:14 +00:00
Jiyong Park
4ebda908de Shared libs are supported in recovery mode
am: 011ee12b1d

Change-Id: I867dbafecf11215b82d952c532774cdf12c6e782
2018-06-13 16:43:09 -07:00
Jiyong Park
011ee12b1d Shared libs are supported in recovery mode
adbd has been built as a static executable since the same binary was
copied to the recovery partition where shared library is not supported.
However, since we now support shared library in the recovery partition,
adbd is built as a dynamic executable.

In addition, the dependency from adbd to libdebuggerd_handler is removed
as debuggerd is handled by the dynamic linker.

A few more modules in /system/core are marked as recovery_available:
true as they are transitive dependencies of the dynamic linker.

This change also includes ld.config.recovery.txt which is the linker
config file for the recovery mode. It is installed to /etc/ld.config.txt
and contains linker namespace config for the dynamic binaries under
/sbin.

Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: Select 'mount /system' in the recovery mode, then `adb shell`.
$ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
the /lib directory.

Change-Id: I363d5a787863f1677ee40afb5d5841321ddaae77
2018-06-10 08:32:24 +09:00
Paul Crowley
fe305ab286 Add option to create metadata mount point
Test: booted metadata-encrypted device
Bug: 79781913
Change-Id: Ie922db20314c04409c98700bfb1aff3d111275f0
2018-05-18 14:10:56 -07:00
Logan Chien
5a35d12e62 Always use versioned VNDK directory
Bug: 78605339
Test: sailfish-userdebug builds and boots
Test: sailfish boots with GSI
Change-Id: I7da5845b5c1caed3b73d7665f1db672f2764c2a8
(cherry picked from commit 6a145749be)
2018-05-17 14:29:44 +08:00
Logan Chien
6a145749be Always use versioned VNDK directory
Bug: 78605339
Test: sailfish-userdebug builds and boots
Test: sailfish boots with GSI
Change-Id: I7da5845b5c1caed3b73d7665f1db672f2764c2a8
2018-05-16 11:34:05 +08:00
Bowgo Tsai
ca8b2c6995 Adding /odm support
Treble system-as-root GSI needs to work on devices with and without /odm
partition. This change creates the following symlinks for devices without
/odm partition:

  /odm/app ->/vendor/odm/app
  /odm/bin ->/vendor/odm/bin
  /odm/etc ->/vendor/odm/etc
  /odm/firmware ->/vendor/odm/firmware
  /odm/framework ->/vendor/odm/framework
  /odm/lib -> /vendor/odm/lib
  /odm/lib64 -> /vendor/odm/lib64
  /odm/overlay -> /vendor/odm/overlay
  /odm/priv-app -> /vendor/odm/priv-app

For devices with odm partition, /odm will be used as the mount point and
those symlinks will be hidden after mount.

Bug: 70678783
Test: boot a A/B device without /odm partition, checks those symlinks exist
Test: boot a A/B device with /odm partition, checks those symlinks don't exist
Change-Id: I4d960b52e2754f461188f3ab562c751f502046ea
(cherry picked from commit 00749affc4)
2018-03-13 08:41:50 +08:00
Bowgo Tsai
00749affc4 Adding /odm support
Treble system-as-root GSI needs to work on devices with and without /odm
partition. This change creates the following symlinks for devices without
/odm partition:

  /odm/app ->/vendor/odm/app
  /odm/bin ->/vendor/odm/bin
  /odm/etc ->/vendor/odm/etc
  /odm/firmware ->/vendor/odm/firmware
  /odm/framework ->/vendor/odm/framework
  /odm/lib -> /vendor/odm/lib
  /odm/lib64 -> /vendor/odm/lib64
  /odm/overlay -> /vendor/odm/overlay
  /odm/priv-app -> /vendor/odm/priv-app

For devices with odm partition, /odm will be used as the mount point and
those symlinks will be hidden after mount.

Bug: 70678783
Test: boot a A/B device without /odm partition, checks those symlinks exist
Test: boot a A/B device with /odm partition, checks those symlinks don't exist
Change-Id: I4d960b52e2754f461188f3ab562c751f502046ea
2018-03-09 17:34:29 +08:00
Justin Yun
8065a608a6 Move libz to llndk from vndk-sp for non-VNDK-enforced devices.
For non-VNDK-enforced devices, libz cannot be installed in vndk-sp
to avoid CTS test failure.
Move libz to llndk from vndk-sp for generating the namespace
configuration from ld.config.vndk_lite.txt.

Bug: 73296261
Test: run android.jni.cts test on marlin/sailfish
Change-Id: I1b8b43cd87dc8dfdd2667001ae1e50d9eaedf93d
2018-02-14 16:11:14 +09:00
Justin Yun
27bdc37fac Rename namespace configuration source files.
For strict VNDK runtime restriction, use ld.config.txt as a source
file. For treblized devices without BOARD_VNDK_VERSION, use
ld.config.vndk_lite.txt file.

Test: Build and boot on Pixel 2017 and 2018 devices.
Change-Id: Ie5b77facd4c11bc73219ecf13ad1298ac5d60d8e
2018-02-08 08:46:59 +09:00
Justin Yun
8a9a8eeb85 Use actual VNDK list for non-VNDK-enforcing devices
Rename ld.config.txt.in to ld.config.vndk.txt and
ld.config.txt to ld.config.vndk_light.txt.

For FULL_TREBLE devices without BOARD_VNDK_VERSION, update the VNDK
library list in ld.config.vndk_light.txt with the actual VNDK list.

Bug: 69526027
Test: Build marlin/sailfish and check boot
Change-Id: Idbb0cc97d11037c1493d4739e84961297ce51dbd
Merged-In: Idbb0cc97d11037c1493d4739e84961297ce51dbd
2018-02-08 08:33:15 +09:00
Jaekyun Seok
dff165d3a2 Support /product partition
This CL will enable reading /product/build.prop and add product paths
into ld.config.txt.in.

Bug: 64195575
Test: tested with 'PRODUCT_PRODUCT_PROPERTIES := ro.product.abc=abc' on
sailfish

Change-Id: Ie996def20e25dc1afe0c74af2096af844934b2dc
2018-01-25 09:37:20 +09:00
Justin Yun
cbbf195e46 Add VNDK version suffix in ld.config.txt on build time.
As we use different ld.config.txt per version, we don't need to
substitute the VNDK_VER on run time.
Remove all ${VNDK_VER} from the linker namespace configuration files.

Bug: 70603313
Test: build and boot GSI for walleye and sailfish
Change-Id: Ief8aee5c3308b2462cafaffc2423deda4e51a7bb
2018-01-17 12:14:25 +09:00
Justin Yun
dd16301bab Do not append VNDK version if VNDK is not used
If BOARD_VNDK_VERSION is not defined, ro.vndk.version will not be
set. In this case, the device, is not able to use versioned
configuration files.
Check BOARD_VNDK_VERSION to append the VNDK version to the namespace
configuration files.

Bug: 71730104
Test: Check boot on both 2016 and 2017 Pixel devices.
Change-Id: I1df27c75de42a526768a156387f22a934cda6d72
2018-01-11 08:29:54 +09:00
Steve Muckle
1a3e3065fb rootdir: make sure the /odm mountpoint is always available
The odm partition will eventually be required. Prepare for this by
creating its mount point.

Bug: 37322799
Test: run cts-dev -m CtsPermissionTestCases
Change-Id: Ibd031b68dd7328c853ded401bb2690dbd6675141
2018-01-04 08:45:20 -08:00
Justin Yun
210ff9485d Add VNDK version for namespace configuration files
If PLATFORM_VNDK_VERSION is set to a version other than "current",
add the version to the file names of the namespace configuration
files.

Bug: 69883025
Test: device boot
Change-Id: I27377549581125b6c750c1422d0ee4a607dda5e8
2017-12-13 10:31:04 +09:00
Jiyong Park
b52ff3e247 Use normalize-path-list
Let's use the existing macro.

Test: build walleye, boots to the UI.
Change-Id: Ic23d3454c629a02bfd96d0ca19c0c5c068ae7a03
2017-12-12 12:13:38 +09:00
Andreas Gampe
27b8fcdfcf ASAN: Remove old list of services
Remove list of services and support for asan.options. This has not
been used in a while, and there is contention about listing names
of device-specific services.

Bug: 70387666
Test: m
Change-Id: I766c6b3a0c44b6b992a3259a3c4215a688452907
2017-12-11 11:36:17 -08:00
Treehugger Robot
b07cc5e0c0 Merge changes I3978cbe2,I7b8e1232
* changes:
  Reland "Prevent vendors from accessing private VNDK libs"
  Permitted and search path change
2017-12-08 00:50:34 +00:00
Elliott Hughes
dcc0f8f76b Merge "Add a /bin symlink for convenience." 2017-12-07 16:55:25 +00:00
Jiyong Park
ad7ddd5a02 Reland "Prevent vendors from accessing private VNDK libs"
This reverts commit 875fe42a81.

... and fixes a bug that private VNDK libs are not accessible even to
RenderScript framework libraries (such as libRS_internal.so). This is
fixed by exceptionally allowing the private libs only to 'rs'
namespace.

Bug: 70260989
Bug: 70279973
Bug: 63878960
Test: Build for walleye and tested Photos edit.
Test: other renderscript app (camerascript) works as well
Merged-In: I3978cbe2e869f6a1c214c755ded038349bde7b6b
Change-Id: I3978cbe2e869f6a1c214c755ded038349bde7b6b
(cherry picked from commit 781c47f4da)
2017-12-07 13:44:46 +09:00
Jiyong Park
74857cccd2 Remove *.dep files for ld.config.txt, [llndk|vndksp].libraries.txt
The dep files are not required because change in the command line
triggers the rule.

Test: m -j ld.config.txt llndk.libraries.txt vndksp.libraries.txt
Re-run the build after adding or removing libs to/from the vndk set.
The txt files are updated accordingly.

Merged-In: I9c9e22088cc2afeb66e8b159f611b25d698cf800
Change-Id: I9c9e22088cc2afeb66e8b159f611b25d698cf800
(cherry picked from commit 81088bf131)
2017-12-07 03:06:52 +00:00
Elliott Hughes
ff1ef9f2b1 Add a /bin symlink for convenience.
We already have /etc and /sbin. As the Android world moves towards / being
on the system partition, the circumstances under which a /bin symlink
won't work are reduced. This should already be usable most of the time.

Bug: http://b/63142920
Test: `adb shell /bin/date`
Change-Id: I81c2209ae808ced186d05fbe1d5417ce8dd93ea7
2017-12-06 08:59:02 -08:00
Jiyong Park
e04e4e7dfe add llndk|vndksp.libraries.txt to vndk_package
List of llndk and vndk-sp libraries are written in the txt file so that
they can be available at run-time. The information is used by
libnativeloader to configure the classloader-namespace specially for
vendor apks.

Bug: 64882323
Test: build 2017 pixel devices. check that the two files exist on
/system/etc.

Merged-In: Ifbe339a5862f6ef57a8213a14a022765ccf77283
Change-Id: Ifbe339a5862f6ef57a8213a14a022765ccf77283
(cherry picked from commit 26335f89b1)
2017-11-28 01:29:30 +00:00
Steven Moreland
4e641e3b6a PRODUCT_TREBLE_LINKER_NAMESPACES for ld.config.txt
PRODUCT_FULL_TREBLE is being deprecated in favor
of smaller flags. Use the appropriate one instead.

Bug: 62019611
Test: manual
Change-Id: Id5d127c29f908cd3011031b3b698ddec3dcba9c1
2017-11-10 10:25:45 -08:00
Josh Gao
18ea0978cf Delete obsolete debuggerd references.
Test: treehugger
Change-Id: Ic1a8cfb867decd76443fdc26333f2bcaa98b61bb
2017-10-27 16:12:49 -07:00
Jae Shin
a909e5e2a1 Merge changes from topic "rs_vndk_step2"
am: 678efa25a6

Change-Id: Idcab36c112406e3dc1fe4eb9cfd5c345cafc0290
2017-10-23 03:03:05 +00:00
Jiyong Park
324f3ed393 templatize ld.config.txt
am: ecc703c792

Change-Id: Ic9dc2f35a4a9a2c2a56cb24a9ac02e9373ed78df
2017-10-23 03:02:31 +00:00
Justin Yun
c82e43034b Implement system namespace for vendor process
am: 333845c710

Change-Id: I0fda3fe689832b0b5cc13a381dacdd633886e27a
2017-10-23 03:00:13 +00:00
Jiyong Park
6d9f5e4012 Use the legacy linker namespace configs when target is sanitized
am: 614c5521a3

Change-Id: I80ff3cb047a9ad351590524a5602cdc0f9df3e61
2017-10-23 02:59:15 +00:00
Jiyong Park
257de3def5 fix: boot fails on ASAN builds with VNDK restriction
Fix the bug that caused boot failure on ASAN builds with VNDK
restriciton. The major cause is because incorrect (old) ld.config.txt
was used when the build is sanitized, which prevented the dynamic linker
to find some VNDK libs that only exist in /system/lib/vndk; the old
ld.config.txt does not have the directory in its search paths. So, this
CL fixes the problem by having the same ld.config.txt for both sanitized
and non-sanitizied builds.

Furthermore, ld.config.txt is modified so that dependency to
libclang_rt* libs are redirected to those in /system/lib directory. This
ensures that the sanitizer runtime libs are not dual loaded but are
provided for both platform and vendors.

Bug: 65217017
Test: SANITIZE_TARGET=integer_overflow SANITIZE_TARGET_DIAG=integer_overflow m
on 2017 pixel devices. The build is successful and the device boots to
the UI.

Merged-In: I0e21e20d9aca340b984968e07d4ce542ae10fd31
Change-Id: I0e21e20d9aca340b984968e07d4ce542ae10fd31
(cherry picked from commit faefa6bd36)
2017-10-23 02:42:47 +00:00
Jiyong Park
ecc703c792 templatize ld.config.txt
Lists of libraries in between the linker namespaces are no longer
hard-coded in ld.config.txt, but instead come from Soong.

Bug: 37139976
Test: build 2017 pixel device with BOARD_VNDK_VERSION=current m -j
Test: the device is bootable, basic functionalities (camera, camcorder,
wifi, bt, gps, etc.) work.
Merged-In: I8170e6c3f6ee04b16359791d64cc46bd2714a073
Change-Id: I8170e6c3f6ee04b16359791d64cc46bd2714a073

(cherry picked from commit 367984602a)
2017-10-23 02:40:37 +00:00
Justin Yun
333845c710 Implement system namespace for vendor process
For vendor process default namespace searches as following order:
1. /vendor/lib/(hw|egl), /vendor/lib: Vendor libs + VNDK-vnd-ext
2. /system/lib/vndk-$(ver): VNDK libs
3. /vendor/lib/vndk-sp-$(ver): VNDK-SP-vnd-ext
4. /system/lib/vndk-sp-$(ver): VNDK-SP
and searches system namespace (/system/lib) only for LL-NDK libs.
This configuarion is used only with BOARD_VNDK_VERSION is defined.

Bug: 37192038
Test: build with 'BOARD_VNDK_VERSION=current' and boot

Merged-In: If9778b9266a084846ba8fe73e6bff25828359d33
Change-Id: If9778b9266a084846ba8fe73e6bff25828359d33
(cherry picked from commit 24c29f1be4)
2017-10-23 11:10:30 +09:00
Jiyong Park
614c5521a3 Use the legacy linker namespace configs when target is sanitized
The new linker namespace config causes problem when the target is
sanitized: vendor libs which are loaded in the sphal namespace can't
link against to libclang_rt* libs which are in /system/lib directory
because the directory is not allowed for sphal namsapce.

Long-term solution would be installing libclang_rt* to both /system/lib
and /vendor/lib so that vendor libs can link against to the one in
/vendor/lib.

Until the work is done, let's just disable the new linker namespace
config when the target is to be sanitized.

Bug: 63535130
Test: make SANITIZE_TARGET=integer_overflow
SANITIZE_TARGET_DIAG=integer_overflow builds and boots to the UI

Merged-In: I6afb69885aaa3d25e554b9ca699a572248bfc50a
Change-Id: I6afb69885aaa3d25e554b9ca699a572248bfc50a
(cherry picked from commit fff6f75fc1)
2017-10-23 11:10:29 +09:00
Bowgo Tsai
d29ac08509 Merge "Removing $(PRODUCT_OUT)/root/root"
am: 8cbbacdc15

Change-Id: Ia671976f8d7d4b83478c58d566e309f36af125ab
2017-09-29 03:27:38 +00:00
Bowgo Tsai
144893e5ec Removing $(PRODUCT_OUT)/root/root
Bug: 65570851
Test: boot sailfish
Change-Id: I80c3c3de23c57343187fde207980731b5341bc1f
Merged-In: I80c3c3de23c57343187fde207980731b5341bc1f
(cherry picked from commit ededee3e40)
2017-09-28 18:10:58 +08:00
Jiyong Park
2e24e8e2f0 Merge "Configure ld.config.txt for SP-HALs" into oc-dev am: 43b72b58f2
am: 7610066315

Change-Id: I59ede8903c6890b976ef3ca42c7ad1d220470a42
2017-04-15 02:07:02 +00:00
Jiyong Park
450cff4b68 Configure ld.config.txt for SP-HALs
Now, framework process (any process that is executing /system/bin/* or
/system/xbin/*) are started with three namespaces; default, sphal and
vndk.

default namespace is the namespace that is responsible for loading libs
from /system/lib. It can't load libs from other places such as
/vendor/lib. (However, we temporarily open the path since we haven't
finished the system partition cleanup, but will do eventually).

sphal namespace is the namespace where SP-HAL (Same-process HAL) is
loaded. SP-HAL are the only vendor libraries that are allowed to be
loaded inside framework processes. libEGL_<chipset>.so and
android.hardware.graphics.mapper@2.0-impl.so, etc are SP-HALs. When
framework needs to load those SP-HALs, it explicitly loads it from this
namespace using android_get_exported_namespace() and
android_dlopen_ext().

vndk namespace is the namespace for loading vndk-sp (Vendor-NDK for
Same-Process) libs, which is a small set of framework libraries that
SP-HALs can link against. These libraries are compiled for the same
version of Android that the vendor partition is compiled against.
SP-HALs can not use libraries other than vndk-sp and ndk libs.
Membership to vndk-sp and ndk are strictly closed.

Note that in a system, there are two copies of vndk-sp libs. One at
/system/lib and the other at /vendor/lib/vndk-sp. As a result, there can
be two instances of a same library in a process.

Also adds ld.config.legacy.txt which is used on non-Treble devices where
PRODUCT_FULL_TREBLE is not set to true.
Note, this split can be cleaned up further after b/37139976 is solved.

Bug: 34407260
Test: git diff HEAD:rootdir/etc/ld.config.legacy.txt
HEAD^:rootdir/etc/ld.config.txt => 0
Test: sailfish boots (because BOARD_VNDK_VERSION is not set to
'current')

Change-Id: I8331d94edc38f22c4f8abc66cdf2050af9d0605b
2017-04-14 16:39:36 +09:00
Andreas Gampe
df5496aa65 ASAN-Extract
Add init script and shell script to unzip a tar containing ASAN
libraries on boot.

Bug: 36458146
Test: m && m SANITIZE_TARGET=address
Test: manual (build steps for tar missing)
Change-Id: I1bcf332f86c5bf2e0333cbe3def684999c1002f8
2017-03-31 16:02:24 -07:00
Andreas Gampe
21bb2e0388 ASAN: Separate SANITIZE_LITE from asan.options
Add SANITIZE_LITE_SERVICES to drive usage of asan.options for a
large set of native services.

Test: m SANITIZE_TARGET=address SANITIZE_LITE=true
Test: m SANITIZE_TARGET=address SANITIZE_LITE=true SANITIZE_LITE_SERVICES=true
Change-Id: I84458dcc1b193b762daeb3004cf6c49e2fd8fae2
2017-03-10 10:48:00 -08:00
Ryan Campbell
0b36473272 Add global GCOV_PREFIX option.
When native coverage is enabled, add a global GCOV_PREFIX
environment variable specifying that gcda files be output
with path prefix /data/local/tmp.

Bug: 35635587
Test: make NATIVE_COVERAGE=true; check init.environ.rc
Change-Id: I40972aea3ca3168d0687bdc93e9d4b7b3a1071b9
2017-02-27 15:00:18 -08:00
Nick Kralevich
5fae86b5fa Merge "change /data/bugreports to /bugreports"
am: 1b2e6abf3b

Change-Id: I7de15de91a688f8fe4a203a84b54e7dcfa106782
2016-11-23 00:11:13 +00:00
Nick Kralevich
c4084c6694 change /data/bugreports to /bugreports
It's 5 characters shorter, has no runtime costs, can be stored on a
read-only partition, and avoids problems like b/27262109 and b/27204904.
It allows makes some security hardening easier.

Bug: 27262109
Bug: 27204904
Bug: 32799236
Test: verified new symlink created and old one not present
Change-Id: Ief362e13569ad9c868a7f0f9c4dbd6a328c96c6b
2016-11-22 08:57:25 -08:00
Dan Willemsen
d377004c98 Merge \\\"Use BOARD_USES_VENDORIMAGE to detect vendor image presence\\\" am: 5d420e791b am: bdd01e86a5
am: a5b9b8f452

Change-Id: Iceb0c03fa05a7f6126428128c8e5dced5e7e6cef
2016-07-09 06:08:40 +00:00
Dan Willemsen
0790431f75 Use BOARD_USES_VENDORIMAGE to detect vendor image presence
When building without vendor/... in the tree, we won't be creating a
vendorimage, so BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE won't be defined. But
we still need to use the vendor image that will be present.

Bug: 30040825
Change-Id: I756adc615aea11da60da4d3a4568caca9fed93ab
2016-07-08 18:17:48 -07:00