The Android source code uses a customizable compilation system to generate specific Android systems for its own hardware platform, such as not using the default Out/target/prodect/generic folder.
This document introduces this compilation system and makes an android for its own hardware platform,
This part of the work is mainly by the Android source code in the vendor directory to implement, assuming that the directory is not established,
You can set up the directory in the root directory of Android source code, this directory contains specific files, such as the 3G drive on their own board, WiFi Drive,
Own application, can be put here. When extracting the file system, you can put the contents of this directory into the file system, so that users can clearly
See the unique features of your board.
Detail Description The following steps describe how to configure makefile to compile the system for Android-executed devices. 1. Create a company folder under the/vendor/folder mkdir vendor/<company_name>2, create a products folder under the Company folder mkdir vendor/< COMPANY_NAME>/PRODUCTS/3, create a device-related makefile:vendor/<company_name>/products/<first_product_name>. Mk This make file must include at least the following code: $ (Call Inherit-product, $ (src_target_dir)/product/generic.mk) # # Overrides Product_Name: = <f irst_product_name> Product_device: = <board_name>4, add device-related variables to the product definition file. 5. Under the Products folder, create a androidproducts.mk file that points to the make file for the device. # # This file should set Product_makefiles to a list of PRODUCT makefiles # to expose to the build system. Local_dir'll already is set to # The directory containing this file. # # 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 a folder under the Company folder that includes a specific board feature, which needs to match the <board_name> in this variable product_device. This folder will include a make file that can be used to access, for example: mkdir vendor/<company_name>/<board_name>7, the folder in the previous step (vendor/ <company_name>/<board_name>), create a boardconfig.mk file # These definitions override the defaults in config/ Config.make for <board_name> # # Target_no_bootloader: = False # Target_use_generic_audio: = True8, assuming you want to change system properties, in the text Folder vendor/<company_name>/<board_name> Create a System.prop file. # System.prop for # overrides settings in the Products/generic/system.prop file # # RILD.LIBPATH=/SYSTEM/LIB/LIBR Eference-ril.so # rild.libargs=-d/dev/ttys09, add a pointer to <second_product_name> in the Products/androidproducts.mk file;. A reference to Mk. Product_makefiles: =/$ (LOCAL_DIR)/first_product_name.mk/$ (local_dir)/second_product_name.mk10, folder vendor/<com Pany_name>/<board_name> must include a android.mk file that contains at least the following code: # Make file for new hardware from # Local_path: = $ (call My-dir) ## This is the pre-built kernel ifeq ($ (Target_prebuilt_kernel),) Target_prebuilt_kernel: = $ (Local_path)/ker Nel 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 the that stuff. # Local_path: = vendor/<company_name>/<board_name> # include $ (clear_vars) # # include more board Specifi C Stuff here? Such as Audio parameters. #11, to create a second product for the same board, create a make file named Vendor/company_name/products/<second_product_name>.mk, which includes: $ (call Inherit-product, $ (src_target_dir)/product/generic.mk) # # Overrides Product_Name: = <second_product_name> ; Product_device: = <board_name> So far, you've got two new product,<first_product_name> and <second_product_name> All belong to <company_name>. Verify that a product is configured correctly and executes. build/envsetup.sh make Product-<first_product_name>-user in/out/target/product/<board_name> folder, you will be able to see the binary files that are generated. Product file tree does not translate three, product definition file different products, in its product definition file will give some variables different values, the product definition file can be inherited from other product definition files. The variables included in the product definition file are as follows:
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, describe several settings for the user, such as the UI language and time, date an D currency formatting. The first locale listed in Product_locales are used if the locale has never been set before. region identification |
< Span style= "LINE-HEIGHT:21PX; Font-family:monospace; " >en_gb de_de es_es fr_ca |
product_packages |
lists the APKs to install. in this product Apk list. |
calendar Contacts |
product_device |
manufacturer's name |
< Span style= "LINE-HEIGHT:21PX; Color: #007000; " >dream |
product_manufacturer |
name of the manufacturer manufacturer's name |
< Span style= "LINE-HEIGHT:21PX; Color: #007000; " >acme |
product_brand |
the brand (e.g., carrier) The software is customized For, if any The branch logo after the software customization. |
&NBSP; |
product_property_overrides |
list of property assignments in the Format "Key=value" |
&NBSP; |
product_copy_files |
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 < Span style= "LINE-HEIGHT:21PX; font-family: ' Dejavu Sans '; When compiling, the files on the source path are copied to the target path, and the detailed copy rules are in the config/makefile |
&NBSP; |
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. includes a list of project contributors ' names . HTML file. |
|
Product_tags |
List of space-separated words for a given product |
|
The following gives a classic product definition file $ (call inherit-product, build/target/product/generic.mk)#Overrides Product_Name: = Mydeviceproduct_manufacturer: = Acmeproduct_brand: = Acme_usproduct_ LOCALES: = EN_GB es_es fr_frproduct_package_overlays: = Vendor/acme/overlay
http://blog.csdn.net/a345017062/archive/2010/12/24/6096807.aspx , the recent need to make vendor, very need this information, in this thank Netizens blog.
Android----Make your own vendor