2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_PATH:= $(call my-dir)
|
|
|
|
|
2013-07-24 03:03:37 +02:00
|
|
|
#######################################
|
|
|
|
# init.rc
|
|
|
|
include $(CLEAR_VARS)
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2013-07-24 03:03:37 +02:00
|
|
|
LOCAL_MODULE := init.rc
|
|
|
|
LOCAL_SRC_FILES := $(LOCAL_MODULE)
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
2019-03-20 23:52:45 +01:00
|
|
|
LOCAL_REQUIRED_MODULES := fsverity_init
|
2010-04-20 23:32:50 +02:00
|
|
|
|
2018-12-05 23:54:26 +01:00
|
|
|
# The init symlink must be a post install command of a file that is to TARGET_ROOT_OUT.
|
|
|
|
# Since init.rc is required for init and satisfies that requirement, we hijack it to create the symlink.
|
|
|
|
LOCAL_POST_INSTALL_CMD := ln -sf /system/bin/init $(TARGET_ROOT_OUT)/init
|
|
|
|
|
2013-07-24 03:03:37 +02:00
|
|
|
include $(BUILD_PREBUILT)
|
2015-08-08 02:04:37 +02:00
|
|
|
|
2016-01-28 18:32:53 +01:00
|
|
|
#######################################
|
|
|
|
# init-debug.rc
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := init-debug.rc
|
|
|
|
LOCAL_SRC_FILES := $(LOCAL_MODULE)
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/init
|
|
|
|
|
|
|
|
include $(BUILD_PREBUILT)
|
|
|
|
|
2015-08-08 02:04:37 +02:00
|
|
|
#######################################
|
|
|
|
# asan.options
|
2015-09-18 20:59:46 +02:00
|
|
|
ifneq ($(filter address,$(SANITIZE_TARGET)),)
|
2016-06-23 05:05:59 +02:00
|
|
|
|
2015-08-08 02:04:37 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := asan.options
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_SRC_FILES := $(LOCAL_MODULE)
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)
|
|
|
|
|
|
|
|
include $(BUILD_PREBUILT)
|
2016-06-23 05:05:59 +02:00
|
|
|
|
2017-03-22 03:36:48 +01:00
|
|
|
# ASAN extration.
|
|
|
|
ASAN_EXTRACT_FILES :=
|
|
|
|
ifeq ($(SANITIZE_TARGET_SYSTEM),true)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE:= asan_extract
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_CLASS := EXECUTABLES
|
|
|
|
LOCAL_SRC_FILES := asan_extract.sh
|
|
|
|
LOCAL_INIT_RC := asan_extract.rc
|
|
|
|
# We need bzip2 on device for extraction.
|
|
|
|
LOCAL_REQUIRED_MODULES := bzip2
|
|
|
|
include $(BUILD_PREBUILT)
|
|
|
|
ASAN_EXTRACT_FILES := asan_extract
|
|
|
|
endif
|
|
|
|
|
2015-08-08 02:04:37 +02:00
|
|
|
endif
|
|
|
|
|
2019-03-20 23:52:45 +01:00
|
|
|
#######################################
|
|
|
|
# fsverity_init
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE:= fsverity_init
|
|
|
|
LOCAL_MODULE_CLASS := EXECUTABLES
|
|
|
|
LOCAL_SRC_FILES := fsverity_init.sh
|
|
|
|
include $(BUILD_PREBUILT)
|
|
|
|
|
2013-07-24 03:03:37 +02:00
|
|
|
#######################################
|
|
|
|
# init.environ.rc
|
2012-04-04 20:26:59 +02:00
|
|
|
|
2013-07-24 03:03:37 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE := init.environ.rc
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2015-08-08 02:04:37 +02:00
|
|
|
EXPORT_GLOBAL_ASAN_OPTIONS :=
|
2015-09-18 20:59:46 +02:00
|
|
|
ifneq ($(filter address,$(SANITIZE_TARGET)),)
|
2015-08-08 02:04:37 +02:00
|
|
|
EXPORT_GLOBAL_ASAN_OPTIONS := export ASAN_OPTIONS include=/system/asan.options
|
2017-03-22 03:36:48 +01:00
|
|
|
LOCAL_REQUIRED_MODULES := asan.options $(ASAN_OPTIONS_FILES) $(ASAN_EXTRACT_FILES)
|
2015-08-08 02:04:37 +02:00
|
|
|
endif
|
2017-02-22 02:27:02 +01:00
|
|
|
|
2018-10-04 03:24:42 +02:00
|
|
|
EXPORT_GLOBAL_HWASAN_OPTIONS :=
|
|
|
|
ifneq ($(filter hwaddress,$(SANITIZE_TARGET)),)
|
|
|
|
ifneq ($(HWADDRESS_SANITIZER_GLOBAL_OPTIONS),)
|
|
|
|
EXPORT_GLOBAL_HWASAN_OPTIONS := export HWASAN_OPTIONS $(HWADDRESS_SANITIZER_GLOBAL_OPTIONS)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2017-02-22 02:27:02 +01:00
|
|
|
EXPORT_GLOBAL_GCOV_OPTIONS :=
|
|
|
|
ifeq ($(NATIVE_COVERAGE),true)
|
2019-04-03 00:26:33 +02:00
|
|
|
EXPORT_GLOBAL_GCOV_OPTIONS := export GCOV_PREFIX /data/misc/trace
|
2017-02-22 02:27:02 +01:00
|
|
|
endif
|
|
|
|
|
2013-07-24 03:03:37 +02:00
|
|
|
# Put it here instead of in init.rc module definition,
|
|
|
|
# because init.rc is conditionally included.
|
|
|
|
#
|
2015-07-29 00:14:39 +02:00
|
|
|
# create some directories (some are mount points) and symlinks
|
2015-10-28 21:13:37 +01:00
|
|
|
LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \
|
2019-04-11 17:57:24 +02:00
|
|
|
dev proc sys system data odm oem acct config storage mnt apex debug_ramdisk $(BOARD_ROOT_EXTRA_FOLDERS)); \
|
2017-12-06 17:59:02 +01:00
|
|
|
ln -sf /system/bin $(TARGET_ROOT_OUT)/bin; \
|
2015-07-29 00:14:39 +02:00
|
|
|
ln -sf /system/etc $(TARGET_ROOT_OUT)/etc; \
|
2016-11-19 21:09:33 +01:00
|
|
|
ln -sf /data/user_de/0/com.android.shell/files/bugreports $(TARGET_ROOT_OUT)/bugreports; \
|
2015-07-29 00:14:39 +02:00
|
|
|
ln -sf /sys/kernel/debug $(TARGET_ROOT_OUT)/d; \
|
|
|
|
ln -sf /storage/self/primary $(TARGET_ROOT_OUT)/sdcard
|
2016-07-09 03:08:51 +02:00
|
|
|
ifdef BOARD_USES_VENDORIMAGE
|
2015-10-28 21:13:37 +01:00
|
|
|
LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/vendor
|
2015-11-11 23:49:47 +01:00
|
|
|
else
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /system/vendor $(TARGET_ROOT_OUT)/vendor
|
2015-10-28 21:13:37 +01:00
|
|
|
endif
|
2017-11-28 04:10:10 +01:00
|
|
|
ifdef BOARD_USES_PRODUCTIMAGE
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/product
|
|
|
|
else
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /system/product $(TARGET_ROOT_OUT)/product
|
|
|
|
endif
|
2018-07-27 20:11:57 +02:00
|
|
|
ifdef BOARD_USES_PRODUCT_SERVICESIMAGE
|
2018-08-17 02:01:25 +02:00
|
|
|
LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/product_services
|
2018-05-25 17:07:19 +02:00
|
|
|
else
|
2018-08-17 02:01:25 +02:00
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /system/product_services $(TARGET_ROOT_OUT)/product_services
|
2018-05-25 17:07:19 +02:00
|
|
|
endif
|
2018-05-17 19:12:34 +02:00
|
|
|
ifdef BOARD_USES_METADATA_PARTITION
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/metadata
|
|
|
|
endif
|
2017-11-15 11:06:48 +01:00
|
|
|
|
|
|
|
# For /odm partition.
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/odm
|
|
|
|
# For Treble Generic System Image (GSI), system-as-root GSI needs to work on
|
|
|
|
# both devices with and without /odm partition. Those symlinks are for devices
|
|
|
|
# without /odm partition. For devices with /odm partition, mount odm.img under
|
|
|
|
# /odm will hide those symlinks.
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/app $(TARGET_ROOT_OUT)/odm/app
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/bin $(TARGET_ROOT_OUT)/odm/bin
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/etc $(TARGET_ROOT_OUT)/odm/etc
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/firmware $(TARGET_ROOT_OUT)/odm/firmware
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/framework $(TARGET_ROOT_OUT)/odm/framework
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/lib $(TARGET_ROOT_OUT)/odm/lib
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/lib64 $(TARGET_ROOT_OUT)/odm/lib64
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/overlay $(TARGET_ROOT_OUT)/odm/overlay
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/priv-app $(TARGET_ROOT_OUT)/odm/priv-app
|
2018-10-16 12:24:08 +02:00
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/usr $(TARGET_ROOT_OUT)/odm/usr
|
2017-11-15 11:06:48 +01:00
|
|
|
|
2016-05-13 23:22:14 +02:00
|
|
|
ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/cache
|
|
|
|
else
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; ln -sf /data/cache $(TARGET_ROOT_OUT)/cache
|
|
|
|
endif
|
2015-10-28 21:13:37 +01:00
|
|
|
ifdef BOARD_ROOT_EXTRA_SYMLINKS
|
|
|
|
# BOARD_ROOT_EXTRA_SYMLINKS is a list of <target>:<link_name>.
|
|
|
|
LOCAL_POST_INSTALL_CMD += $(foreach s, $(BOARD_ROOT_EXTRA_SYMLINKS),\
|
|
|
|
$(eval p := $(subst :,$(space),$(s)))\
|
|
|
|
; mkdir -p $(dir $(TARGET_ROOT_OUT)/$(word 2,$(p))) \
|
|
|
|
; ln -sf $(word 1,$(p)) $(TARGET_ROOT_OUT)/$(word 2,$(p)))
|
2015-07-29 00:14:39 +02:00
|
|
|
endif
|
2016-03-01 02:23:36 +01:00
|
|
|
# The A/B updater uses a top-level /postinstall directory to mount the new
|
|
|
|
# system before reboot.
|
|
|
|
ifeq ($(AB_OTA_UPDATER),true)
|
|
|
|
LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/postinstall
|
|
|
|
endif
|
2013-07-24 03:03:37 +02:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-10-23 00:50:39 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in
|
2013-07-24 03:03:37 +02:00
|
|
|
@echo "Generate: $< -> $@"
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' $< >$@
|
2019-02-22 17:58:10 +01:00
|
|
|
$(hide) sed -i -e 's?%DEX2OATBOOTCLASSPATH%?$(PRODUCT_DEX2OAT_BOOTCLASSPATH)?g' $@
|
2014-08-05 16:42:34 +02:00
|
|
|
$(hide) sed -i -e 's?%SYSTEMSERVERCLASSPATH%?$(PRODUCT_SYSTEM_SERVER_CLASSPATH)?g' $@
|
2015-06-13 00:42:20 +02:00
|
|
|
$(hide) sed -i -e 's?%EXPORT_GLOBAL_ASAN_OPTIONS%?$(EXPORT_GLOBAL_ASAN_OPTIONS)?g' $@
|
2017-02-22 02:27:02 +01:00
|
|
|
$(hide) sed -i -e 's?%EXPORT_GLOBAL_GCOV_OPTIONS%?$(EXPORT_GLOBAL_GCOV_OPTIONS)?g' $@
|
2018-10-04 03:24:42 +02:00
|
|
|
$(hide) sed -i -e 's?%EXPORT_GLOBAL_HWASAN_OPTIONS%?$(EXPORT_GLOBAL_HWASAN_OPTIONS)?g' $@
|
2013-07-24 03:03:37 +02:00
|
|
|
|
2018-05-08 14:12:19 +02:00
|
|
|
# Append PLATFORM_VNDK_VERSION to base name.
|
2018-01-10 01:38:19 +01:00
|
|
|
define append_vndk_version
|
2017-12-07 09:31:53 +01:00
|
|
|
$(strip \
|
2018-05-08 14:12:19 +02:00
|
|
|
$(basename $(1)).$(PLATFORM_VNDK_VERSION)$(suffix $(1)) \
|
2017-12-07 09:31:53 +01:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2018-05-08 14:12:19 +02:00
|
|
|
|
|
|
|
#######################################
|
|
|
|
# ld.config.txt selection variables
|
|
|
|
#
|
|
|
|
_enforce_vndk_at_runtime := false
|
|
|
|
ifdef BOARD_VNDK_VERSION
|
|
|
|
ifneq ($(BOARD_VNDK_RUNTIME_DISABLE),true)
|
|
|
|
_enforce_vndk_at_runtime := true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
_enforce_vndk_lite_at_runtime := false
|
|
|
|
ifeq ($(_enforce_vndk_at_runtime),false)
|
|
|
|
ifeq ($(PRODUCT_TREBLE_LINKER_NAMESPACES)|$(SANITIZE_TARGET),true|)
|
|
|
|
_enforce_vndk_lite_at_runtime := true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2013-07-24 03:03:37 +02:00
|
|
|
#######################################
|
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-05 07:24:14 +02:00
|
|
|
# ld.config.txt
|
2018-01-16 03:46:21 +01:00
|
|
|
#
|
|
|
|
# For VNDK enforced devices that have defined BOARD_VNDK_VERSION, use
|
2018-02-08 00:46:59 +01:00
|
|
|
# "ld.config.txt" as a source file. This configuration includes strict VNDK
|
|
|
|
# run-time restrictions for vendor process.
|
2018-05-08 14:12:19 +02:00
|
|
|
#
|
2018-01-16 03:46:21 +01:00
|
|
|
# Other treblized devices, that have not defined BOARD_VNDK_VERSION or that
|
2018-02-08 00:46:59 +01:00
|
|
|
# have set BOARD_VNDK_RUNTIME_DISABLE to true, use "ld.config.vndk_lite.txt"
|
2018-02-02 05:22:02 +01:00
|
|
|
# as a source file. This configuration does not have strict VNDK run-time
|
|
|
|
# restrictions.
|
2018-05-08 14:12:19 +02:00
|
|
|
#
|
2018-01-16 03:46:21 +01:00
|
|
|
# If the device is not treblized, use "ld.config.legacy.txt" for legacy
|
|
|
|
# namespace configuration.
|
2018-05-08 14:12:19 +02:00
|
|
|
#
|
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-05 07:24:14 +02:00
|
|
|
include $(CLEAR_VARS)
|
2018-01-16 03:46:21 +01:00
|
|
|
LOCAL_MODULE := ld.config.txt
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
|
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-05 07:24:14 +02:00
|
|
|
|
2019-03-13 15:30:20 +01:00
|
|
|
# Start of runtime APEX compatibility.
|
|
|
|
#
|
|
|
|
# Meta-comment:
|
|
|
|
# The placing of this section is somewhat arbitrary. The LOCAL_POST_INSTALL_CMD
|
|
|
|
# entries need to be associated with something that goes into /system.
|
|
|
|
# ld.config.txt qualifies but it could be anything else in /system until soong
|
|
|
|
# supports creation of symlinks. http://b/123333111
|
|
|
|
#
|
|
|
|
# Keeping the appearance of files/dirs having old locations for apps that have
|
|
|
|
# come to rely on them.
|
|
|
|
|
|
|
|
# http://b/121248172 - create a link from /system/usr/icu to
|
|
|
|
# /apex/com.android.runtime/etc/icu so that apps can find the ICU .dat file.
|
|
|
|
# A symlink can't overwrite a directory and the /system/usr/icu directory once
|
|
|
|
# existed so the required structure must be created whatever we find.
|
|
|
|
LOCAL_POST_INSTALL_CMD = mkdir -p $(TARGET_OUT)/usr && rm -rf $(TARGET_OUT)/usr/icu
|
2019-03-15 20:00:36 +01:00
|
|
|
LOCAL_POST_INSTALL_CMD += && ln -sf /apex/com.android.runtime/etc/icu $(TARGET_OUT)/usr/icu
|
2019-03-13 15:30:20 +01:00
|
|
|
|
|
|
|
# TODO(b/124106384): Clean up compat symlinks for ART binaries.
|
2019-03-15 20:00:36 +01:00
|
|
|
ART_BINARIES := \
|
2019-03-13 15:30:20 +01:00
|
|
|
dalvikvm \
|
|
|
|
dalvikvm32 \
|
|
|
|
dalvikvm64 \
|
|
|
|
dex2oat \
|
|
|
|
dexdiag \
|
|
|
|
dexdump \
|
|
|
|
dexlist \
|
|
|
|
dexoptanalyzer \
|
|
|
|
oatdump \
|
|
|
|
profman \
|
|
|
|
|
2019-03-15 20:00:36 +01:00
|
|
|
LOCAL_POST_INSTALL_CMD += && mkdir -p $(TARGET_OUT)/bin
|
2019-03-13 15:30:20 +01:00
|
|
|
$(foreach b,$(ART_BINARIES), \
|
|
|
|
$(eval LOCAL_POST_INSTALL_CMD += \
|
2019-03-15 20:00:36 +01:00
|
|
|
&& ln -sf /apex/com.android.runtime/bin/$(b) $(TARGET_OUT)/bin/$(b)) \
|
2019-03-13 15:30:20 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# End of runtime APEX compatibilty.
|
|
|
|
|
2017-08-04 12:08:06 +02:00
|
|
|
ifeq ($(_enforce_vndk_at_runtime),true)
|
2018-05-08 14:12:19 +02:00
|
|
|
|
2018-01-16 03:46:21 +01:00
|
|
|
# for VNDK enforced devices
|
2018-01-10 01:38:19 +01:00
|
|
|
LOCAL_MODULE_STEM := $(call append_vndk_version,$(LOCAL_MODULE))
|
2017-08-04 12:08:06 +02:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
2018-07-25 11:01:29 +02:00
|
|
|
ld_config_template := $(LOCAL_PATH)/etc/ld.config.txt
|
2018-09-11 02:42:36 +02:00
|
|
|
check_backward_compatibility := true
|
2018-07-25 11:01:29 +02:00
|
|
|
vndk_version := $(PLATFORM_VNDK_VERSION)
|
|
|
|
include $(LOCAL_PATH)/update_and_install_ld_config.mk
|
2017-08-04 12:08:06 +02:00
|
|
|
|
2018-05-08 14:12:19 +02:00
|
|
|
else ifeq ($(_enforce_vndk_lite_at_runtime),true)
|
|
|
|
|
|
|
|
# for treblized but VNDK lightly enforced devices
|
|
|
|
LOCAL_MODULE_STEM := ld.config.vndk_lite.txt
|
2018-01-16 03:46:21 +01:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
2018-07-25 11:01:29 +02:00
|
|
|
ld_config_template := $(LOCAL_PATH)/etc/ld.config.vndk_lite.txt
|
|
|
|
vndk_version := $(PLATFORM_VNDK_VERSION)
|
|
|
|
libz_is_llndk := true
|
|
|
|
include $(LOCAL_PATH)/update_and_install_ld_config.mk
|
2017-12-07 01:59:48 +01:00
|
|
|
|
2018-01-16 03:46:21 +01:00
|
|
|
else
|
2018-05-08 14:12:19 +02:00
|
|
|
|
2018-01-16 03:46:21 +01:00
|
|
|
# for legacy non-treblized devices
|
|
|
|
LOCAL_MODULE_STEM := $(LOCAL_MODULE)
|
2018-05-08 14:12:19 +02:00
|
|
|
LOCAL_SRC_FILES := etc/ld.config.legacy.txt
|
2018-01-16 03:46:21 +01:00
|
|
|
include $(BUILD_PREBUILT)
|
2017-08-04 12:08:06 +02:00
|
|
|
|
2018-05-08 14:12:19 +02:00
|
|
|
endif # ifeq ($(_enforce_vndk_at_runtime),true)
|
2017-08-04 12:08:06 +02:00
|
|
|
|
2018-07-25 11:01:29 +02:00
|
|
|
# ld.config.txt for VNDK versions older than PLATFORM_VNDK_VERSION
|
|
|
|
# are built with the VNDK libraries lists under /prebuilts/vndk.
|
|
|
|
#
|
|
|
|
# ld.config.$(VER).txt is built and installed for all VNDK versions
|
|
|
|
# listed in PRODUCT_EXTRA_VNDK_VERSIONS.
|
|
|
|
#
|
|
|
|
# $(1): VNDK version
|
|
|
|
define build_versioned_ld_config
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := ld.config.$(1).txt
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
|
|
|
|
LOCAL_MODULE_STEM := $$(LOCAL_MODULE)
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
ld_config_template := $(LOCAL_PATH)/etc/ld.config.txt
|
2018-09-11 02:42:36 +02:00
|
|
|
check_backward_compatibility := true
|
2018-07-25 11:01:29 +02:00
|
|
|
vndk_version := $(1)
|
|
|
|
lib_list_from_prebuilts := true
|
|
|
|
include $(LOCAL_PATH)/update_and_install_ld_config.mk
|
|
|
|
endef
|
|
|
|
|
2018-08-10 08:49:17 +02:00
|
|
|
vndk_snapshots := $(wildcard prebuilts/vndk/*)
|
|
|
|
supported_vndk_snapshot_versions := \
|
2019-01-23 11:22:29 +01:00
|
|
|
$(strip $(patsubst prebuilts/vndk/v%,%,$(vndk_snapshots)))
|
|
|
|
$(foreach ver,$(supported_vndk_snapshot_versions),\
|
|
|
|
$(eval $(call build_versioned_ld_config,$(ver))))
|
2017-08-04 12:08:06 +02:00
|
|
|
|
2018-08-10 08:49:17 +02:00
|
|
|
vndk_snapshots :=
|
|
|
|
supported_vndk_snapshot_versions :=
|
|
|
|
|
2018-01-16 03:46:21 +01:00
|
|
|
#######################################
|
2018-05-08 14:12:19 +02:00
|
|
|
# ld.config.vndk_lite.txt
|
2018-01-16 03:46:21 +01:00
|
|
|
#
|
2018-05-08 14:12:19 +02:00
|
|
|
# This module is only for GSI.
|
|
|
|
#
|
|
|
|
ifeq ($(_enforce_vndk_lite_at_runtime),false)
|
|
|
|
|
2018-01-16 03:46:21 +01:00
|
|
|
include $(CLEAR_VARS)
|
2018-05-08 14:12:19 +02:00
|
|
|
LOCAL_MODULE := ld.config.vndk_lite.txt
|
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-05 07:24:14 +02:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
|
2018-01-16 03:46:21 +01:00
|
|
|
LOCAL_MODULE_STEM := $(LOCAL_MODULE)
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
2018-07-25 11:01:29 +02:00
|
|
|
ld_config_template := $(LOCAL_PATH)/etc/ld.config.vndk_lite.txt
|
|
|
|
vndk_version := $(PLATFORM_VNDK_VERSION)
|
|
|
|
libz_is_llndk := true
|
|
|
|
include $(LOCAL_PATH)/update_and_install_ld_config.mk
|
2017-08-22 03:25:18 +02:00
|
|
|
|
2018-05-08 14:12:19 +02:00
|
|
|
endif # ifeq ($(_enforce_vndk_lite_at_runtime),false)
|
|
|
|
|
|
|
|
_enforce_vndk_at_runtime :=
|
|
|
|
_enforce_vndk_lite_at_runtime :=
|
|
|
|
|
2018-05-29 09:41:30 +02:00
|
|
|
#######################################
|
|
|
|
# ld.config.txt for recovery
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := ld.config.recovery.txt
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_SRC_FILES := etc/ld.config.recovery.txt
|
2018-08-17 21:18:08 +02:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/etc
|
2018-05-29 09:41:30 +02:00
|
|
|
LOCAL_MODULE_STEM := ld.config.txt
|
|
|
|
include $(BUILD_PREBUILT)
|
|
|
|
|
2017-08-22 03:25:18 +02:00
|
|
|
#######################################
|
|
|
|
# llndk.libraries.txt
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := llndk.libraries.txt
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
|
2018-01-10 01:38:19 +01:00
|
|
|
LOCAL_MODULE_STEM := $(call append_vndk_version,$(LOCAL_MODULE))
|
2017-08-22 03:25:18 +02:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_LLNDK_LIBRARIES := $(LLNDK_LIBRARIES)
|
2017-10-13 09:36:49 +02:00
|
|
|
$(LOCAL_BUILT_MODULE):
|
2017-08-22 03:25:18 +02:00
|
|
|
@echo "Generate: $@"
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) echo -n > $@
|
|
|
|
$(hide) $(foreach lib,$(PRIVATE_LLNDK_LIBRARIES), \
|
|
|
|
echo $(lib).so >> $@;)
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
# vndksp.libraries.txt
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := vndksp.libraries.txt
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
|
2018-01-10 01:38:19 +01:00
|
|
|
LOCAL_MODULE_STEM := $(call append_vndk_version,$(LOCAL_MODULE))
|
2017-08-22 03:25:18 +02:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_VNDK_SAMEPROCESS_LIBRARIES := $(VNDK_SAMEPROCESS_LIBRARIES)
|
2017-10-13 09:36:49 +02:00
|
|
|
$(LOCAL_BUILT_MODULE):
|
2017-08-22 03:25:18 +02:00
|
|
|
@echo "Generate: $@"
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) echo -n > $@
|
|
|
|
$(hide) $(foreach lib,$(PRIVATE_VNDK_SAMEPROCESS_LIBRARIES), \
|
|
|
|
echo $(lib).so >> $@;)
|
2019-03-28 15:58:40 +01:00
|
|
|
|
2019-04-19 16:08:56 +02:00
|
|
|
#######################################
|
|
|
|
# adb_debug.prop in debug ramdisk
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := adb_debug.prop
|
|
|
|
LOCAL_SRC_FILES := $(LOCAL_MODULE)
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_DEBUG_RAMDISK_OUT)
|
|
|
|
include $(BUILD_PREBUILT)
|
|
|
|
|
2019-03-28 15:58:40 +01:00
|
|
|
include $(call all-makefiles-under,$(LOCAL_PATH))
|