免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1389 | 回复: 0
打印 上一主题 下一主题

Compilation of Android kernel [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-19 15:50 |只看该作者 |倒序浏览

                Compilation of Android kernel
               
                        From Triled Wiki
                       
                                                                        Jump to:
navigation
,
search
                       
                       
Tip applies to Linux systems
1. Get toolchains from
CodeSourcery
(Choose ARM EABI and IA32 GNU/Linux).
2. Get kernel source code from
here
.
3. Deploy toolcains and kernel source and enter in the kernel source tree.
$ mkdir -p android
$ cd android
$ tar xjvf ../arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
$ tar xzvf ../linux-2.6.23-android-m3-rc20.tar.gz
$ cd kernel
4. Get the config.gz from the running emulator by the following way.
$ adb pull /proc/config.gz .
5. Decommpress the config.gz and rename it as .config
$ gunzip config.gz
$ mv config .config
6. Specify CROSS_COMPILE in the Makefile.
CROSS_COMPILE=../arm-2007q3/bin/arm-none-linux-gnueabi-
7. Comment out LDFLAGS_BUILD_ID in the same Makefile. The
LDFLAGS_BUILD_ID enables --build-id option of ld if available. The
--build-id option is relatively new. The current emulator does not seem
to support the kernel linked with this option. See
here
if you are interested in the detail of this option.
#LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
$(call ld-option, -Wl$(comma)--build-id,))
8. Make the kernel
$ make
9. Check zImage is created and the size is nearly same as the kernel-qemu in the Andorid SDK.
$ ls -l arch/arm/boot/zImage
-rwxrwxr-x 1 motz motz 1234712 2007-12-01 18:06 arch/arm/boot/zImage
$ ls -l $SDK/tools/lib/images/kernel-qemu
-rwxrwxr-x 1 motz motz 1245836 2007-11-12 5:59 ...sdk/tools/lib/images/kernel-qemu
10. Run emulator with the created kernel.
$ emulator -kernel arch/arm/boot/zImage
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/85193/showart_1424077.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP