<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://elinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://elinux.org/api.php?action=feedcontributions&amp;user=Jkes&amp;feedformat=atom</id>
		<title>eLinux.org - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/api.php?action=feedcontributions&amp;user=Jkes&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/Special:Contributions/Jkes"/>
		<updated>2013-05-25T16:10:51Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.22alpha</generator>

	<entry>
		<id>http://elinux.org/Android_Device</id>
		<title>Android Device</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Android_Device"/>
				<updated>2011-06-10T21:21:12Z</updated>
		
		<summary type="html">&lt;p&gt;Jkes: Breakdown how a device is specified and how Android is configured for it. Also add a new device specification to Android.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a breakdown of the files build/envsetup.sh, Makefile and the files they use, which describes how a device is specified and how Android is configured for it.&lt;br /&gt;
&lt;br /&gt;
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 used as an example are presented and the commands how to search for them.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== build/envsetup.sh ==&lt;br /&gt;
&lt;br /&gt;
Some functions are defined by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
. build/envsetup.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the top directory.&lt;br /&gt;
&lt;br /&gt;
Some environment variables are set by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lunch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the top directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TARGET_PRODUCT=$product&lt;br /&gt;
export TARGET_BUILD_VARIANT=$variant&lt;br /&gt;
export TARGET_SIMULATOR=false&lt;br /&gt;
export TARGET_BUILD_TYPE=release&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vendorsetup.sh is searched at this places:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vendor/*/vendorsetup.sh &lt;br /&gt;
vendor/*/*/vendorsetup.sh &lt;br /&gt;
device/*/*/vendorsetup.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vendorsetup.sh ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This file is executed by build/envsetup.sh, and can use anything&lt;br /&gt;
defined in envsetup.sh.&lt;br /&gt;
&lt;br /&gt;
In particular, you can add lunch options with the add_lunch_combo&lt;br /&gt;
function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add_lunch_combo full_crespo-userdebug&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values of the macros TARGET_PRODUCT and TARGET_BUILD_VARIANT are derived from the option name: add_lunch_combo $TARGET_PRODUCT-$TARGET_BUILD_VARIANT&amp;lt;br/&amp;gt;&lt;br /&gt;
In the above example the resulting values are TARGET_PRODUCT=full_crespo and TARGET_BUILD_VARIANT=userdebug.&lt;br /&gt;
&lt;br /&gt;
These files can be used as an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find . -name vendorsetup.sh &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./device/samsung/crespo/vendorsetup.sh&lt;br /&gt;
./device/samsung/crespo4g/vendorsetup.sh&lt;br /&gt;
./device/htc/passion/vendorsetup.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Makefile ==&lt;br /&gt;
&lt;br /&gt;
Build process is started by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the top directory.&lt;br /&gt;
&lt;br /&gt;
The Makefile calls build/core/main.mk&lt;br /&gt;
&lt;br /&gt;
== build/core/main.mk ==&lt;br /&gt;
&lt;br /&gt;
Set up various standard variables based on configuration and host information.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include $(BUILD_SYSTEM)/config.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows us to force a clean build - included after the config.make&lt;br /&gt;
environment setup is done, but before we generate any dependencies.  This&lt;br /&gt;
file does the rm -rf inline so the deps which are all done below will&lt;br /&gt;
be generated correctly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include $(BUILD_SYSTEM)/cleanbuild.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are the modifier targets that don't do anything themselves, but&lt;br /&gt;
change the behavior of the build.&lt;br /&gt;
(must be defined before including definitions.make)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
INTERNAL_MODIFIER_TARGETS := showcommands checkbuild all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bring in standard build system definitions.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include $(BUILD_SYSTEM)/definitions.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== build/core/config.mk ==&lt;br /&gt;
&lt;br /&gt;
Various mappings to avoid hard-coding paths all over the place&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include $(BUILD_SYSTEM)/pathmap.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try to include buildspec.mk, which will try to set stuff up.&lt;br /&gt;
If this file doesn't exist, the environemnt variables will&lt;br /&gt;
be used, and if that doesn't work, then the default is an&lt;br /&gt;
arm build&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-include $(TOPDIR)buildspec.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define most of the global variables.  These are the ones that&lt;br /&gt;
are specific to the user's build configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include $(BUILD_SYSTEM)/envsetup.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search for BoardConfig.mk in &amp;lt;br/&amp;gt;&lt;br /&gt;
$(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk  &amp;lt;br/&amp;gt;&lt;br /&gt;
		device/*/$(TARGET_DEVICE)/BoardConfig.mk &amp;lt;br/&amp;gt;&lt;br /&gt;
		vendor/*/$(TARGET_DEVICE)/BoardConfig.mk  &amp;lt;br/&amp;gt;&lt;br /&gt;
and load the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 include $(board_config_mk)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 include $(BUILD_SYSTEM)/dumpvar.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BoardConfig.mk ==&lt;br /&gt;
&lt;br /&gt;
These files can be used as an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find . -name BoardConfig.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./device/samsung/crespo/BoardConfig.mk&lt;br /&gt;
./device/samsung/crespo4g/BoardConfig.mk&lt;br /&gt;
./device/htc/passion/BoardConfig.mk&lt;br /&gt;
./build/target/board/generic/BoardConfig.mk&lt;br /&gt;
./build/target/board/generic_x86/BoardConfig.mk&lt;br /&gt;
./build/target/board/emulator/BoardConfig.mk&lt;br /&gt;
./build/target/board/sim/BoardConfig.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== build/buildspec.mk.default ==&lt;br /&gt;
&lt;br /&gt;
This is a do-nothing template file.  To use it, copy it to a file&lt;br /&gt;
named &amp;quot;buildspec.mk&amp;quot; in the root directory, and uncomment or change&lt;br /&gt;
the variables necessary for your desired configuration.  The file&lt;br /&gt;
&amp;quot;buildspec.mk&amp;quot; should never be checked in to source control.&lt;br /&gt;
&lt;br /&gt;
Choose a product to build for.  Look in the products directory for ones&lt;br /&gt;
that work.&amp;lt;br/&amp;gt;&lt;br /&gt;
TARGET_PRODUCT&lt;br /&gt;
&lt;br /&gt;
Choose a variant to build.  If you don't pick one, the default is eng.&amp;lt;br/&amp;gt;&lt;br /&gt;
User is what we ship.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Userdebug is that, with a few flags turned on&lt;br /&gt;
for debugging.  &amp;lt;br/&amp;gt;&lt;br /&gt;
Eng has lots of extra tools for development.&amp;lt;br/&amp;gt;&lt;br /&gt;
TARGET_BUILD_VARIANT&lt;br /&gt;
&lt;br /&gt;
CUSTOM_MODULES&amp;lt;br/&amp;gt;&lt;br /&gt;
TARGET_SIMULATOR&lt;br /&gt;
&lt;br /&gt;
Set this to debug or release if you care.  Otherwise, it defaults to&lt;br /&gt;
release for arm and debug for the simulator.&amp;lt;br/&amp;gt;&lt;br /&gt;
TARGET_BUILD_TYPE&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
HOST_BUILD_TYPE&amp;lt;br/&amp;gt;&lt;br /&gt;
DEBUG_MODULE_ModuleName&amp;lt;br/&amp;gt;&lt;br /&gt;
TARGET_TOOLS_PREFIX&amp;lt;br/&amp;gt;&lt;br /&gt;
HOST_CUSTOM_DEBUG_CFLAGS&amp;lt;br/&amp;gt;&lt;br /&gt;
TARGET_CUSTOM_DEBUG_CFLAGS&amp;lt;br/&amp;gt;&lt;br /&gt;
CUSTOM_LOCALES&amp;lt;br/&amp;gt;&lt;br /&gt;
OUT_DIR&amp;lt;br/&amp;gt;&lt;br /&gt;
ADDITIONAL_BUILD_PROPERTIES&amp;lt;br/&amp;gt;&lt;br /&gt;
NO_FALLBACK_FONT&amp;lt;br/&amp;gt;&lt;br /&gt;
WEBCORE_INSTRUMENTATION&amp;lt;br/&amp;gt;&lt;br /&gt;
ENABLE_SVG&amp;lt;br/&amp;gt;&lt;br /&gt;
BUILD_ENV_SEQUENCE_NUMBER&lt;br /&gt;
&lt;br /&gt;
== build/envsetup.mk ==&lt;br /&gt;
&lt;br /&gt;
Set up version information.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include $(BUILD_SYSTEM)/version_defaults.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you update the build system such that the environment setup&lt;br /&gt;
or buildspec.mk need to be updated, increment this number, and&lt;br /&gt;
people who haven't re-run those will have to do so before they&lt;br /&gt;
can build.  Make sure to also update the corresponding value in&lt;br /&gt;
buildspec.mk.default and envsetup.sh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CORRECT_BUILD_ENV_SEQUENCE_NUMBER := 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include $(BUILD_SYSTEM)/product_config.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TARGET_PRODUCT: sim  full &amp;lt;br/&amp;gt;&lt;br /&gt;
TARGET_BUILD_VARIANT: eng user userdebug tests&lt;br /&gt;
&lt;br /&gt;
== build/core/version_defaults.mk ==&lt;br /&gt;
&lt;br /&gt;
Handle various build version information.&lt;br /&gt;
&lt;br /&gt;
Guarantees that the following are defined:&amp;lt;br/&amp;gt;&lt;br /&gt;
PLATFORM_VERSION&amp;lt;br/&amp;gt;&lt;br /&gt;
PLATFORM_SDK_VERSION&amp;lt;br/&amp;gt;&lt;br /&gt;
PLATFORM_VERSION_CODENAME&amp;lt;br/&amp;gt;&lt;br /&gt;
DEFAULT_APP_TARGET_SDK&amp;lt;br/&amp;gt;&lt;br /&gt;
BUILD_ID&amp;lt;br/&amp;gt;&lt;br /&gt;
BUILD_NUMBER&lt;br /&gt;
&lt;br /&gt;
Look for an optional file $(BUILD_SYSTEM)/build_id.mk containing overrides of the defaults &amp;lt;br/&amp;gt;&lt;br /&gt;
INTERNAL_BUILD_ID_MAKEFILE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include $(BUILD_SYSTEM)/build_id.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== build/core/build_id.mk ==&lt;br /&gt;
&lt;br /&gt;
BUILD_ID is usually used to specify the branch name&amp;lt;br/&amp;gt;&lt;br /&gt;
BUILD_ID&lt;br /&gt;
&lt;br /&gt;
DISPLAY_BUILD_NUMBER&lt;br /&gt;
&lt;br /&gt;
== build/product_config.mk ==&lt;br /&gt;
&lt;br /&gt;
Provide &amp;quot;PRODUCT-&amp;lt;prodname&amp;gt;-&amp;lt;goal&amp;gt;&amp;quot; targets, which lets you build&lt;br /&gt;
a particular configuration without needing to set up the environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TARGET_PRODUCT := $(word 1,$(product_goals))&lt;br /&gt;
TARGET_BUILD_VARIANT := $(word 2,$(product_goals))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Provide &amp;quot;APP-&amp;lt;appname&amp;gt;&amp;quot; targets, which lets you build&lt;br /&gt;
an unbundled app.&lt;br /&gt;
&lt;br /&gt;
Include the product definitions.&lt;br /&gt;
We need to do this to translate TARGET_PRODUCT into its&lt;br /&gt;
underlying TARGET_DEVICE before we start defining any rules.&lt;br /&gt;
&lt;br /&gt;
PRODUCT_DEVICE is defined in the product file $(TARGET_PRODUCT).mk.&amp;lt;br/&amp;gt;&lt;br /&gt;
The product file $(TARGET_PRODUCT).mk is searched in the list of product make files $(PRODUCT_MAKEFILES).&amp;lt;br/&amp;gt;&lt;br /&gt;
PRODUCT_MAKEFILES is set in AndroidProducts.mk files. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$(call import-products,$(call get-product-makefiles,&lt;br /&gt;
      $(SRC_TARGET_DIR)/product/AndroidProducts.mk))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Convert a short name like &amp;quot;sooner&amp;quot; into the path to the product&lt;br /&gt;
file defining that product.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
INTERNAL_PRODUCT := $(call resolve-short-product-name, $(TARGET_PRODUCT))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TARGET_DEVICE := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEVICE)&lt;br /&gt;
PRODUCT_LOCALES := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_LOCALES))&lt;br /&gt;
PRODUCT_BRAND&lt;br /&gt;
PRODUCT_MODEL&lt;br /&gt;
PRODUCT_MANUFACTURER&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRODUCT_OTA_PUBLIC_KEYS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== AndroidProducts.mk ==&lt;br /&gt;
&lt;br /&gt;
This file should set PRODUCT_MAKEFILES to a list of product makefiles&lt;br /&gt;
to expose to the build system.  LOCAL_DIR will already be set to&lt;br /&gt;
the directory containing this file.&lt;br /&gt;
&lt;br /&gt;
This file may not rely on the value of any variable other than&lt;br /&gt;
LOCAL_DIR; do not use any conditionals, and do not look up the&lt;br /&gt;
value of any variable that isn't set in this file or in a file that&lt;br /&gt;
it includes.&lt;br /&gt;
&lt;br /&gt;
File device/samsung/crespo/AndroidProducts.mk&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRODUCT_MAKEFILES := \&lt;br /&gt;
    $(LOCAL_DIR)/full_crespo.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These files can be used as an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find . -name AndroidProducts.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./device/sample/products/AndroidProducts.mk&lt;br /&gt;
