diff --git a/rootdir/Android.mk b/rootdir/Android.mk index 73d11011d..f29ff2336 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -48,6 +48,7 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := ETC LOCAL_MODULE := init.environ.rc LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) +LOCAL_REQUIRED_MODULES := etc_classpath EXPORT_GLOBAL_ASAN_OPTIONS := ifneq ($(filter address,$(SANITIZE_TARGET)),) @@ -163,9 +164,7 @@ include $(BUILD_SYSTEM)/base_rules.mk $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in @echo "Generate: $< -> $@" @mkdir -p $(dir $@) - $(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' $< >$@ - $(hide) sed -i -e 's?%DEX2OATBOOTCLASSPATH%?$(PRODUCT_DEX2OAT_BOOTCLASSPATH)?g' $@ - $(hide) sed -i -e 's?%SYSTEMSERVERCLASSPATH%?$(PRODUCT_SYSTEM_SERVER_CLASSPATH)?g' $@ + $(hide) cp $< $@ $(hide) sed -i -e 's?%EXPORT_GLOBAL_ASAN_OPTIONS%?$(EXPORT_GLOBAL_ASAN_OPTIONS)?g' $@ $(hide) sed -i -e 's?%EXPORT_GLOBAL_GCOV_OPTIONS%?$(EXPORT_GLOBAL_GCOV_OPTIONS)?g' $@ $(hide) sed -i -e 's?%EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS%?$(EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS)?g' $@ @@ -178,6 +177,21 @@ $(strip \ ) endef +####################################### +# /etc/classpath +include $(CLEAR_VARS) +LOCAL_MODULE := etc_classpath +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_PATH := $(TARGET_OUT_ETC) +LOCAL_MODULE_STEM := classpath +include $(BUILD_SYSTEM)/base_rules.mk +$(LOCAL_BUILT_MODULE): + @echo "Generate: $@" + @mkdir -p $(dir $@) + $(hide) echo "export BOOTCLASSPATH $(PRODUCT_BOOTCLASSPATH)" > $@ + $(hide) echo "export DEX2OATBOOTCLASSPATH $(PRODUCT_DEX2OAT_BOOTCLASSPATH)" >> $@ + $(hide) echo "export SYSTEMSERVERCLASSPATH $(PRODUCT_SYSTEM_SERVER_CLASSPATH)" >> $@ + ####################################### # sanitizer.libraries.txt include $(CLEAR_VARS) diff --git a/rootdir/init.environ.rc.in b/rootdir/init.environ.rc.in index fdaaf1abe..bf6e986c4 100644 --- a/rootdir/init.environ.rc.in +++ b/rootdir/init.environ.rc.in @@ -10,9 +10,6 @@ on early-init export ANDROID_TZDATA_ROOT /apex/com.android.tzdata export EXTERNAL_STORAGE /sdcard export ASEC_MOUNTPOINT /mnt/asec - export BOOTCLASSPATH %BOOTCLASSPATH% - export DEX2OATBOOTCLASSPATH %DEX2OATBOOTCLASSPATH% - export SYSTEMSERVERCLASSPATH %SYSTEMSERVERCLASSPATH% %EXPORT_GLOBAL_ASAN_OPTIONS% %EXPORT_GLOBAL_GCOV_OPTIONS% %EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS% diff --git a/rootdir/init.rc b/rootdir/init.rc index 863cf6caf..9ac31d69d 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -865,6 +865,10 @@ on post-fs-data wait_for_prop apexd.status activated perform_apex_config + # Export *CLASSPATH variables from /etc/classpath + # TODO(b/180105615): export from the generated file instead. + load_exports /etc/classpath + # Special-case /data/media/obb per b/64566063 mkdir /data/media 0770 media_rw media_rw encryption=None exec - media_rw media_rw -- /system/bin/chattr +F /data/media