ANDROID Porting系列二、配置一个新产品

详细说明

下面的步骤描述了如何配置新的移动设备和产品的makefile运行android。

1.         目录//vendor/创建一个公司目录

  mkdir vendor/<company_name>

2.         创建一个目录下的公司与您在步骤1中创建产品目录.

  mkdir vendor/<company_name>/products/

3.         创建一个特定于产品的 makefile,

调用 vendor/<company_name>/products/<first_product_name>.mk, 这至少包括以下代码:

  $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
  #
  # Overrides
  PRODUCT_NAME := <first_product_name>
  PRODUCT_DEVICE := <board_name>

4.         附加产品特定的变量可以被添加到这个Product Definition文件.

5.         在产品目录中,创建一个AndroidProducts.mk文件指向(并找到负责)个别产品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 /

6.         创建board-specific目录下贵公司的目录与相匹配的PRODUCT_DEVICE<board_name>引用变量在特定产品作出上述文件。这包括任何使用本产品访问product-specific make file.

  mkdir vendor/<company_name>/<board_name>

7.         创建一个在上一步中创建文件的目录BoardConfig.mk (vendor/<company_name>/<board_name>).

  # These definitions override the defaults in config/config.make for <board_name>
  #
  # TARGET_NO_BOOTLOADER := false
  #
  TARGET_USE_GENERIC_AUDIO := true

8.         如果你想修改系统属性,创建一个system.prop文件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

9.         products/AndroidProducts.mk添加一个指向<second_product_name>.mk,.

  PRODUCT_MAKEFILES := /
    $(LOCAL_DIR)/first_product_name.mk /
    $(LOCAL_DIR)/second_product_name.mk

10.     一个Android.mk文件必须包含在供应商/ <company_name> / <board_name>至少有下面的代码.

  # 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.     要创建一个相同的板第二个产品,创建第二个product-specific make file called vendor/company_name/products/<second_product_name>.mkthat includes:

  $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
  #
  # Overrides
  PRODUCT_NAME := <second_product_name>
  PRODUCT_DEVICE := <board_name>

到现在为止,你应该有两个新产品,名为<first_product_name>和<company_name>相关<second_product_name>。为了验证一个产品是正确配置(<first_product_name>,例如),执行以下命令:

  . build/envsetup.sh
  make PRODUCT-<first_product_name>-user

你应该找到新的建设二进制文件位于out/target/product/<board_name>。

新产品文件树

该文件树下面说明你自己的系统应该完成上述步骤。

·                                 <company_name>

o                                                        <board_name>

§                                                                                 Android.mk

§                                                                                 product_config.mk

§                                                                                 system.prop

o                                                        products

§                                                                                 AndroidProducts.mk

§                                                                                 <first_product_name>.mk

§                                                                                 <second_product_name>.mk

产品定义文件

特定产品的变量定义在产品定义文件。一个产品的定义文件可以继承其他产品定义文件,从而减少了需要复制和简化维护。

变量在定义文件保持产品包括:

Parameter

Description

Example

PRODUCT_NAME

最终用户可见名称的整体产品。出现在“关于手机”信息。

PRODUCT_MODEL

最终用户可见的最终产品名称

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.

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"

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

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.

PRODUCT_TAGS

list of space-separated words for a given 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

