手把手教你深度定製tiny4412安卓5.0系統(一)---開發板如何預置檔案到android系統
阿新 • • 發佈:2019-02-11
想要預置檔案,首先要了解Android原始碼中device這個目,開啟這個目錄我們看到,這個目錄廠家會針對不同的開發板做一些修改:
在這個目錄中,我們看到有不同的廠家定製的資訊,我們這款開發板是友善之壁提供的,那麼我們只要進入friend-arm這個目錄下就可以了,進到這個目錄,看到tiny4412,我們切換進入看到:
要預置相關的檔案,前面有一篇文章專門講過怎麼預置,一般是在device.mk中進行,但是平臺不同,供應商會整合到其它地方:
文章如下,下面我們將參考這篇文章進行預置。
http://blog.csdn.net/morixinguan/article/details/70170641
我們開啟當前的device.mk看下:
我們看到,這個指令碼包含了vendor/friendly-arm/tiny4412/device-tiny4412.mk。$(call inherit-product, device/friendly-arm/tiny4412/device_base.mk) $(call inherit-product-if-exists, hardware/samsung_slsi/exynos4/exynos4.mk) # See comment at the top of this file. This is where the other # half of the device-specific product definition file takes care # of the aspects that require proprietary drivers that aren't # commonly available $(call inherit-product-if-exists, vendor/friendly-arm/tiny4412/device-tiny4412.mk)
於是我們切換到Android原始碼根目錄,找到這個檔案,開啟:
有了前面的經驗,我們知道,預知檔案需要在上邊的PRODUCT_COPY_FILES新增,我們可以把開機動畫相關的檔案預置進去:VENDOR_PATH := vendor/friendly-arm/tiny4412 # Mali PRODUCT_PACKAGES += \ libEGL_mali \ libGLESv1_CM_mali \ libGLESv2_mali \ libMali \ libUMP # gralloc, ion PRODUCT_PACKAGES += \ libsecion \ gralloc.tiny4412 # hwcomposer PRODUCT_PACKAGES += \ hwcomposer.exynos4 # HDMI PRODUCT_PACKAGES += \ libTVOut \ libhdmiclient \ sechdmiservice # Misc other modules PRODUCT_PACKAGES += \ libnetcmdiface # Prebuilts PRODUCT_PACKAGES += \ prebuilt.firmware \ prebuilt.kmodules \ prebuilt.busybox \ prebuilt.gapps \ prebuilt.faapps # FriendlyARM Support PRODUCT_COPY_FILES += \ $(VENDOR_PATH)/proprietary/fa_codec_ctrl:system/vendor/bin/fa_codec_ctrl \ $(VENDOR_PATH)/proprietary/sensors.tiny4412.so:system/lib/hw/sensors.tiny4412.so \ $(VENDOR_PATH)/bootanimation/bootanimation.zip:system/media/bootanimation.zip ifeq ($(BOARD_USES_PWMLIGHTS),false) PRODUCT_COPY_FILES += \ $(VENDOR_PATH)/proprietary/lights.tiny4412.so:system/lib/hw/lights.tiny4412.so endif PRODUCT_PROPERTY_OVERRIDES += \ net.eth0.startonboot=1 -include $(VENDOR_PATH)/wifi/config/config.mk
比如上面我新增的這行:$(VENDOR_PATH)/bootanimation/bootanimation.zip:system/media/bootanimation.zip
bootanimation.zip這個檔案是我自己新增的,bootanimation這個目錄也是我在vendor/friendly-arm/tiny4412/這個目錄下建立的,上面的$(VENDOR_PATH)就是一個環境變數,代表當前路徑。
新增好之後重新編譯Android系統就可以了,這些預置的檔案會被自動拷貝的out目錄下進行打包,一般會打包在system.img裡。
以後,如果要預置檔案到開發板,就可以在這裡進行預置。