我的構建系統是Android 6.0。我正在從源代碼構建AOSP。我想在生成的system.img中包含多個預構建文件。 我知道我可以使用device.mk中的PRODUCT_COPY_FILES來複制預建文件。但是,由於某些原因,我無法修改系統文件。 如何在Android.mk中執行此操作?如何在Android中將多個預建文件添加到system.img中?
例如,我想將test1.txt和test2.txt複製到/ system/etc。我寫下如下的Android.mk。
SMB_CONFIG_FILES := test1.txt test2.txt
SMB_CONFIG_TARGET := $(addprefix $(TARGET_OUT)/etc/, $(SMB_CONFIG_FILES))
ALL_PREBUILT += $(SMB_CONFIG_TARGET)
$(SMB_CONFIG_TARGET) : $(TARGET_OUT)/etc/% : $(LOCAL_PATH)/% | $(ACP)
$(transform-prebuilt-to-target)
然後我跑「製作」建立整個源代碼,但它顯示
build/core/main.mk:517: *** Some files have been added to ALL_PREBUILT.
build/core/main.mk:518: *
build/core/main.mk:519: * ALL_PREBUILT is a deprecated mechanism that
build/core/main.mk:520: * should not be used for new files.
build/core/main.mk:521: * As an alternative, use PRODUCT_COPY_FILES in
build/core/main.mk:522: * the appropriate product definition.
build/core/main.mk:523: * build/target/product/core.mk is the product
build/core/main.mk:524: * definition used in all products.
build/core/main.mk:525: *
build/core/main.mk:526: * unexpected test1.txt in ALL_PREBUILT
build/core/main.mk:526: * unexpected test2.txt in ALL_PREBUILT
build/core/main.mk:527: *
build/core/main.mk:528: *** ALL_PREBUILT contains unexpected files. Stop.
好像我不能在Android 6.0使用ALL_PREBUILT。 我該如何解決這個問題?謝謝。
感謝您的回覆。正如我在我的問題中所描述的,我知道我可以通過使用在目標產品的device.mk中添加的PRODUCT_COPY_FILE來複制文件。但是,由於某些權限原因,我無法更改文件。 –