Configuring a New Product

一、细节描述

下面几步描述了如何配置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)
  #
  # Overrides
  PRODUCT_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 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.      
  #
11、想为相同的board创建第二个product时,创建一个名字为vendor/company_name/products/<second_product_name>.mk的make文件,这个文件中包含:
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
  #
  # Overrides
  PRODUCT_NAME := <second_product_name>
  PRODUCT_DEVICE := <board_name>
目前为止,你已经有了两个新product,<first_product_name>和<second_product_name>,都属于<company_name>。
验证一下一个product是否配置正确,运行
  . build/envsetup.sh
  make PRODUCT-<first_product_name>-user
在/out/target/product/<board_name>目录下,你可以看到生成的二进制文件。

二、产品文件树
没有翻译

三、product定义文件
不同的产品,在它的product定义文件中会对一些变量赋予不同的值,product定义文件可以从其它product定义文件中继承。
Product定义文件中包含的变量如下:

Parameter

Description

Example

PRODUCT_NAME

End-user-visiblename for the overall product. Appears in the "About thephone" info.

 

PRODUCT_MODEL

End-user-visiblename for the end product

 

PRODUCT_LOCALES

A space-separatedlist of two-letter language code, two-letter country code pairsthat describe several settings for the user, such as the UIlanguage and time, date and currency formatting. The first localelisted in PRODUCT_LOCALES is is used if the locale has never beenset before.

地区标识

en_GBde_DE es_ES fr_CA

PRODUCT_PACKAGES

Lists the APKs toinstall.

在这个product中要安装的APK列表。

CalendarContacts

PRODUCT_DEVICE

Name of theindustrial design

生产商的名字

dream

PRODUCT_MANUFACTURER

Name of themanufacturer

制造商的名字

acme

PRODUCT_BRAND

The brand (e.g.,carrier) the software is customized for, if any

软件定制后的分支标识。

 

PRODUCT_PROPERTY_OVERRIDES

List of propertyassignments in the format "key=value"

属性列表,以"key=value"形式列出。

 

PRODUCT_COPY_FILES

List of wordslike source_path:destination_path.The file at the source path should be copied to the destinationpath when building this product. The rules for the copy steps aredefined in config/Makefile

当编译时,源路径上的文件会被复制到目标路径上去,具体的复制规则在config/Makefile中定义。

 

PRODUCT_OTA_PUBLIC_KEYS

List of OTApublic keys for the product

 

PRODUCT_POLICY

Indicate whichpolicy this product should use

 

PRODUCT_PACKAGE_OVERLAYS

Indicate whetherto use default resources or add any product specific overlays

vendor/acme/overlay

PRODUCT_CONTRIBUTORS_FILE

HTML filecontaining the contributors to the project.

包含了项目贡献者名字列表的HTML文件。

 

PRODUCT_TAGS

list ofspace-separated words for a given product

 
下面给出了一个经典的product定义文件
$(call inherit-product, build/target/product/generic.mk)

#Overrides
PRODUCT_NAME := MyDevice
PRODUCT_MANUFACTURER := acme
PRODUCT_BRAND := acme_us
PRODUCT_LOCALES := en_GB es_ES fr_FR
PRODUCT_PACKAGE_OVERLAYS := vendor/acme/overlay

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 很抱歉,您遇到了这个问题。这个错误提示通常是在安装或配置软件时出现的。这可能是由于许多不同的原因造成的,例如配置文件的错误设置、缺少依赖项、权限问题等。 要解决此问题,您可以尝试以下几种方法: 1. 检查您的配置文件是否正确设置,并确保您已经安装了所需的依赖项。 2. 确保您有足够的权限来访问所需的文件和目录。您可以尝试使用sudo命令来运行程序,以便获得管理员权限。 3. 查看程序的日志文件以了解更多信息。日志文件通常包含有关错误原因的详细信息,帮助您更好地诊断问题。 4. 如果您仍然无法解决问题,请尝试在相关的技术论坛或社区中寻求帮助。您可能会得到更多的建议和指导。 希望这些方法能够帮助您解决问题。如果您需要进一步的帮助,请告诉我更多细节,我会尽力回答您的问题。 ### 回答2: "A problem occurred configuring" 是一个英语短语,指的是在配置过程中出现了问题。它通常用于描述在软件安装、网络设置或设备连接等过程中遇到的困难或错误。 这个问题的具体原因可能有很多种。可能是由于错误的输入、配置文件的损坏、网络连接的故障、设备驱动程序的不兼容性或其他未知的技术问题。 解决这个问题的方法取决于具体的情况。首先,我们应该检查输入是否准确且符合要求,确保所有的配置选项都正确填写。如果是配置文件损坏,在备份的前提下,我们可以尝试使用备份文件进行修复。如果是网络连接问题,我们可以检查线缆连接、路由器设置或尝试重新启动网络设备。如果是设备驱动程序不兼容性,我们可以尝试更新或更换驱动程序。 此外,查找错误信息和日志文件也是解决问题的关键。这些信息通常会提供有关具体问题的详细信息,从而指导我们采取正确的行动。我们可以在互联网上搜索类似的问题和解决方案,或者寻求专业人士的帮助。 总之,在遇到配置问题时,我们应该耐心且仔细地诊断问题,并采取适当的解决方案。通过正确的操作和合理的解决方案,我们通常能够成功解决配置问题并继续进行正常的操作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值