./device/samsung/crespo/AndroidProducts.mk&lt;br /&gt;
./device/samsung/crespo4g/AndroidProducts.mk&lt;br /&gt;
./device/htc/passion/AndroidProducts.mk&lt;br /&gt;
./build/target/product/AndroidProducts.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command which returns the list of all AndroidProducts.mk files is defined in build/core/product.mk :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define _find-android-products-files&lt;br /&gt;
$(shell test -d device &amp;amp;&amp;amp; find device -maxdepth 6 -name AndroidProducts.mk) \&lt;br /&gt;
  $(shell test -d vendor &amp;amp;&amp;amp; find vendor -maxdepth 6 -name AndroidProducts.mk) \&lt;br /&gt;
  $(SRC_TARGET_DIR)/product/AndroidProducts.mk&lt;br /&gt;
endef&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Product Files ==&lt;br /&gt;
&lt;br /&gt;
Search for the files which can be used as an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
grep -R PRODUCT_DEVICE device build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
device/samsung/crespo/full_crespo.mk:PRODUCT_DEVICE := crespo&lt;br /&gt;
device/samsung/crespo4g/full_crespo4g.mk:PRODUCT_DEVICE := crespo4g&lt;br /&gt;
device/htc/passion/full_passion.mk:PRODUCT_DEVICE := passion&lt;br /&gt;
build/target/product/sdk.mk:PRODUCT_DEVICE := generic&lt;br /&gt;
build/target/product/generic.mk:PRODUCT_DEVICE := generic&lt;br /&gt;
build/target/product/generic_x86.mk:PRODUCT_DEVICE := generic_x86&lt;br /&gt;
build/target/product/core.mk:PRODUCT_DEVICE := generic&lt;br /&gt;
build/target/product/full_x86.mk:PRODUCT_DEVICE := generic_x86&lt;br /&gt;
build/target/product/full.mk:PRODUCT_DEVICE := generic&lt;br /&gt;
build/target/product/sim.mk:PRODUCT_DEVICE := sim&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRODUCT_DEVICE is used in these files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
build/core/product.mk:    PRODUCT_DEVICE \&lt;br /&gt;
build/core/product_config.mk:TARGET_DEVICE := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEVICE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add new device ==&lt;br /&gt;
&lt;br /&gt;
Add the configuration files for the new device mydevice of the company mycompany.&lt;br /&gt;
&lt;br /&gt;
Create AndroidProducts.mk&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p device/mycompany/mydevice&lt;br /&gt;
nano device/mycompany/mydevice/AndroidProducts.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRODUCT_MAKEFILES := \&lt;br /&gt;
    $(LOCAL_DIR)/full_mydevice.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create file full_mydevice.mk&amp;lt;br/&amp;gt;&lt;br /&gt;
Example is build/target/product/full.mk&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano device/mycompany/mydevice/full_mydevice.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)&lt;br /&gt;
$(call inherit-product, $(SRC_TARGET_DIR)/board/generic/device.mk)&lt;br /&gt;
&lt;br /&gt;
# Overrides&lt;br /&gt;
PRODUCT_NAME := full_mydevice&lt;br /&gt;
PRODUCT_DEVICE := mydevice&lt;br /&gt;
PRODUCT_BRAND := Android&lt;br /&gt;
PRODUCT_MODEL := Full Android on mydevice&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create file vendorsetup.sh&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano device/mycompany/mydevice/vendorsetup.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add_lunch_combo full_mydevice-eng&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create file BoardConfig.mk&lt;br /&gt;
&lt;br /&gt;
Examples are&amp;lt;br/&amp;gt; &lt;br /&gt;
build/target/board/generic/BoardConfig.mk&amp;lt;br/&amp;gt;&lt;br /&gt;
device/samsung/crespo/BoardConfig.mk &amp;lt;br/&amp;gt;&lt;br /&gt;
device/samsung/crespo/BoardConfigCommon.mk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p device/mycompany/mydevice&lt;br /&gt;
nano device/mycompany/mydevice/BoardConfig.mk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# config.mk&lt;br /&gt;
#&lt;br /&gt;
# Product-specific compile-time definitions.&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
# The generic product target doesn't have any hardware-specific pieces.&lt;br /&gt;
TARGET_NO_BOOTLOADER := true&lt;br /&gt;
TARGET_NO_KERNEL := true&lt;br /&gt;
TARGET_CPU_ABI := armeabi&lt;br /&gt;
HAVE_HTC_AUDIO_DRIVER := true&lt;br /&gt;
BOARD_USES_GENERIC_AUDIO := true&lt;br /&gt;
&lt;br /&gt;
# no hardware camera&lt;br /&gt;
USE_CAMERA_STUB := true&lt;br /&gt;
&lt;br /&gt;
# Set /system/bin/sh to mksh, not ash, to test the transition.&lt;br /&gt;
TARGET_SHELL := mksh&lt;br /&gt;
&lt;br /&gt;
# CPU&lt;br /&gt;
TARGET_ARCH_VARIANT := armv7-a-neon&lt;br /&gt;
ARCH_ARM_HAVE_TLS_REGISTER := true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Android for mydevice&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
. build/envsetup.sh &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
including device/htc/passion/vendorsetup.sh&lt;br /&gt;
including device/mycompany/mydevice/vendorsetup.sh&lt;br /&gt;
including device/samsung/crespo4g/vendorsetup.sh&lt;br /&gt;
including device/samsung/crespo/vendorsetup.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lunch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
You're building on Linux&lt;br /&gt;
&lt;br /&gt;
Lunch menu... pick a combo:&lt;br /&gt;
     1. full-eng&lt;br /&gt;
     2. full_x86-eng&lt;br /&gt;
     3. simulator&lt;br /&gt;
     4. full_passion-userdebug&lt;br /&gt;
     5. full_mydevice-eng&lt;br /&gt;
     6. full_crespo4g-userdebug&lt;br /&gt;
     7. full_crespo-userdebug&lt;br /&gt;
&lt;br /&gt;
Which would you like? [full-eng] 5&lt;br /&gt;
&lt;br /&gt;
============================================&lt;br /&gt;
PLATFORM_VERSION_CODENAME=AOSP&lt;br /&gt;
PLATFORM_VERSION=AOSP&lt;br /&gt;
TARGET_PRODUCT=full_mydevice&lt;br /&gt;
TARGET_BUILD_VARIANT=eng&lt;br /&gt;
TARGET_SIMULATOR=false&lt;br /&gt;
TARGET_BUILD_TYPE=release&lt;br /&gt;
TARGET_BUILD_APPS=&lt;br /&gt;
TARGET_ARCH=arm&lt;br /&gt;
TARGET_ARCH_VARIANT=armv7-a-neon&lt;br /&gt;
HOST_ARCH=x86&lt;br /&gt;
HOST_OS=linux&lt;br /&gt;
HOST_BUILD_TYPE=release&lt;br /&gt;
BUILD_ID=OPENMASTER&lt;br /&gt;
============================================&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Build Android for mydevice&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make -j4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Combining NOTICE files: out/target/product/mydevice/obj/NOTICE.html&lt;br /&gt;
Target system fs image: out/target/product/mydevice/obj/PACKAGING/systemimage_intermediates/system.img&lt;br /&gt;
Install system fs image: out/target/product/mydevice/system.img&lt;br /&gt;
Installed file list: out/target/product/mydevice/installed-files.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Android]]&lt;/div&gt;</summary>
		<author><name>Jkes</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Android_Porting</id>
		<title>Android Porting</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Android_Porting"/>
				<updated>2011-06-10T20:17:14Z</updated>
		
		<summary type="html">&lt;p&gt;Jkes: /* Porting Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes various effort to port Android to new boards and new processors&lt;br /&gt;
&lt;br /&gt;
== Porting Overview ==&lt;br /&gt;
This overview of porting steps was seen on the android-porting list:&amp;lt;br&amp;gt;&lt;br /&gt;
See http://www.mail-archive.com/android-porting@googlegroups.com/msg06721.html&lt;br /&gt;
&lt;br /&gt;
This glosses over all the kernel work for a new board, and the android-specific&lt;br /&gt;
kernel patches, but has some good discussion about the flash partitioning and file&lt;br /&gt;
system bringup process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
If the linux kernel is up and running with all drivers in.&lt;br /&gt;
(particularly touchscreen and display) it shouldn't be too bad.&lt;br /&gt;
&lt;br /&gt;
IHMO, the easiest way to get you running is to aggregate the initial&lt;br /&gt;
ramfs built into the kernel with the Android build, the root Android&lt;br /&gt;
root filesystem (system), and the user data section (mounted as /data&lt;br /&gt;
I believe) into one root filesystem.&lt;br /&gt;
&lt;br /&gt;
You can then take that root filesystem as one tarball.&lt;br /&gt;
&lt;br /&gt;
Modify the NAND partitioning of the kernel to set aside space for the&lt;br /&gt;
whole Android rootfs, and of course rebuild the kernel. (Be sure yaffs&lt;br /&gt;
support is in the kernel) Also no need for a ramfs at this point, just&lt;br /&gt;
have the kernel look to mtd2 for it's root filesystem, which will be&lt;br /&gt;
jffs2&lt;br /&gt;
&lt;br /&gt;
Create yourself a busybox root filesystem too. Make that into a jffs2&lt;br /&gt;
image.&lt;br /&gt;
&lt;br /&gt;
So your partitioning would look something similar to this (you'll have&lt;br /&gt;
to decide on the sizes of course):&lt;br /&gt;
mtd0: bootloader&lt;br /&gt;
mtd1: kernel&lt;br /&gt;
mtd2: rootfs (jffs2)&lt;br /&gt;
mtd3: Android rootfs.&lt;br /&gt;
&lt;br /&gt;
Erase everything on the NAND.&lt;br /&gt;
Burn the normal Chumby bootloader to mtd0.&lt;br /&gt;
Burn the the new kernel into mtd1.&lt;br /&gt;
Burn the jffs2 rootfs image to mtd2.&lt;br /&gt;
&lt;br /&gt;
Boot the device. Hopefully you get yourself to a prompt.&lt;br /&gt;
&lt;br /&gt;
Once you have that prompt mount mtd3 to /mnt/android as a yaffs2&lt;br /&gt;
partition.&lt;br /&gt;
Untar your Android rootfs into /mnt/android.&lt;br /&gt;
Chown and chgrp everything under /mnt/android to &amp;quot;root&amp;quot;&lt;br /&gt;
chroot to that mount point &amp;quot;chroot /mnt/android /init&amp;quot;&lt;br /&gt;
&lt;br /&gt;
At this point you should see Android trying to run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I know that's a bit to chomp on, but it's more of an outline of what&lt;br /&gt;
you will need to do. Of course it's assuming you have the ability to&lt;br /&gt;
erase the whole nand and put down images amongst other assumptions,&lt;br /&gt;
but it should help get your mind around a little bit of the&lt;br /&gt;
requirements to get Android running on your device.&lt;br /&gt;
&lt;br /&gt;
Regarding your bootloader question, I'd just stick with the current&lt;br /&gt;
one. You'll only need to modify that if/when you go into having&lt;br /&gt;
everything compatible with the recovery system. Which is a completely&lt;br /&gt;
different discussion.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Porting Tutorials ==&lt;br /&gt;
* [http://www.linuxfordevices.com/c/a/Linux-For-Devices-Articles/Porting-Android-to-a-new-device/ Porting Android to a new Device] - excellent and thorough paper on porting Android to the Nokia N810.&lt;br /&gt;
** Has a detailed list of kernel changes and annotated diffs.&lt;br /&gt;
* http://wiki.kldp.org/wiki.php/AndroidPortingOnRealTarget&lt;br /&gt;
* [[Android on OMAP]] - excellent tutorial covering lots of different issues for porting Android to platforms based on the TI OMAP (ARM) processor&lt;br /&gt;
* Some cursory notes on a port to a PXA board are at: http://letsgoustc.spaces.live.com/blog/cns!89AD27DFB5E249BA!320.entry&lt;br /&gt;
* Adding a new device or changing the configuration of an existing device [[Android Device]]&lt;br /&gt;
&lt;br /&gt;
== Porting Issues ==&lt;br /&gt;
* Matt Porter (Mentor Graphics) gave a presentation on difficulties encountered while they were porting Android to MIPS and PPC processors at [http://www.embeddedlinuxconference.com/elc_europe09/index.html ELC Europe 2009]. His talk was called &amp;quot;Mythbusters: Android&amp;quot; and has lots of good information.&lt;br /&gt;
** See [[Media:Mythbusters_Android.pdf|Mythbusters_Android.pdf]]&lt;br /&gt;
&lt;br /&gt;
* [http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/porting-guide.html;hb=HEAD Dalvik porting guide]&lt;br /&gt;
&lt;br /&gt;
== Porting to New Processors ==&lt;br /&gt;
* Mentor Graphics has ported Android to MIPS and PPC&lt;br /&gt;
* Power.Org supported the work to port Android to PPC&lt;br /&gt;
** Nina Wilner talked about this work, and gave a demo at ELC Europe 2009&lt;br /&gt;
** see [[Media:Android_On_Power.pdf|Android_On_Power.pdf]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Android]]&lt;/div&gt;</summary>
		<author><name>Jkes</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Android_Porting</id>
		<title>Android Porting</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Android_Porting"/>
				<updated>2011-06-10T20:14:10Z</updated>
		
		<summary type="html">&lt;p&gt;Jkes: /* Porting Tutorials */  device configuration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes various effort to port Android to new boards and new processors&lt;br /&gt;
