Rockie's Android Porting Guide(1)——build your own board
Rockie Cheng
Download Android codes from google git!
(1)在android源碼目錄下執行(為何每次都要執行?)
. build/envsetup.sh
(2)建立自己的board
copy build/target/board/generic to build/target/board/idea6410
修改build/target/product/AndroidProduct.mk,添加
$(LOCAL_DIR)/idea6410.mk \
copy build/target/product/generic.mk to build/target/product/idea6410.mk
修改build/target/product/idea6410.mk
# Overrides
PRODUCT_BRAND := idea6410
PRODUCT_DEVICE := idea6410
PRODUCT_NAME := idea6410
(3)tapas
[kyon@SEP4020 android2.0]$ tapas
Build for the simulator or the device?
1. Device
2. Simulator
Which would you like? [1]
Build type choices are:
1. release
2. debug
Which would you like? [1] 1
Which product would you like? [generic] idea6410
Variant choices are:
1. user
2. userdebug
3. eng
Which would you like? [eng]
============================================
PLATFORM_VERSION_CODENAME=Eclair
PLATFORM_VERSION=Eclair
TARGET_PRODUCT=idea6410
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ECLAIR
============================================
[kyon@SEP4020 android2.0]$
以上只是基於generic簡單的複製,需要更詳細的定製開發板裝置
附錄:
1)build/target/product/idea6410.mk內容
# This is a generic product that isn't specialized for a specific device.
# It includes the base Android platform. If you need Google-specific features,
# you should derive from generic_with_google.mk
PRODUCT_PACKAGES := \
AccountAndSyncSettings \
AlarmClock \
AlarmProvider \
Bluetooth \
Calculator \
Calendar \
Camera \
CertInstaller \
DrmProvider \
Email \
Gallery \
LatinIME \
Mms \
Music \
Settings \
Sync \
Updater \
CalendarProvider \
SyncProvider
$(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
# Overrides
PRODUCT_BRAND := idea6410
PRODUCT_DEVICE := idea6410
PRODUCT_NAME := idea6410
產品名稱及包含的應用程式
2)build/target/board/idea6410/BoardConfig.mk
# config.mk
#
# Product-specific compile-time definitions.
#
# The generic product target doesn't have any hardware-specific pieces.
TARGET_NO_BOOTLOADER := true
TARGET_NO_KERNEL := true
TARGET_CPU_ABI := armeabi
HAVE_HTC_AUDIO_DRIVER := true
BOARD_USES_GENERIC_AUDIO := true
不編譯bootloader及核心
使用arm eabi編譯器
使用HTC和通用音頻(沒有使用ALSA)
如果需要添加HAL層驅動,需要修改此檔案
3)build/target/board/idea6410/AndroidBoard.mk
LOCAL_PATH := $(call my-dir)
file := $(TARGET_OUT_KEYLAYOUT)/tuttle2.kl
ALL_PREBUILT += $(file)
$(file) : $(LOCAL_PATH)/tuttle2.kl | $(ACP)
$(transform-prebuilt-to-target)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := tuttle2.kcm
include $(BUILD_KEY_CHAR_MAP)
目前看來加入了一些鍵盤對應檔案