Adding a new board or platform to android source & build

  1. add a file AndroidProducts.mk

 

In the products directory, create an AndroidProducts.mk file that point to (and is responsible for finding) the individual product make files.

#

# 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

 

modify “first_product_name.mk” to “hawkboard.mk”

 

  1. Create a product-specific makefile, called vendor/<company_name>/products/<first_product_name>.mk, that includes at least the following code:

$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)

#

# Overrides

PRODUCT_NAME := <first_product_name>

PRODUCT_DEVICE := <board_name>

 

example: create hawkboard.mk in “vendor/ti/hawkboard” directory.

 

 

  1. Create a board-specific directory beneath your company directory that matches the PRODUCT_DEVICE variable <board_name> referenced in the product-specific make file above. This will include a make file that gets accessed by any product using this board.
    mkdir vendor/<company_name>/<board_name>
  2. Create a BoardConfig.mk file in the directory created in the previous step (vendor/<company_name>/<board_name>).
    # 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

 

4.

 

Adding a board to android build

=====================

 

  1. cd vendor/ti ; mkdir hawkboard
  2. make TARGET_PRODUCT=hawkboard

 

following error comes,

build/core/product_config.mk:173: *** No matches for product “hawkboard”.  Stop.

 

  1. cd vendor/ti; cp beagleboard/AndroidProducts.mk hawkboard/

error:

sudo make TARGET_PRODUCT=hawkboard

build/core/product_config.mk:165: *** _nic.PRODUCTS.[[vendor/ti/hawkboard/beagleboard.mk]]: “vendor/ti/hawkboard/beagleboard.mk” does not exist.  Stop

 

edit: hawkboard/AndroidProducts.mk

PRODUCT_MAKEFILES :=

SHUFFLED :   how to create a native daemon and run from init.rc in Android

$(LOCAL_DIR)/beagleboard.mk

 

to

PRODUCT_MAKEFILES :=

$(LOCAL_DIR)/hawkboard.mk

 

  1. take beagleboard.mk as a reference.

cp beagleboard/beagleboard.mk hawkboard/hawkboard.mk

 

error:

 

sudo make TARGET_PRODUCT=hawkboard

build/core/product_config.mk:166: *** vendor/ti/hawkboard/hawkboard.mk: PRODUCT_NAME must be unique; “beagleboard” already used by vendor/ti/beagleboard/beagleboard.mk vendor/ti/hawkboard/hawkboard.mk .  Stop.

 

edit:  hawkboard/hawkboard.mk to

 

PRODUCT_PACKAGES :=

SoundRecorder

 

$(call inherit-product, build/target/product/rowboat.mk)

 

# Overrides

PRODUCT_BRAND := TI

PRODUCT_NAME := hawkboard

PRODUCT_DEVICE := hawkboard

PRODUCT_PACKAGE_OVERLAYS := vendor/rowboat/generic

 

error:

sudo make TARGET_PRODUCT=hawkboard

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=2.1-update1

TARGET_PRODUCT=hawkboard

TARGET_BUILD_VARIANT=eng

TARGET_SIMULATOR=

TARGET_BUILD_TYPE=release

TARGET_ARCH=arm

HOST_ARCH=x86

HOST_OS=linux

HOST_BUILD_TYPE=release

BUILD_ID=ECLAIR

============================================

build/core/config.mk:126: *** No config file found for TARGET_DEVICE hawkboard.  Stop.

 

  1. take beagleboard/BoardConfig.mk as a reference,

 

cp beagleboard/BoardConfig.mk hawkboard/

 

error:

 

sudo make TARGET_PRODUCT=hawkboard

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=2.1-update1

TARGET_PRODUCT=hawkboard

TARGET_BUILD_VARIANT=eng

TARGET_SIMULATOR=

TARGET_BUILD_TYPE=release

TARGET_ARCH=arm

HOST_ARCH=x86

HOST_OS=linux

HOST_BUILD_TYPE=release

BUILD_ID=ECLAIR

============================================

build/target/board/Android.mk:28: *** Missing “vendor/ti/hawkboard/AndroidBoard.mk”.  Stop.

 

  1. take beagleboard/AndroidBoard.mk as a reference

 

cp beagleboard/AndroidBoard.mk hawkboard/

 

================================================================

modify top Makefile (i.e. android_src/Makefile) to add

 

ifeq ($(TARGET_PRODUCT), hawkboard)

make -C kernel ARCH=arm omap3_beagle_android_defconfig

endif

 

for compiling kernel

sudo make TARGET_PRODUCT=hawkboard TARGET_PREBUILT_KERNEL=path_to_kernel/kernel

 

===================================

 

  1. mkdir vendor/myvendor
  2. mkdir vendor/myvendor/products/
  3. touch vendor/myvendor/products/hawkboard.mk

 

edit hawkboard.mk for adding

 

$(call inherit-product, build/target/product/generic.mk)

 

# Overrides

PRODUCT_NAME := hawkboard

PRODUCT_DEVICE := hawkboard

 

  1. touch vendor/myvendor/products/AndroidProducts.mk

edit AndroidProducts.mk for

 

PRODUCT_MAKEFILES :=

$(LOCAL_DIR)/hawkboard.mk

 

  1. mkdir vendor/myvendor/hawkboard
  2. Create a BoardConfig.mk file in the directory created in the previous step (vendor/myvendor/hawkboard).

 

# 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

 

  1. create AndroidBoard.mk in directory “vendor/myvendor/hawkboard/AndroidBoard.mk”
Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply