AOSP移植添加设备Device

更新时间:2023-05-07 21:58:59 阅读: 评论:0

AOSP移植添加设备Device
This is a breakdown of the files build/envtup.sh, Makefile and the files they u, which describes how a device is specified and how Android is configured for it.
For each file there are some comments and code lines from the make files or scripts, which describe what they are doing and which files they are using. Also the files which can be ud as an example are prented and the commands how to arch for them.
This text is for developers who want to add a new device or change the configuration of an existing device. This gives some indications which files are involved.
== build/envtup.sh ==
Some functions are defined by calling
<pre>
. build/envtup.sh
</pre>
in the top directory.
Some environment variables are t by calling
<pre>
lunch
</pre>
in the top directory.
<pre>
export TARGET_PRODUCT=variant
export TARGET_SIMULATOR=fal
export TARGET_BUILD_TYPE=relea
</pre>
vendortup.sh is arched at this places:
<pre>
vendor//vendortup.sh
vendor///vendortup.sh
device//*/vendortup.sh
</pre>
== vendortup.sh ==
This file is executed by build/envtup.sh, and can u anything
defined in envtup.sh.
In particular, you can add lunch options with the add_lunch_combo
function:
<pre>
add_lunch_combo full_crespo-urdebug
</pre>
The values of the macros TARGET_PRODUCT and TARGET_BUILD_VARIANT are derived from the option name:
add_lunch_combo TARGET_BUILD_VARIANT
In the above example the resulting values are TARGET_PRODUCT=full_crespo and TARGET_BUILD_VARIANT=urdebug.
The files can be ud as an example:
<pre>
find . -name vendortup.sh
</pre>
<pre>
./device/samsung/crespo/vendortup.sh
./device/samsung/crespo4g/vendortup.sh
./device/htc/passion/vendortup.sh
</pre>
== Makefile ==
Build process is started by calling
<pre>
make
</pre>
in the top directory.
The Makefile calls build/core/main.mk
== build/core/main.mk ==
Set up various standard variables bad on configuration and host information.
<pre>
include $(BUILD_SYSTEM)/config.mk
</pre>
This allows us to force a clean build - included after the config.make
environment tup is done, but before we generate any dependencies. This
file does the rm -rf inline so the deps which are all done below will
be generated correctly
<pre>
include $(BUILD_SYSTEM)/cleanbuild.mk
</pre>
The are the modifier targets that don't do anything themlves, but
change the behavior of the build.
(must be defined before including definitions.make)
<pre>
INTERNAL_MODIFIER_TARGETS := showcommands checkbuild all
</pre>
Bring in standard build system definitions.
<pre>
include $(BUILD_SYSTEM)/definitions.mk
</pre>
== build/core/config.mk ==
Various mappings to avoid hard-coding paths all over the place
<pre>
include $(BUILD_SYSTEM)/pathmap.mk
</pre>
Try to include buildspec.mk, which will try to t stuff up.
If this file doesn't exist, the environemnt variables will
be ud, and if that doesn't work, then the default is an
arm build
<pre>
-
include $(TOPDIR)buildspec.mk
</pre>
Define most of the global variables. The are the ones that
are specific to the ur's build configuration.
<pre>
include $(BUILD_SYSTEM)/envtup.mk
</pre>
Search for BoardConfig.mk in
(TARGET_DEVICE)/BoardConfig.mk
device/*/(TARGET_DEVICE)/BoardConfig.mk and load the file
<pre>
include $(board_config_mk)
</pre>
<pre>
include $(BUILD_SYSTEM)/dumpvar.mk
</pre>
== BoardConfig.mk ==
The files can be ud as an example:
<pre>
find . -name BoardConfig.mk
</pre>
<pre>
.
/device/samsung/crespo/BoardConfig.mk
./device/samsung/crespo4g/BoardConfig.mk
./device/htc/passion/BoardConfig.mk
./build/target/board/generic/BoardConfig.mk
./build/target/board/generic_x86/BoardConfig.mk
./build/target/board/emulator/BoardConfig.mk
./build/target/board/sim/BoardConfig.mk
</pre>
== build/buildspec.mk.default ==
This is a do-nothing template file. To u it, copy it to a file
named "buildspec.mk" in the root directory, and uncomment or change the variables necessary for your desired configuration. The file "buildspec.mk" should never be checked in to source control.
Choo a product to build for. Look in the products directory for ones that work.
TARGET_PRODUCT
Choo a variant to build. If you don't pick one, the default is eng. Ur is what we ship.
Urdebug is that, with a few flags turned on
for debugging.
Eng has lots of extra tools for development.
TARGET_BUILD_VARIANT
CUSTOM_MODULES
TARGET_SIMULATOR
Set this to debug or relea if you care. Otherwi, it defaults to relea for arm and debug for the simulator.
TARGET_BUILD_TYPE
HOST_BUILD_TYPE
DEBUG_MODULE_ModuleName
TARGET_TOOLS_PREFIX
HOST_CUSTOM_DEBUG_CFLAGS
TARGET_CUSTOM_DEBUG_CFLAGS
CUSTOM_LOCALES
OUT_DIR
ADDITIONAL_BUILD_PROPERTIES
NO_FALLBACK_FONT
WEBCORE_INSTRUMENTATION
ENABLE_SVG
BUILD_ENV_SEQUENCE_NUMBER
== build/envtup.mk ==
Set up version information.
<pre>
include $(BUILD_SYSTEM)/version_defaults.mk
</pre>
If you update the build system such that the environment tup or buildspec.mk need to be updated, increment this number, and people who haven't re-run tho will have to do so before they can build. Make sure to also update the corresponding value in buildspec.mk.default and envtup.sh.
<pre>
CORRECT_BUILD_ENV_SEQUENCE_NUMBER := 10
</pre>
<pre>
include $(BUILD_SYSTEM)/product_config.mk
</pre>
TARGET_PRODUCT: sim full
TARGET_BUILD_VARIANT: eng ur urdebug tests
== build/core/version_defaults.mk ==
Handle various build version information.
Guarantees that the following are defined:
PLATFORM_VERSION
PLATFORM_SDK_VERSION
PLATFORM_VERSION_CODENAME
DEFAULT_APP_TARGET_SDK
BUILD_ID
BUILD_NUMBER
Look for an optional file
(BUILD_SYSTEM)/build_id.mk
</pre>
== build/core/build_id.mk ==
BUILD_ID is usually ud to specify the branch name

本文发布于:2023-05-07 21:58:59,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/867149.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:设备   移植   添加
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图