Configure a new product-android compilation system

Source: Internet
Author: User

 

From: http://www.diybl.com/course/3_program/java/android/20110909/560268.html

Http://www.kandroid.org/online-pdk/guide/release_keys.html

Configure a new product

Details
The following steps describe how to configure makefile for new mobile devices and other devices running Android.

1. Create a company directory device/vendor

Mkdir vendor/<company_name>

2. Create a products directory

Mkdir vendor/<company_name>/products/

3. Create a makefile dedicated to product configuration, which is named vendor/<company_name>/products/<first_product_name>. mk. This file includes at least:

$ (Call inherit-product, $ (src_target_dir)/product/generic. mk)
# Overrides
Product_name: = <first_product_name>
Product_device: = <board_name>

4. Add the product variable to the makefile above (for specific variables, see the end of the article)

5. Create androidproducts. mk in the product directory. The MK file indicates your product make file:

# This file shocould set product_makefiles to a list of product makefiles
# To expose to the build system. local_dir will already be set
# The Directory containing this file.
# This file may not rely on the value of any variable other
# Local_dir; do not use any conditionals, and do not look up
# Value of any variable that isn' t set in this file or in a file that
# It nodes .#
Product_makefiles: = \
$ (Local_dir)/first_product_name.mk \

6. Create a directory dedicated to the configuration board under the company directory, which will include a makefile. Any product that uses this board can access this makefile.

Mkdir vendor/<company_name>/<board_name>

7. Create the boardconfig. mk file under the directory created above

# 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

8. If you want to modify system attributes, create the system. Prop file in the <board_name> directory.

# System. Prop
# This overrides settings in the products/generic/system. Prop File
# Rild. libpath =/system/lib/libreference-ril.so
# Rild. libargs =-D/dev/ttys0

9. Add the <second_product_name>. mk pointer to androidproducts. mk.

Product_makefiles: =\$ (local_dir)/first_product_name.mk \ $ (local_dir)/second_product_name.mk

10. In the vendor/<company_name>/<board_name> directory, an android. mk file must contain at least the following content:

# Make file for new hardware from #
Local_path: = $ (call my-DIR)

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. Create the second product for the same board and the second product-specific makefile, called <second_product_name>. mk. This file contains:

$ (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 <second_product_name>. To confirm the correct configuration of this product, run the following statement:
 
. Build/envsetup. Sh
Make product-<first_product_name>-user

You should find the new binary file under/out/target/product/<board_name>.

New product file tree

  • <Company_name>

    • <Board_name>

      • Android. mk
      • Product_config.mk
      • System. Prop
    • Products
      • Androidproducts. mk
      • <First_product_name>. mk
      • <Second_product_name>. mk

Product definition file

Parameter Description Example
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
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 shocould 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 shoshould 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  



The following code snippet describes a typical product definition file.
$ (Call inherit-product, build/target/product/generic. mk)
Product_name: = mydevice
Product_manufacturer: = Acme
Product_brand: = acme_us
Product_locales: = en_GB es_es fr_fr
Product_package_overlays: = vendor/Acme/overlay

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.