ANDROID Porting系列二、配置一个新产品的更多相关文章

  1. 学习ASP.NET Core Blazor编程系列二——第一个Blazor应用程序(中)

    学习ASP.NET Core Blazor编程系列一--综述 学习ASP.NET Core Blazor编程系列二--第一个Blazor应用程序(上) 四.创建一个Blazor应用程序 1. 第一种创 ...

  2. Android Studio复制项目作为一个新的工程

    Android Studio复制项目作为一个新的工程 等待..... 好了 可能会安装失败 Failed to finalize session : INSTALL_FAILED_INVALID_AP ...

  3. NEXT | 不错过任何一个新产品

    NEXT | 不错过任何一个新产品 NEXT 不错过任何一个新产品

  4. 学习ASP.NET Core Blazor编程系列二——第一个Blazor应用程序(下)

    学习ASP.NET Core Blazor编程系列一--综述 学习ASP.NET Core Blazor编程系列二--第一个Blazor应用程序(上) 学习ASP.NET Core Blazor编程系 ...

  5. 学习ASP.NET Core Blazor编程系列二——第一个Blazor应用程序(完)

    学习ASP.NET Core Blazor编程系列一--综述 学习ASP.NET Core Blazor编程系列二--第一个Blazor应用程序(上) 学习ASP.NET Core Blazor编程系 ...

  6. C#制作Windows service服务系列二:演示一个定期执行的windows服务及调试(windows service)

    系列一: 制作一个可安装.可启动.可停止.可卸载的Windows service(downmoon原创) 系列二:演示一个定期执行的windows服务及调试(windows service)(down ...

  7. Android画图系列(二)——自己定义View绘制基本图形

    这个系列主要是介绍下Android自己定义View和Android画图机制.自己能力有限.假设在介绍过程中有什么错误.欢迎指正 前言 在上一篇Android画图系列(一)--自己定义View基础中我们 ...

  8. Android集成一个新产品时,lunch的product name和device name注意事项

    Android系统lunch一个当前的Product大概流程包括下面几个部分: 1. lunch确定TARGET_PRODUCT.一般位于vendor/device/build/target/prod ...

  9. ANDROID Porting系列一、ANDROID编译系统

    译自:http://source.android.com/porting/build_system.html Android使用一个自定义生成系统生成工具,二进制文件和文档.本文档提供了一个建立And ...

随机推荐

  1. oracle插入数据报错ORA-26026

    今天进行数据清理时发现报错ORA-26026,主要是把从交易库提取数据并插入到归档库中. 检查一下发现是归档库的索引问题. 当时为了提高插入速度,所以删除了归档库的索引,可能对主键索引产生了影响. 解 ...

  2. ios开发中MVC模式的理解

    MVC是80年代出现的一种软件设计模式,是模型(model),视图(view)和控制(Controller)的缩写. 其中Model的主要功能包括业务逻辑的处理以及数据的访问,这是应用程序的主体部分. ...

  3. iOS与服务器端 GZip压缩问题

    昨天搞了一天的GZip压缩,试了三种方式(libz库,ZipArchive,ASIHttpRequest),一开始都不成功.理论上三个应该都能用的,但我都不行.等我试到第三种方式的时候才知道,不是我的 ...

  4. DOM&SAX解析XML

    在上一篇随笔中分析了xml以及它的两种验证方式.我们有了xml,但是里面的内容要怎么才能得到呢?如果得不到的话,那么还是没用的,解析xml的方式主要有DOM跟SAX,其中DOM是W3C官方的解析方式, ...

  5. Windows Phone 之文件下载进度和速度显示

    用http协议来下载网络上的文件,通常我们需要获取文件的下载进度和下载的速度来给用户等待过程的一个交代,那么在windows phone 7下可以使用WebClient类来实现这一功能,HttpWeb ...

  6. ASP.NET中扩展FileUpload的上传文件的容量

    ASP.NET中扩展FileUpload只能上传小的文件,大小在4MB以内的.如果是上传大一点的图片类的可以在web.config里面扩展一下大小,代码如下 <system.web> &l ...

  7. A transition animation compatible Library.

    Android5.0之后为我们提供了许多炫酷的界面过渡效果,其中共享元素过渡也是很有亮点的一个效果,但这个效果只能在Android5.0之后使用,那今天我们就来将共享元素过渡效果兼容到Android4 ...

  8. phpmyadmin数据导入最大限制的解决方法

    mysql导入文件最大限制更改解决方法:phpmyadmin库导入出错:You probably tried to upload too large file. Please refer to doc ...

  9. C# 数据结构 线性表(顺序表 链表 IList 数组)

    线性表 线性表是最简单.最基本.最常用的数据结构.数据元素 1 对 1的关系,这种关系是位置关系. 特点 (1)第一个元素和最后一个元素前后是没有数据元素,线性表中剩下的元素是近邻的,前后都有元素. ...

  10. button 垂直分布

    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];//button的类型 button.frame = CGRectMak ...