Commit graph

104 commits

Author SHA1 Message Date
Tom Cherry
c12e205ec5 Fix /init -> /system/bin/init symlink creation race
A symlink for TARGET_ROOT_OUT as a post install command of a package
that is also installed to TARGET_ROOT_OUT.  We hijack init.rc which
satisfies this requirement for this symlink.

Bug: 120402274
Bug: 120460755
Bug: 120509320
Bug: 120554662
Test: symlink is created
Test: make bootimage && ls -la $OUT/root/init
Change-Id: I6f1ac06ef152c36d7d7db4618d49a008338da39b
2018-12-05 23:42:07 +00:00
Evgenii Stepanov
d33653a26e Remove bcp_dep.
Since the build system move to kati/ninja, build command is an
implicit dependency of a target. This makes the bcp_dep / bcp_md5
thing obsolete.

Test: make

Change-Id: I4ce9ebdabfc72b188e49f12888054d63b3cda64d
2018-10-22 16:08:01 -07:00
Bowgo Tsai
15f872aee4 Adding /odm/usr -> /vendor/odm/usr symlink
Bug: 112880217
Test: build and checks symlink is created
Change-Id: Ib9635fc1cd425664cfa8f79d8f034f3cb615cbbc
2018-10-16 18:24:08 +08:00
Evgenii Stepanov
30917f77ba Export HWASAN_OPTIONS when SANITIZE_TARGET:=hwaddress
Bug: 112438058
Test: adb shell env | grep HWASAN_OPTIONS
Change-Id: I6ea4ef03269a7413b97cc62ea5b76597137bd980
2018-10-09 15:33:59 -07:00
Martijn Coenen
344a91a5f1 Add /apex tmpfs mount and mount it.
APEX filesystem images will now be mounted in /apex.

Also, make sure /data/apex is created with the right ACL.

Bug: 112455435
Test: flash and wipe, /apex is mounted as tmpfs, /data/apex is created
Change-Id: Ie27775e9f40a27b510272f212762624a04e94f1d
2018-10-03 09:48:38 +02:00
Justin Yun
79d07bcfc3 Restore "Check if current ld.config.txt files is backward compatible"
This reverts commit bd2b0c78a1.

Reason for revert:
Solved the build error on mac_sdk build by using python2

Bug: 112738739
Bug: 111417344
Test: make ld.config.txt

Change-Id: Ic5a3ed2e6b091813c0310f859b7d20935514a7c6
2018-09-11 09:45:09 +09:00
Yohei Yukawa
bd2b0c78a1 Revert "Check if current ld.config.txt files is backward compatible"
This reverts commit 15bac6bdaf.

Reason for revert:
This caused build errors in mac_sdk build.
Seems that our mac builders do not have python3.

  env: python3: No such file or directory

Bug: 112738739
Bug: 111417344
Test: presubmit
Change-Id: I9796f2e9a54a66fc7a4e1c780c8c272b98ed437f
2018-09-10 16:40:59 +00:00
Justin Yun
15bac6bdaf Check if current ld.config.txt files is backward compatible
The ld.config.txt file is a template to be used for current build as
well as for the VNDK snapshots for old vendor partitions.
To work with the old Android vendor partitions, the ld.config.txt
template must be backward compatible.
This script checks if the current ld.config.txt template modifies or
deletes the vendor directores in every section. If the change is
detected, it will report a build error.

Bug: 112738739
Bug: 111417344
Test: make ld.config.txt
Change-Id: I1211696d6a00a37d531d40c894f1d7e64b210ae5
2018-09-10 11:42:35 +09:00
Tao Bao
7cbebb2ba0 Merge "Install ld.config.recovery.txt to $(TARGET_RECOVERY_ROOT_OUT)/system/etc." 2018-08-21 22:35:49 +00:00
Dario Freni
ab5583b585 s/product-services/product_services/g
Attempting to reduce the number of different spellings we have for
"product services" partition in the codebase.

Bug: 112431447
Test: m
Change-Id: I1a87d7e040a8b1f91f973ac7d90d6360b5b54f71
Merged-In: I1a87d7e040a8b1f91f973ac7d90d6360b5b54f71
2018-08-20 17:46:42 +00:00
Tao Bao
e82b83201b Install ld.config.recovery.txt to $(TARGET_RECOVERY_ROOT_OUT)/system/etc.
Bug: 112780007
Test: Build with other changes in the topic (aosp_taimen-userdebug).
Test: Boot into recovery. Verify basic functionalities (`adb shell` and
      `adb sideload`, factory reset).
Change-Id: I8686bbc68c9c8a1570289ecd21bcfcb551d1700c
2018-08-18 10:22:03 -07:00
Jae Shin
f6c6aaaf13 Parse the list of supported vndk snapshot versions
This allows the target, ld.config.$VER.txt, to be defined for all
$VERs for which a VNDK snapshot exists under /prebuilts/vndk/v$VER.
With this fix,
1) supported_vndk_snaphsot_versions do not need to
be manually updated everytime a new VNDK snapshot is added and,
2) ld.config.$VER.txt will not be ill-defined in a tree that does
not have the required dependency files under /prebuilts/vndk/v$VER.

Test: m -j ld.config.28.txt
Bug: 74658756
Merged-In: Idb056c21412d4cb7c7a7cb3c247b1d82a4a759ff
Change-Id: Idb056c21412d4cb7c7a7cb3c247b1d82a4a759ff
(cherry picked from commit baeaaf9429)
2018-08-13 02:19:42 +00:00
Jae Shin
f6dff6dd33 Build ld.config.txt for older VNDK versions
Until now, the ld.config.$VER.txt for $VER older than
PLATFORM_VNDK_VERSION was installed from a prebuilt stored under
/prebuilts/vndk/v$VER. At runtime, the VNDK version needed by the
vendor partition (ro.vndk.version) determines which
ld.config.$VER.txt is loaded and this configuration is used for
both system and vendor processes. In a system-only-upgrade
scenario, where the system partition is a newer Android version
than the vendor partition, this is a problem because the prebuilt
linker config file will not reflect the most recent
system partition related changes made in the newer Android
version.

To fix this problem, this change builds ld.config.$VER.txt for
older VNDK versions from the source tree by getting the lists of
VNDK libraries from the /prebuilts/vndk/v{VER} directory.

Test: m -j ld.config.txt ld.config.28.txt ld.config.vndk_lite.txt
Bug: 74658756
Merged-In: I1fa2469fc0bce2f2aab507104cd9717b6112d738
Change-Id: I1fa2469fc0bce2f2aab507104cd9717b6112d738
(cherry picked from commit c30e0709bb)
2018-08-13 10:37:27 +09:00
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