android system setup and building (2)
8384 ワード
Configuring a New Product
http://source.android.com/porting/build_new_device.html
Detailed Instructions
次の手順では、新しいモバイルデバイスおよび製品に対してmakefilesを使用してAndroid実行システムを構成する方法について説明します.
1.//vendor/ディレクトリの下に会社ディレクトリを作成します.
mkdir vendor/
2.上に作成した会社カタログの下に製品カタログを作成する
mkdir vendor//products/
3.特定の製品のmakefileを作成します.vendor//products/.mk.このファイルには、少なくとも次のコードが含まれています.
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) # # Overrides PRODUCT_NAME := PRODUCT_DEVICE :=
4.その他の特定の製品の変数定義は、この製品定義(Product Definition:以下、詳細に説明する)ファイル(3で説明する)に追加することができる.
5.productsディレクトリでAndroid Productsを作成する.mkファイル(and is responsible for finding)特定の製品makeファイル(つまり3のファイル)を指定するために使用されます.
コード#コード#
#
# 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.会社名ディレクトリの下に特定のボードレベルディレクトリを作成します.このディレクトリ名は、3の特定の製品のmakefileのPRODUCTV_と一致する必要があります.DEVICE変数値同じです.このディレクトリの下にmakefileファイルが含まれていると、このボードの製品で使用されます.
mkdir vendor
//
7.上記(vendor//)のディレクトリの下にBoardConfigを作成する.mkファイル:
# These definitions override the defaults in config/config.make for # # TARGET_NO_BOOTLOADER := false # TARGET_USE_GENERIC_AUDIO := true
8.システム属性(properties)を変更したい場合は、
# 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..mkポインタ
PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/first_product_name.mk \ $(LOCAL_DIR)/second_product_name.mk
10.
コード#コード#
# 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// # include $(CLEAR_VARS) # # include more board specific stuff here? Such as Audio parameters. #
11.同じボード上に2番目の製品を作成します.この2番目の特定の製品のmake fileファイルの名前は
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) # # Overrides PRODUCT_NAME := PRODUCT_DEVICE :=
これで2つの製品があります.つまり関連付けられた名前はおよび.製品が良好に構成されていることを確認するには、以下のコマンドを実行します(を例に挙げます).
.build/envsetup.shmake PRODUCT--user
そして/out/target/product/ディレクトリの下で新しくコンパイルされたバイナリファイルを生成
New Product File Tree
Product Definition Files
製品固有の変数は、製品説明ファイル(definition files)に定義されます.製品説明ファイルは、他の製品説明ファイルから継承できます.これにより、管理が容易になります(thus reducing the need to copy and simplifying maintenance).
製品説明ファイルには、次の変数が含まれます.
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 is used if the locale has never been set before.
Lists the APKs to install.
Name of the industrial design
Name of the manufacturer
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
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
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_MANUFACTUER :
=
acme
PRODUCT_BRAND :
=
acme_us
PRODUCT_LOCALES :
=
en_GB es_ES fr_FR
PRODUCT_PACKAGE_OVERLAYS :
=
vendor
/
acme
/
overlay
....
http://source.android.com/porting/build_new_device.html
Detailed Instructions
次の手順では、新しいモバイルデバイスおよび製品に対してmakefilesを使用してAndroid実行システムを構成する方法について説明します.
1.//vendor/ディレクトリの下に会社ディレクトリを作成します.
mkdir vendor/
2.上に作成した会社カタログの下に製品カタログを作成する
mkdir vendor/
3.特定の製品のmakefileを作成します.vendor/
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) # # Overrides PRODUCT_NAME :=
4.その他の特定の製品の変数定義は、この製品定義(Product Definition:以下、詳細に説明する)ファイル(3で説明する)に追加することができる.
5.productsディレクトリでAndroid Productsを作成する.mkファイル(and is responsible for finding)特定の製品makeファイル(つまり3のファイル)を指定するために使用されます.
コード#コード#
#
# 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.会社名ディレクトリの下に特定のボードレベルディレクトリを作成します.このディレクトリ名は、3の特定の製品のmakefileのPRODUCTV_と一致する必要があります.DEVICE変数値
mkdir vendor
/
7.上記(vendor/
# These definitions override the defaults in config/config.make for
8.システム属性(properties)を変更したい場合は、
<board_name>
ディレクトリ(6で作成したディレクトリ)の下で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
ファイルに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/
11.同じボード上に2番目の製品を作成します.この2番目の特定の製品のmake fileファイルの名前は
vendor/company_name/products/<second_product_name>.mk
で、次の内容が含まれています.$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) # # Overrides PRODUCT_NAME :=
これで2つの製品があります.つまり
.build/envsetup.shmake PRODUCT-
そして/out/target/product/
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 Files
製品固有の変数は、製品説明ファイル(definition files)に定義されます.製品説明ファイルは、他の製品説明ファイルから継承できます.これにより、管理が容易になります(thus reducing the need to copy and simplifying maintenance).
製品説明ファイルには、次の変数が含まれます.
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 is used if the locale has never been set before.
en_GB de_DE es_ES fr_CA
PRODUCT_PACKAGESLists the APKs to install.
Calendar Contacts
PRODUCT_DEVICEName of the industrial design
dream
PRODUCT_MANUFACTURERName of the manufacturer
acme
PRODUCT_BRANDThe 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/MakefilePRODUCT_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_FILEHTML 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_MANUFACTUER :
=
acme
PRODUCT_BRAND :
=
acme_us
PRODUCT_LOCALES :
=
en_GB es_ES fr_FR
PRODUCT_PACKAGE_OVERLAYS :
=
vendor
/
acme
/
overlay
....