Android ----制作自己的Vendor
Android源代碼使用一個可定制的編譯系統來生成 特定的,針對自己硬件平臺的Android系統,比方不使用缺省的out/target/prodect/generic文件夾, 本文檔簡介了這個編譯系統,并做一個針對自己硬件平臺的Android, 這部分工作主要是由Android源碼中的Vendor目錄來實現,假設該目錄不成立, 自己能夠在Android源碼的根目錄下建立該目錄,這個目錄里面存放特定的文件,比方自己板子上的3G驅動,WIFI驅動, 自己的應用程序,都能夠放在這里。提取文件系統的時候,能夠把這個目錄里面的東東放到文件系統里面,這樣用戶能夠清晰的 看到你的板子特有的功能。
?
一、細節描寫敘述 以下幾步描寫敘述了怎樣配置makefile來為執行Android的設備編譯系統。 1、在/vendor/文件夾下創建company文件夾 mkdir vendor/<company_name> 2、在company文件夾下創建一個?products文件夾 mkdir vendor/<company_name>/products/ 3、創建一個設備相關的makefile:vendor/<company_name>/products/<first_product_name>.mk這個make文件里至少要包括以下代碼: $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)## OverridesPRODUCT_NAME := <first_product_name>PRODUCT_DEVICE := <board_name> 4、在產品定義文件里加入設備相關的變量。 5、在products文件夾下,創建一個AndroidProducts.mk文件,這個文件指向設備的make文件。## This file should set PRODUCT_MAKEFILES to a list of product makefiles# to expose to the build system. LOCAL_DIR will already be set to# the directory containing this file. ## This file may not rely on the value of any variable other than# LOCAL_DIR; do not use any conditionals, and do not look up the# value of any variable that isn't set in this file or in a file that# it includes.#PRODUCT_MAKEFILES := /$(LOCAL_DIR)/first_product_name.mk / 6、在company文件夾下創建一個包括特定board特征的文件夾,這個文件夾須要與PRODUCT_DEVICE這個變量中的<board_name>相匹配。這個文件夾下會包括一個make文件,這個make文件能夠用以下的方式訪問到,比方: mkdir vendor/<company_name>/<board_name> 7、在上步的文件夾(vendor/<company_name>/<board_name>)下,創建一個BoardConfig.mk文件 # These definitions override the defaults in config/config.make for <board_name>## TARGET_NO_BOOTLOADER := false#TARGET_USE_GENERIC_AUDIO := true 8、假設你想改動系統屬性,在文件夾vendor/<company_name>/<board_name>下創建一個system.prop文件。# system.prop for # This overrides settings in the products/generic/system.prop file## rild.libpath=/system/lib/libreference-ril.so# rild.libargs=-d /dev/ttyS0 9、在products/AndroidProducts.mk文件里加入一個指向<second_product_name>.mk的引用。PRODUCT_MAKEFILES := /$(LOCAL_DIR)/first_product_name.mk /$(LOCAL_DIR)/second_product_name.mk 10、文件夾vendor/<company_name>/<board_name>下必須包括一個Android.mk文件,這個文件里至少包括以下的代碼:# make file for new hardware from #LOCAL_PATH := $(call my-dir)## this is here to use the pre-built kernelifeq ($(TARGET_PREBUILT_KERNEL),)TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernelendif#file := $(INSTALLED_KERNEL_TARGET)ALL_PREBUILT += $(file)$(file): $(TARGET_PREBUILT_KERNEL) | $(ACP)$(transform-prebuilt-to-target)## no boot loader, so we don't need any of that stuff.. #LOCAL_PATH := vendor/<company_name>/<board_name>#include $(CLEAR_VARS)## include more board specific stuff here? Such as Audio parameters. # 11、想為同樣的board創建第二個product時,創建一個名字為vendor/company_name/products/<second_product_name>.mk的make文件,這個文件里包括: $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)## OverridesPRODUCT_NAME := <second_product_name>PRODUCT_DEVICE := <board_name> 眼下為止,你已經有了兩個新product,<first_product_name>和<second_product_name>,都屬于<company_name>。 驗證一下一個product是否配置正確,執行. build/envsetup.shmake PRODUCT-<first_product_name>-user 在/out/target/product/<board_name>文件夾下,你能夠看到生成的二進制文件。二、產品文件樹 沒有翻譯三、product定義文件 不同的產品,在它的product定義文件里會對一些變量賦予不同的值,product定義文件能夠從其他product定義文件里繼承。 Product定義文件里包括的變量例如以下:?
| PRODUCT_NAME | End-user-visible name for the overall product. Appears in the "About the phone" info. | ? |
| PRODUCT_MODEL | End-user-visible name for the end product | ? |
| PRODUCT_LOCALES | A space-separated list of two-letter language code, two-letter country code pairs that describe several settings for the user, such as the UI language and time, date and currency formatting. The first locale listed in PRODUCT_LOCALES is is used if the locale has never been set before. 地區標識 | en_GB de_DE es_ES fr_CA |
| PRODUCT_PACKAGES | Lists the APKs to install. 在這個product中要安裝的APK列表。 | Calendar Contacts |
| PRODUCT_DEVICE | Name of the industrial design 生產商的名字 | dream |
| PRODUCT_MANUFACTURER | Name of the manufacturer 制造商的名字 | acme |
| PRODUCT_BRAND | The brand (e.g., carrier) the software is customized for, if any 軟件定制后的分支標識。 | ? |
| PRODUCT_PROPERTY_OVERRIDES | List of property assignments in the format "key=value" 屬性列表,以"key=value"形式列出。 | ? |
| PRODUCT_COPY_FILES | List of words like?source_path:destination_path. The file at the source path should be copied to the destination path when building this product. The rules for the copy steps are defined in config/Makefile 當編譯時,源路徑上的文件會被拷貝到目標路徑上去,詳細的復制規則在config/Makefile中定義。 | ? |
| PRODUCT_OTA_PUBLIC_KEYS | List of OTA public keys for the product | ? |
| PRODUCT_POLICY | Indicate which policy this product should use | ? |
| PRODUCT_PACKAGE_OVERLAYS | Indicate whether to use default resources or add any product specific overlays | vendor/acme/overlay |
| PRODUCT_CONTRIBUTORS_FILE | HTML file containing the contributors to the project. 包括了項目貢獻者名字列表的HTML文件。 | ? |
| PRODUCT_TAGS | list of space-separated words for a given product | ? |
?
?
?
本博客參考CSDN網友 http://blog.csdn.net/a345017062/archive/2010/12/24/6096807.aspx ,近期自己須要制作Vendor,很須要這種資料,在此感謝網友的博客。轉載于:https://www.cnblogs.com/mfrbuaa/p/4370969.html
總結
以上是生活随笔為你收集整理的Android ----制作自己的Vendor的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Taylor Swift - Red
- 下一篇: Codeforces Round #29