&lt;br /&gt;
== Porting Overview ==&lt;br /&gt;
This overview of porting steps was seen on the android-porting list:&amp;lt;br&amp;gt;&lt;br /&gt;
See http://www.mail-archive.com/android-porting@googlegroups.com/msg06721.html&lt;br /&gt;
&lt;br /&gt;
This glosses over all the kernel work for a new board, and the android-specific&lt;br /&gt;
kernel patches, but has some good discussion about the flash partitioning and file&lt;br /&gt;
system bringup process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
If the linux kernel is up and running with all drivers in.&lt;br /&gt;
(particularly touchscreen and display) it shouldn't be too bad.&lt;br /&gt;
&lt;br /&gt;
IHMO, the easiest way to get you running is to aggregate the initial&lt;br /&gt;
ramfs built into the kernel with the Android build, the root Android&lt;br /&gt;
root filesystem (system), and the user data section (mounted as /data&lt;br /&gt;
I believe) into one root filesystem.&lt;br /&gt;
&lt;br /&gt;
You can then take that root filesystem as one tarball.&lt;br /&gt;
&lt;br /&gt;
Modify the NAND partitioning of the kernel to set aside space for the&lt;br /&gt;
whole Android rootfs, and of course rebuild the kernel. (Be sure yaffs&lt;br /&gt;
support is in the kernel) Also no need for a ramfs at this point, just&lt;br /&gt;
have the kernel look to mtd2 for it's root filesystem, which will be&lt;br /&gt;
jffs2&lt;br /&gt;
&lt;br /&gt;
Create yourself a busybox root filesystem too. Make that into a jffs2&lt;br /&gt;
image.&lt;br /&gt;
&lt;br /&gt;
So your partitioning would look something similar to this (you'll have&lt;br /&gt;
to decide on the sizes of course):&lt;br /&gt;
mtd0: bootloader&lt;br /&gt;
mtd1: kernel&lt;br /&gt;
mtd2: rootfs (jffs2)&lt;br /&gt;
mtd3: Android rootfs.&lt;br /&gt;
&lt;br /&gt;
Erase everything on the NAND.&lt;br /&gt;
Burn the normal Chumby bootloader to mtd0.&lt;br /&gt;
Burn the the new kernel into mtd1.&lt;br /&gt;
Burn the jffs2 rootfs image to mtd2.&lt;br /&gt;
&lt;br /&gt;
Boot the device. Hopefully you get yourself to a prompt.&lt;br /&gt;
&lt;br /&gt;
Once you have that prompt mount mtd3 to /mnt/android as a yaffs2&lt;br /&gt;
partition.&lt;br /&gt;
Untar your Android rootfs into /mnt/android.&lt;br /&gt;
Chown and chgrp everything under /mnt/android to &amp;quot;root&amp;quot;&lt;br /&gt;
chroot to that mount point &amp;quot;chroot /mnt/android /init&amp;quot;&lt;br /&gt;
&lt;br /&gt;
At this point you should see Android trying to run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I know that's a bit to chomp on, but it's more of an outline of what&lt;br /&gt;
you will need to do. Of course it's assuming you have the ability to&lt;br /&gt;
erase the whole nand and put down images amongst other assumptions,&lt;br /&gt;
but it should help get your mind around a little bit of the&lt;br /&gt;
requirements to get Android running on your device.&lt;br /&gt;
&lt;br /&gt;
Regarding your bootloader question, I'd just stick with the current&lt;br /&gt;
one. You'll only need to modify that if/when you go into having&lt;br /&gt;
everything compatible with the recovery system. Which is a completely&lt;br /&gt;
different discussion.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Porting Tutorials ==&lt;br /&gt;
* [http://www.linuxfordevices.com/c/a/Linux-For-Devices-Articles/Porting-Android-to-a-new-device/ Porting Android to a new Device] - excellent and thorough paper on porting Android to the Nokia N810.&lt;br /&gt;
** Has a detailed list of kernel changes and annotated diffs.&lt;br /&gt;
* http://wiki.kldp.org/wiki.php/AndroidPortingOnRealTarget&lt;br /&gt;
* [[Android on OMAP]] - excellent tutorial covering lots of different issues for porting Android to platforms based on the TI OMAP (ARM) processor&lt;br /&gt;
* Some cursory notes on a port to a PXA board are at: http://letsgoustc.spaces.live.com/blog/cns!89AD27DFB5E249BA!320.entry&lt;br /&gt;
* Adding a new device or changing the configuration of an existing device [[/Android Device]]&lt;br /&gt;
&lt;br /&gt;
== Porting Issues ==&lt;br /&gt;
* Matt Porter (Mentor Graphics) gave a presentation on difficulties encountered while they were porting Android to MIPS and PPC processors at [http://www.embeddedlinuxconference.com/elc_europe09/index.html ELC Europe 2009]. His talk was called &amp;quot;Mythbusters: Android&amp;quot; and has lots of good information.&lt;br /&gt;
** See [[Media:Mythbusters_Android.pdf|Mythbusters_Android.pdf]]&lt;br /&gt;
&lt;br /&gt;
* [http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/porting-guide.html;hb=HEAD Dalvik porting guide]&lt;br /&gt;
&lt;br /&gt;
== Porting to New Processors ==&lt;br /&gt;
* Mentor Graphics has ported Android to MIPS and PPC&lt;br /&gt;
* Power.Org supported the work to port Android to PPC&lt;br /&gt;
** Nina Wilner talked about this work, and gave a demo at ELC Europe 2009&lt;br /&gt;
** see [[Media:Android_On_Power.pdf|Android_On_Power.pdf]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Android]]&lt;/div&gt;</summary>
		<author><name>Jkes</name></author>	</entry>

	<entry>
		<id>http://elinux.org/User:Jkes</id>
		<title>User:Jkes</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/User:Jkes"/>
				<updated>2011-06-10T12:21:56Z</updated>
		
		<summary type="html">&lt;p&gt;Jkes: Created page with &amp;quot;Software development for embedded systems:  * Ti OMAP4430 * Freescale i.MX35 * Freescale MPC5125 * Freescale MPC5200B&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Software development for embedded systems: &lt;br /&gt;
* Ti OMAP4430&lt;br /&gt;
* Freescale i.MX35&lt;br /&gt;
* Freescale MPC5125&lt;br /&gt;
* Freescale MPC5200B&lt;/div&gt;</summary>
		<author><name>Jkes</name></author>	</entry>

	</feed>