From 3afca900add492b15eb3e1fd95570c0d87ac6ddb Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 4 Mar 2018 21:33:55 +0100 Subject: [PATCH] Add init.treble-environ.rc to properly setup bootclasspath/serverclasspath --- base.mk | 3 +++ environ/Android.mk | 10 ++++++++++ environ/init.treble-environ.rc | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 environ/Android.mk create mode 100644 environ/init.treble-environ.rc diff --git a/base.mk b/base.mk index f1bad7d..3277699 100644 --- a/base.mk +++ b/base.mk @@ -43,3 +43,6 @@ PRODUCT_COPY_FILES += \ # vendor/etc PRODUCT_COPY_FILES += \ device/phh/treble/nfc/libnfc-nci.conf:system/etc/libnfc-nci.conf + +PRODUCT_PACKAGES += \ + treble-environ-rc diff --git a/environ/Android.mk b/environ/Android.mk new file mode 100644 index 0000000..2eec2d5 --- /dev/null +++ b/environ/Android.mk @@ -0,0 +1,10 @@ +include $(CLEAR_VARS) + +LOCAL_MODULE := treble-environ-rc +LOCAL_MODULE_TAGS := optional + +LOCAL_POST_INSTALL_CMD := \ + sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' device/phh/treble/environ/init.treble-environ.rc > $(PRODUCT_OUT)/system/etc/init/init.treble-environ.rc && \ + sed -i -e 's?%SYSTEMSERVERCLASSPATH%?$(PRODUCT_SYSTEM_SERVER_CLASSPATH)?g' $(PRODUCT_OUT)/system/etc/init/init.treble-environ.rc + +include $(BUILD_PHONY_PACKAGE) diff --git a/environ/init.treble-environ.rc b/environ/init.treble-environ.rc new file mode 100644 index 0000000..db095c8 --- /dev/null +++ b/environ/init.treble-environ.rc @@ -0,0 +1,4 @@ +# set up the global environment +on init + export BOOTCLASSPATH %BOOTCLASSPATH% + export SYSTEMSERVERCLASSPATH %SYSTEMSERVERCLASSPATH%