freescale i.mx233平台上移植android 2.2 - ethernet移植
i.mx233-android平台上以太网卡的移植主要参考了android-x86项目。网址为:http://www.android-x86.org/getsourcecode 。
主要分为如下几个部分:
1,linux 内核驱动,这个部分简单的说一下。默认的mx233配置就是支持的,mx233是通过usb接以太网的,只需要把相应的以模块方式编译的驱动改成编译进内核。我将.config与默认的arch/arm/configs/imx23evk_defconfig比较了一下,改了如下:
CONFIG_MII=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_NET1080=y
CONFIG_USB_NET_CDC_SUBSET=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_NET_ZAURUS=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_GADGET=y
CONFIG_USB_ARC=y
CONFIG_USB_ETH=y
2,下载android-x86代码
a) 我们将要移植的是android-2.2的版本,所以我们必须得到android-x86在2.2版本上的内容。
mkdir android-x86
cd android-x86
repo init -u git://git.android-x86.org/manifest.git -b froyo-x86
b) 上一步初始化了android-x86,接下来你可以repo sync,但是我发现这个服务器很慢,这样子很难成功。所以我就check out我们需要的几个文件夹,如下:
repo sync platform/build
repo sync platform/frameworks/base
repo sync platform/packages/apps/Settings
c) 之后就是将ethernet部分内容移植到自己的android源码上去。本文以下的内容只是此过程的记录。
d) 据网友xiyangfan 介绍repo init -u git://android-x86.git.sf.net/gitroot/android-x86/manifest.git -b froyo-x86会比较快,建议大家使用这个地址!!
3,android源码目录下frameworks/base下的改动
a) frameworks/base/core/java/android/app/ContextImpl.java
b) frameworks/base/core/java/android/content/Context.java
c) frameworks/base/core/java/android/net/ConnectivityManager.java
d) frameworks/base/core/java/android/net/NetworkUtils.java
e) frameworks/base/core/java/android/provider/Settings.java
f) frameworks/base/core/jni/Android.mk
g) frameworks/base/core/jni/AndroidRuntime.cpp
h) +frameworks/base/core/jni/android_net_ethernet.cpp
i) +frameworks/base/core/res/res/drawable/connect_creating.png
+frameworks/base/core/res/res/drawable/connect_established.png
+frameworks/base/core/res/res/drawable/connect_no.png
j) +frameworks/base/core/res/res/drawable-hdpi/connect_creating.png
+frameworks/base/core/res/res/drawable-hdpi/connect_established.png
+frameworks/base/core/res/res/drawable-hdpi/connect_no.png
k) +frameworks/base/core/res/res/drawable-mdpi/connect_creating.png
+frameworks/base/core/res/res/drawable-mdpi/connect_established.png
+frameworks/base/core/res/res/drawable-mdpi/connect_no.png
l) frameworks/base/core/res/res/values/arrays.xml
m) frameworks/base/core/res/res/values/config.xml
n) +frameworks/base/ethernet
o) frameworks/base/services/java/com/android/server/status/StatusBarPolicy.java
p) frameworks/base/services/java/com/android/server/ConnectivityService.java
q) +frameworks/base/services/java/com/android/server/EthernetService.java
r) frameworks/base/Android.mk
4,android源码目录下packages/apps/Settings下的改动
a) +packages/apps/Settings/res/drawable-hdpi/ic_settings_ethernet.png
b) +packages/apps/Settings/res/drawable-mdpi/ic_settings_ethernet.png
c) +packages/apps/Settings/res/layout/eth_configure.xml
d) packages/apps/Settings/res/values/strings.xml
e) +packages/apps/Settings/res/xml/ethernet_settings.xml
f) packages/apps/Settings/res/xml/settings.xml
g) +packages/apps/Settings/src/com/android/settings/ethernet/
h) +packages/apps/Settings/src/com/android/settings/EthernetSettings.java
i) packages/apps/Settings/AndroidManifest.xml
5,build目录的改动
a) build/core/pathmap.mk
在FRAMEWORKS_BASE_SUBDIRS中加入ethernet,可以添加在telephony后
6,目标板文件系统中init.rc的改动
a) 在建立data子目录的一系列命令后添加如下:
mkdir /data/misc/dhcp 0777 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
b) 在文件最后添加如下代码,启动dhcpd服务
service dhcpcd /system/bin/dhcpcd -o domain_name_servers -ABKL
disabled
oneshot
7,目标板文件系统的改动,
将 system分区中etc/dhcpcd/dhcpcd-run-hooks 改为可执行
chmod +x etc/dhcpcd/dhcpcd-run-hooks
8,附件里有build,frameworks/base,packages/apps/Settings的patch,是基于android主源码树 diff的。其中不仅仅包含ethernet部分,所以可能有点杂,不大好看,还是建议大家自行根据android-x86进行移植,有问题欢迎联系 agooou@gmail.com
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/fgwf1/archive/2010/12/02/6049416.aspx