ANDROID Porting Series Two, configure a new product

Source: Internet
Author: User

ANDROID Porting Series Two, configure a new product

Detailed description

The following steps describe how to configure a new mobile device and product makefile to run Android.

1. Catalog//vendor/Create a company directory

mkdir vendor/<company_name>

2. Create a catalog under the company with which you created the product catalog in step 1.

mkdir vendor/<company_name>/products/

3. Create a product-specific makefile,

Call vendor/<company_name>/products/<first_product_name>.mk , which 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>

4. Additional product-specific variables can be added to this product definition file.

5. In the product catalog, create a androidproducts.mk file to point (and locate the responsible) individual product make files.

#
# This file should set Product_makefiles to a list of PRODUCT makefiles
# to expose to the build system. Local_dir'll already be set to
#
# This file could not be rely on the value of any variable other than
# local_dir; Do is use any conditionals, and does not look up the
# value of any variable that is ' t set in this file or in a file that
# it includes.
#
Product_makefiles: =/
$ (Local_dir)/FIRST_PRODUCT_NAME.MK/

6. Create the Board-specific directory under your company's directory to match the product_device<board_name> reference variable to make the above file in a specific product. This includes any access to product-specific make file using this product.

mkdir vendor/<company_name>/<board_name>

7. Create a directory boardconfig.mk (vendor/<company_name>/<board_name>) that created the file in the previous step.

# These definitions override the defaults in Config/config.make for <board_name>
#
# Target_no_bootloader: = False
#
Target_use_generic_audio: = True

8. If you want to modify the system properties, create a System.prop file your <board_name> directory (vendor/<company_name>/<board_name>).

# 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 add a pointer to <second_product_name>.mk.

Product_makefiles: =/
$ (Local_dir)/FIRST_PRODUCT_NAME.MK/
$ (Local_dir)/second_product_name.mk

10. A android.mk file must be included in the Supplier/<company_name>/<board_name> at least the following code.

#
Local_path: = $ (call My-dir)
#
# 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)
#
#
Local_path: = vendor/<company_name>/<board_name>
#
Include $ (clear_vars)
#
#

11. To create a second product of the same board, create a second 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>

So far, you should have two new products, called <first_product_name> and <company_name> related <second_product_name>. In order to verify that a product is configured correctly (<FIRST_PRODUCT_NAME>, for example), execute the following command:

. build/envsetup.sh
Make Product-<first_product_name>-user

You should find a new build binary file located in out/target/product/<board_name>.

New Product file Tree

The file tree below shows that your own system should complete the above steps.

·<company_name>

O<board_name>

§Android.mk

§                                                                                      product_config.mk

§system.prop

Oproducts

§                                                                                      androidproducts.mk

§                                                                                      <first_product_name>.mk

§<second_product_name>.mk

Product Definition File

Specific product variables are defined in the product definition file. A product definition file can inherit other product definition files, thereby reducing the need to replicate and simplify maintenance.

Variables in the definition file hold products include:

Parameter

Description

Example

Product_Name

The overall product of the end user's visible name. Appears on the "about phone" information.

Product_model

End-user-visible final product name

Product_locales

A space-separated List of Two-letter language code, two-letter country code pairs that describe several settings for the U Ser, such as the UI language and time, date and currency formatting. The first locale listed in Product_locales are 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 is copied to the destination path if building this product. The rules for the copy steps is 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 the 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

The following code snippet demonstrates a typical product definition file.

$ (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 Series Two, configure a new product

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.