Add new target

Overview

The article describeshow to create a target for your own device under Android-x86.Rewritten from the e-mail Chih-wei Huang sent to android-x86 discussion group. You can find the original e-mail inhttps://mail.google.com/mail/?ui=2&shva=1#search/Chih-wei/125eb28a674c23e9

Create a directory

First, you have to create a directory to hold all stuff specific for your target device.

mkdir vendor/xxx/yyy
or

mkdir device/xxx/yyy
where xxx is usually the vendor's name and yyy is the product name. Historically, we used thevendor/directory. However, Google suggested to usedevice/since Froyo. We encourage to use the new conventiondevice/as AOSP does.

Create makefiles

At least you have to create four makefiles in the new directory:

  • AndroidProducts.mk
This makefile should only contain PRODUCT_MAKEFILES which is a list of product makefiles to expose to the build system. So if your product name is yyy, it is

PRODUCT_MAKEFILES := $(LOCAL_DIR)/yyy.mk
  • The product makefile:yyy.mk
You have to define PRODUCT_PACKAGES, PRODUCT_NAME, PRODUCT_DEVICE in it, and call inherit-product to inherit from a product makefile. I suggest to to inheritgeneric_x86.mkto get all common x86 rules.

$(call inherit-product,$(SRC_TARGET_DIR)/product/generic_x86.mk)
  • The board config makefile: BoardConfig.mk
You can override some variables before including $(GENERIC_X86_CONFIG_MK)

- TARGET_HAS_THIRD_PARTY_APPS
set to true if you hope to compile third party apps like ConnectBot, FileManager introduced by Android-x86.
Default: false

- BOARD_USES_ALSA_AUDIO
Set to false if you don't want ALSA audio.
Default: true.

- BOARD_HAVE_BLUETOOTH
If you don't need bluetooth, set it to false.
Default: true.

- BOARD_USES_TSLIB
Set to true if you need tslib to calibrate the touchscreen.
Default: false

- BOARD_KERNEL_CMDLINE
You can customize your cmdline (kernel boot options)

- BOARD_WPA_SUPPLICANT_DRIVER
Set to true if you need wifi support

  • The android board makefile: AndroidBoard.mk
You can override some variables before including
$(GENERIC_X86_ANDROID_MK)

- LOCAL_FIRMWARES
Specify the firmwares to be included in the target. The firmwares are supposed to be already in build/target/board/generic_x86/firmware/.
You may also specify a different directory in LOCAL_FIRMWARES_DIR.

- TARGET_INITRD_SCRIPTS
Specify a hook script to be added in the initrd.img. Usually the script should contain a detect_hardware function that will be called by the init script.
Read eeepc_info as an implementation example.

- TARGET_PREBUILT_APPS
If you want to include some prebuilt apps (apk files), set them to this variable.

- TARGET_KERNEL_CONFIG
Specify a kernel config file for this target. If not set, the default android-x86_defconfig will be used.


Besides the four makefiles, you may also add the file init.yyy.rc to do some initializations for your product
The file will be included automatically if exists,and called by Android init on booting(after executing init.rc).

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android(安卓)ListView理解之BaseAdapter
  2. android 关于程序升级问题
  3. Android开发环境配置教程
  4. android 4.0.1 webkit Event 事件处理过
  5. Android中处理崩溃异常
  6. android 工具类之--TextUtils
  7. 新年目标
  8. Android 中使用Aspectj进行切面编程
  9. android UDP广播、组播
  10. [GoogleMap/GPS] 申请Android API Key