From 5455825abd8be4e1bc2e8adbbfbf954016763488 Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Sat, 3 Dec 2016 14:35:17 +0000 Subject: [PATCH] z2_plus: Rewrite build-time symlinks creation --- Android.mk | 72 ++++++++++++++++++++++++++++++------------------------ tftp.mk | 66 ------------------------------------------------- 2 files changed, 40 insertions(+), 98 deletions(-) delete mode 100644 tftp.mk diff --git a/Android.mk b/Android.mk index 84bc12d..0e61555 100644 --- a/Android.mk +++ b/Android.mk @@ -27,42 +27,12 @@ LOCAL_PATH := $(call my-dir) ifeq ($(TARGET_DEVICE),z2_plus) - include $(call all-makefiles-under,$(LOCAL_PATH)) include $(CLEAR_VARS) -LOCAL_MODULE := wifi_symlinks -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := FAKE -LOCAL_MODULE_SUFFIX := -timestamp - -include $(BUILD_SYSTEM)/base_rules.mk - -$(LOCAL_BUILT_MODULE): ACTUAL_INI_FILE := /system/etc/wifi/WCNSS_qcom_cfg.ini -$(LOCAL_BUILT_MODULE): WCNSS_INI_SYMLINK := $(TARGET_OUT)/etc/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini - -$(LOCAL_BUILT_MODULE): ACTUAL_MAC_FILE := /persist/wlan_mac.bin -$(LOCAL_BUILT_MODULE): WCNSS_MAC_SYMLINK := $(TARGET_OUT)/etc/firmware/wlan/qca_cld/wlan_mac.bin - - -$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/Android.mk -$(LOCAL_BUILT_MODULE): - $(hide) echo "Making symlinks for wifi" - $(hide) mkdir -p $(dir $@) - $(hide) mkdir -p $(dir $(WCNSS_INI_SYMLINK)) - $(hide) rm -rf $@ - $(hide) rm -rf $(WCNSS_INI_SYMLINK) - $(hide) ln -sf $(ACTUAL_INI_FILE) $(WCNSS_INI_SYMLINK) - $(hide) rm -rf $(WCNSS_MAC_SYMLINK) - $(hide) ln -sf $(ACTUAL_MAC_FILE) $(WCNSS_MAC_SYMLINK) - $(hide) touch $@ - -include $(call all-makefiles-under,$(LOCAL_PATH)) - IMS_LIBS := libimscamera_jni.so libimsmedia_jni.so - -IMS_SYMLINKS := $(addprefix $(TARGET_OUT)/app/ims/lib/arm64/,$(notdir $(IMS_LIBS))) +IMS_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR_APPS)/ims/lib/arm64/,$(notdir $(IMS_LIBS))) $(IMS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) @echo "IMS lib link: $@" @mkdir -p $(dir $@) @@ -71,6 +41,44 @@ $(IMS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) ALL_DEFAULT_INSTALLED_MODULES += $(IMS_SYMLINKS) -include device/zuk/z2_plus/tftp.mk +RFS_MSM_ADSP_SYMLINKS := $(TARGET_OUT)/rfs/msm/adsp/ +$(RFS_MSM_ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) + @echo "Creating RFS MSM ADSP folder structure: $@" + @rm -rf $@/* + @mkdir -p $(dir $@)/readonly + $(hide) ln -sf /data/tombstones/lpass $@/ramdumps + $(hide) ln -sf /persist/rfs/msm/adsp $@/readwrite + $(hide) ln -sf /persist/rfs/shared $@/shared + $(hide) ln -sf /persist/hlos_rfs/shared $@/hlos + $(hide) ln -sf /firmware $@/readonly/firmware + +RFS_MSM_MPSS_SYMLINKS := $(TARGET_OUT)/rfs/msm/mpss/ +$(RFS_MSM_MPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) + @echo "Creating RFS MSM MPSS folder structure: $@" + @rm -rf $@/* + @mkdir -p $(dir $@)/readonly + $(hide) ln -sf /data/tombstones/modem $@/ramdumps + $(hide) ln -sf /persist/rfs/msm/mpss $@/readwrite + $(hide) ln -sf /persist/rfs/shared $@/shared + $(hide) ln -sf /persist/hlos_rfs/shared $@/hlos + $(hide) ln -sf /firmware $@/readonly/firmware + +ALL_DEFAULT_INSTALLED_MODULES += $(RFS_MSM_ADSP_SYMLINKS) $(RFS_MSM_MPSS_SYMLINKS) + +WCNSS_INI_SYMLINK := $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini +$(WCNSS_INI_SYMLINK): $(LOCAL_INSTALLED_MODULE) + @echo "WCNSS config ini link: $@" + @mkdir -p $(dir $@) + @rm -rf $@ + $(hide) ln -sf /system/etc/wifi/$(notdir $@) $@ + +WCNSS_MAC_SYMLINK := $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/wlan_mac.bin +$(WCNSS_MAC_SYMLINK): $(LOCAL_INSTALLED_MODULE) + @echo "WCNSS MAC bin link: $@" + @mkdir -p $(dir $@) + @rm -rf $@ + $(hide) ln -sf /persist/$(notdir $@) $@ + +ALL_DEFAULT_INSTALLED_MODULES += $(WCNSS_INI_SYMLINK) $(WCNSS_MAC_SYMLINK) endif diff --git a/tftp.mk b/tftp.mk deleted file mode 100644 index 568f0fa..0000000 --- a/tftp.mk +++ /dev/null @@ -1,66 +0,0 @@ -######################################################################### -# Create Folder Structure -######################################################################### - -$(shell rm -rf $(TARGET_OUT)/rfs/) - -#To be enabled when prepopulation support is needed for the read_write folder -# $(shell rm -rf $(TARGET_OUT_DATA)/rfs/) -# $(shell mkdir -p $(TARGET_OUT_DATA)/rfs/msm/mpss/) -# $(shell mkdir -p $(TARGET_OUT_DATA)/rfs/msm/adsp/) -# $(shell mkdir -p $(TARGET_OUT_DATA)/rfs/mdm/mpss/) -# $(shell mkdir -p $(TARGET_OUT_DATA)/rfs/mdm/adsp/) - -######################################################################### -# MSM Folders -######################################################################### -$(shell mkdir -p $(TARGET_OUT)/rfs/msm/mpss/readonly) -$(shell mkdir -p $(TARGET_OUT)/rfs/msm/adsp/readonly) - -$(shell ln -s /data/tombstones/modem $(TARGET_OUT)/rfs/msm/mpss/ramdumps) -$(shell ln -s /persist/rfs/msm/mpss $(TARGET_OUT)/rfs/msm/mpss/readwrite) -$(shell ln -s /persist/rfs/shared $(TARGET_OUT)/rfs/msm/mpss/shared) -$(shell ln -s /persist/hlos_rfs/shared $(TARGET_OUT)/rfs/msm/mpss/hlos) -$(shell ln -s /firmware $(TARGET_OUT)/rfs/msm/mpss/readonly/firmware) - -$(shell ln -s /data/tombstones/lpass $(TARGET_OUT)/rfs/msm/adsp/ramdumps) -$(shell ln -s /persist/rfs/msm/adsp $(TARGET_OUT)/rfs/msm/adsp/readwrite) -$(shell ln -s /persist/rfs/shared $(TARGET_OUT)/rfs/msm/adsp/shared) -$(shell ln -s /persist/hlos_rfs/shared $(TARGET_OUT)/rfs/msm/adsp/hlos) -$(shell ln -s /firmware $(TARGET_OUT)/rfs/msm/adsp/readonly/firmware) - -######################################################################### -# MDM Folders -######################################################################### -$(shell mkdir -p $(TARGET_OUT)/rfs/mdm/mpss/readonly) -$(shell mkdir -p $(TARGET_OUT)/rfs/mdm/adsp/readonly) -$(shell mkdir -p $(TARGET_OUT)/rfs/mdm/sparrow/readonly) - -$(shell ln -s /data/tombstones/modem $(TARGET_OUT)/rfs/mdm/mpss/ramdumps) -$(shell ln -s /persist/rfs/mdm/mpss $(TARGET_OUT)/rfs/mdm/mpss/readwrite) -$(shell ln -s /persist/rfs/shared $(TARGET_OUT)/rfs/mdm/mpss/shared) -$(shell ln -s /persist/hlos_rfs/shared $(TARGET_OUT)/rfs/mdm/mpss/hlos) -$(shell ln -s /firmware $(TARGET_OUT)/rfs/mdm/mpss/readonly/firmware) - -$(shell ln -s /data/tombstones/lpass $(TARGET_OUT)/rfs/mdm/adsp/ramdumps) -$(shell ln -s /persist/rfs/mdm/adsp $(TARGET_OUT)/rfs/mdm/adsp/readwrite) -$(shell ln -s /persist/rfs/shared $(TARGET_OUT)/rfs/mdm/adsp/shared) -$(shell ln -s /persist/hlos_rfs/shared $(TARGET_OUT)/rfs/mdm/adsp/hlos) -$(shell ln -s /firmware $(TARGET_OUT)/rfs/mdm/adsp/readonly/firmware) - -$(shell ln -s /data/tombstones/sparrow $(TARGET_OUT)/rfs/mdm/sparrow/ramdumps) -$(shell ln -s /persist/rfs/mdm/sparrow $(TARGET_OUT)/rfs/mdm/sparrow/readwrite) -$(shell ln -s /persist/rfs/shared $(TARGET_OUT)/rfs/mdm/sparrow/shared) -$(shell ln -s /persist/hlos_rfs/shared $(TARGET_OUT)/rfs/mdm/sparrow/hlos) -$(shell ln -s /firmware $(TARGET_OUT)/rfs/mdm/sparrow/readonly/firmware) - -######################################################################### -# APQ Folders -######################################################################### -$(shell mkdir -p $(TARGET_OUT)/rfs/apq/gnss/readonly) - -$(shell ln -s /data/tombstones/modem $(TARGET_OUT)/rfs/apq/gnss/ramdumps) -$(shell ln -s /persist/rfs/apq/gnss $(TARGET_OUT)/rfs/apq/gnss/readwrite) -$(shell ln -s /persist/rfs/shared $(TARGET_OUT)/rfs/apq/gnss/shared) -$(shell ln -s /persist/hlos_rfs/shared $(TARGET_OUT)/rfs/apq/gnss/hlos) -$(shell ln -s /firmware $(TARGET_OUT)/rfs/apq/gnss/readonly/firmware)