Android --Configuring a New Product
来源:互联网 发布:电信2g网络制式 编辑:程序博客网 时间:2024/05/29 09:32
Detailed Instructions
The steps below describe how to configure makefiles for new mobile devices and products running Android.
- Create a company directory in
//vendor/
.mkdir vendor/<company_name>
- Create a
products
directory beneath the company directory you created in step 1.mkdir vendor/<company_name>/products/
- Create a product-specific makefile, called
vendor/<company_name>/products/<first_product_name>.mk
, that includes at least the following code:$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) # # Overrides PRODUCT_NAME := <first_product_name> PRODUCT_DEVICE := <board_name>
- Additional product-specific variables can be added to this Product Definition file.
- In the
products
directory, create anAndroidProducts.mk
file that point to (and is responsible for finding) the individual product make files.# # 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 \
- Create a board-specific directory beneath your company directory that matches the
PRODUCT_DEVICE
variable<board_name>
referenced in the product-specific make file above. This will include a make file that gets accessed by any product using this board.mkdir vendor/<company_name>/<board_name>
- Create a
BoardConfig.mk
file in the directory created in the previous step (vendor/<company_name>/<board_name>
).# These definitions override the defaults in config/config.make for <board_name> # # TARGET_NO_BOOTLOADER := false # TARGET_HARDWARE_3D := false # TARGET_USE_GENERIC_AUDIO := true
- If you wish to modify system properties, create a
system.prop
file in your<board_name>
directory(vendor/<company_name>/<board_name>
).# 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
- Add a pointer to
<second_product_name>.mk
withinproducts/AndroidProducts.mk
.PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/first_product_name.mk \ $(LOCAL_DIR)/second_product_name.mk
- An
Android.mk
file must be included invendor/<company_name>/<board_name>
with at least the following code:# make file for new hardware from # LOCAL_PATH := $(call my-dir) # # this is here to use the pre-built kernel ifeq ($(TARGET_PREBUILT_KERNEL),) TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernel endif # 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. #
- To create a second product for the same board, create a second product-specific make file called
vendor/company_name/products/<second_product_name>.mk
that includes:$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) # # Overrides PRODUCT_NAME := <second_product_name> PRODUCT_DEVICE := <board_name>
By now, you should have two new products, called <first_product_name>
and <second_product_name>
associated with <company_name>
. To verify that a product is properly configured (<first_product_name>
, for example), execute the following:
. build/envsetup.sh make PRODUCT-<first_product_name>-user
You should find new build binaries located in /out/target/product/<board_name>
.
New Product File Tree
The file tree below illustrates what your own system should look like after completing the steps above.
<company_name>
<board_name>
Android.mk
product_config.mk
system.prop
products
AndroidProducts.mk
<first_product_name>.mk
<second_product_name>.mk
Product Definition Files
Product-specific variables are defined in product definition files. A product definition file can inherit from other product definition files, thus reducing the need to copy and simplifying maintenance.
Variables maintained in a product definition files include:
en_GB de_DE es_ES fr_CA
PRODUCT_PACKAGESLists the APKs to install.Calendar Contacts
PRODUCT_DEVICEName of the industrial designdream
PRODUCT_MANUFACTURERName of the manufactureracme
PRODUCT_BRANDThe brand (e.g., carrier) the software is customized for, if any PRODUCT_PROPERTY_OVERRIDESList of property assignments in the format "key=value" PRODUCT_COPY_FILESList 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 PRODUCT_OTA_PUBLIC_KEYSList of OTA public keys for the product PRODUCT_POLICYIndicate which policy this product should use PRODUCT_PACKAGE_OVERLAYSIndicate whether to use default resources or add any product specific overlaysvendor/acme/overlay
PRODUCT_CONTRIBUTORS_FILEHTML file containing the contributors to the project. PRODUCT_TAGSlist of space-separated words for a given product The snippet below illustrates a typical product definition file.
$(call inherit-product, build/target/product/generic.mk)#OverridesPRODUCT_NAME := MyDevicePRODUCT_MANUFACTURER := acmePRODUCT_BRAND := acme_usPRODUCT_LOCALES := en_GB es_ES fr_FRPRODUCT_PACKAGE_OVERLAYS := vendor/acme/overlay
- Android --Configuring a New Product
- Configuring a New Product
- Configuring a New Product
- Configuring a New Product
- Configuring a New Product
- Configuring a New Product of Android 2.2 Froyo
- android 定制新产品】 定制新设备 (Configuring a New Product)
- 定制新设备 (Configuring a New Product)
- Configuring A New Kernel
- Create a new android product project
- Announcement of a New Product
- a new product:north face winter coats 485
- a new product:north face winter coats 485
- A new way of real-time product costing
- Android studio : Error:Gradle: A problem occurred configuring project
- Configuring a Serial Port
- Configuring a Liferay cluster
- (OK) Adding a New Device - for company build and product teams only
- 函数形参数中,用double还是const double &,这是一个问题。
- LINUX系统移植(史上最全最细,强烈推荐)
- 使用DLL作为插件的设计框架
- Git学习笔记 - 1
- 配上Visual AssistX的VS2008的加强快捷键
- Android --Configuring a New Product
- 【转】备份:Android 常用 mimeType 表
- DEM数据和影像数据下载汇总
- 使用js获得元素的属性值及事件名
- UNIX System V Signals
- C#程序实现动态调用DLL的研究 (入门附代码)
- cairngorm
- 数字油画批发商的亲情“画”语
- ZOJ 1025 Wooden Sticks【非DP做法】