Android PRODUCT_COPY_FILES 自动拷贝文件

/**********************************************************************
 *           Android PRODUCT_COPY_FILES 自动拷贝文件
 * 说明:
 *     本文主要记录如何向Android系统中自动添加自己的文件,主要是考虑到
 * 后续需要添加一些自动化脚本,不可能每次都自己手动去添加。
 *
 *                                    2016-4-13 深圳 南山平山村 曾剑锋
 *********************************************************************/

一、参考文档:
    1. Android——编译体系中的【PRODUCT_COPY_FILES】【ALL_PREBUILT】【BUILD_PREBUILT】
        http://blog.csdn.net/jscese/article/details/40615801
    2. android源码编译,怎样用PRODUCT_COPY_FILES 复制一个 文件夹 (注意,是文件夹)到指定目录?
        http://zhidao.baidu.com/link?url=TtHwgcBqnN00zZEn6NQqKDFYqzY2N3m_e57LxAS3jGwFVj1rEwNUbHaE0wWJc87sniqzwxe_NU8nK8QiJw_QrK 

二、板级拷贝:
    1. 查看文件:
        myzr@myzr:~/myandroid/device/fsl/imx6$ ls sabresd_6dq.mk -al
        -rw-rw-r-- 1 myzr myzr 2494 Apr 21 17:31 sabresd_6dq.mk
    2. cat device/fsl/imx6/sabresd_6dq.mk
        # This is a FSL Android Reference Design platform based on i.MX6Q ARD board
        # It will inherit from FSL core product which in turn inherit from Google generic

        $(call inherit-product, device/fsl/imx6/imx6.mk)
        $(call inherit-product-if-exists,vendor/google/products/gms.mk)

        # Overrides
        PRODUCT_NAME := sabresd_6dq
        PRODUCT_DEVICE := sabresd_6dq

        PRODUCT_COPY_FILES += 
            device/fsl/sabresd_6dq/required_hardware.xml:system/etc/permissions/required_hardware.xml 
            device/fsl/sabresd_6dq/init.rc:root/init.freescale.rc 
            device/fsl/sabresd_6dq/vold.fstab:system/etc/vold.fstab 
            device/fsl/sabresd_6dq/gpsreset.sh:system/etc/gpsreset.sh 
            device/fsl/sabresd_6dq/audio_policy.conf:system/etc/audio_policy.conf 
            device/fsl/sabresd_6dq/audio_effects.conf:system/vendor/etc/audio_effects.conf

        # GPU files

        DEVICE_PACKAGE_OVERLAYS := device/fsl/sabresd_6dq/overlay

        PRODUCT_CHARACTERISTICS := tablet

        PRODUCT_AAPT_CONFIG += xlarge large tvdpi hdpi

        PRODUCT_COPY_FILES += 
            frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml 
            frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml 
            frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml 
            frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml 
            frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml 
            frameworks/native/data/etc/android.hardware.faketouch.xml:system/etc/permissions/android.hardware.faketouch.xml 
            frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml 
            frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml 
            frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml 
            frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml

        # for PDK build, include only when the dir exists
        # too early to use $(TARGET_BUILD_PDK)
        ifneq ($(wildcard packages/wallpapers/LivePicker),)
        PRODUCT_COPY_FILES += 
            packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:system/etc/permissions/android.software.live_wallpaper.xml
        endif
原文地址:https://www.cnblogs.com/zengjfgit/p/5417945.html