From 0ed52b789d917402e494f9dcf9ec46cebd87d8f8 Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Wed, 13 Mar 2019 14:30:20 +0000 Subject: [PATCH] Move the logic for creating APEX-related symlinks The existing location of logic for creating symlinks to files that have moved into APEX does not get executed for -user builds, only -userdebug and -eng. The new location is equally arbitrary but appears to be invoked for -user, -userdebug and -eng targets. Tested with: make cleaninstall && lunch taimen-[user|userdebug|eng] && make droid Inspected: ls -l out/target/product/taimen/system/usr/icu Bug: 128249030 Bug: 122985829 Bug: 124106384 Test: see above Change-Id: I92a52d0b5ef97e8cb4f780691f8594e40f2fa6b3 --- rootdir/Android.mk | 77 +++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/rootdir/Android.mk b/rootdir/Android.mk index d2125d8cb..e0b291d2a 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -24,44 +24,6 @@ LOCAL_SRC_FILES := $(LOCAL_MODULE) LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/init -# 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. -# init-debug.rc 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 -LOCAL_POST_INSTALL_CMD += ; ln -sf /apex/com.android.runtime/etc/icu $(TARGET_OUT)/usr/icu - -# TODO(b/124106384): Clean up compat symlinks for ART binaries. -ART_BINARIES= \ - dalvikvm \ - dalvikvm32 \ - dalvikvm64 \ - dex2oat \ - dexdiag \ - dexdump \ - dexlist \ - dexoptanalyzer \ - oatdump \ - profman \ - -$(foreach b,$(ART_BINARIES), \ - $(eval LOCAL_POST_INSTALL_CMD += \ - ; ln -sf /apex/com.android.runtime/bin/$(b) $(TARGET_OUT)/bin/$(b)) \ -) - -# End of runtime APEX compatibilty. - include $(BUILD_PREBUILT) ####################################### @@ -242,6 +204,45 @@ LOCAL_MODULE := ld.config.txt LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT_ETC) +# 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 +LOCAL_POST_INSTALL_CMD += ; ln -sf /apex/com.android.runtime/etc/icu $(TARGET_OUT)/usr/icu + +# TODO(b/124106384): Clean up compat symlinks for ART binaries. +ART_BINARIES= \ + dalvikvm \ + dalvikvm32 \ + dalvikvm64 \ + dex2oat \ + dexdiag \ + dexdump \ + dexlist \ + dexoptanalyzer \ + oatdump \ + profman \ + +LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_OUT)/bin +$(foreach b,$(ART_BINARIES), \ + $(eval LOCAL_POST_INSTALL_CMD += \ + ; ln -sf /apex/com.android.runtime/bin/$(b) $(TARGET_OUT)/bin/$(b)) \ +) + +# End of runtime APEX compatibilty. + ifeq ($(_enforce_vndk_at_runtime),true) # for VNDK enforced devices