现在的位置: 首页 > 综合 > 正文

多普达a3288 kernel编译

2014年03月13日 ⁄ 综合 ⁄ 共 1545字 ⁄ 字号 评论关闭

参考:http://forums.androidcentral.com/htc-hero-rooting-roms-hacks/8072-how-build-your-own-kernel-package-source.html

http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images

http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source

1. 从http://dl4.htc.com/RomCode/Source_and_Binaries/click-656120.tar.gz下载HTC官方的kernel源码,解压

2.从http://developer.android.com/sdk/ndk/index.html下载ndk并解压,主要是要用到里面的toolchains进行交叉编译

3.编辑 ~/.bashrc,在文件尾添加上export CCOMPILER=/home/ray/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-

4adb pull /proc/config.gz /home/user_name/android/kernel/cm-kernel/config.gz

   cat config.gz | gunzip > .config

5.make ARCH=arm CROSS_COMPILE=$CCOMPILER menuconfig,根据需要进行选择

6. make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l` 编译kernel,kernel生成在~/android/kernel/cm-kernel/arch/arm/boot/zImage

7.  adb shell

#cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00020000 "misc"
mtd1: 00500000 00020000 "recovery"
mtd2: 00280000 00020000 "boot"
mtd3: 04380000 00020000 "system"
mtd4: 04380000 00020000 "cache"
mtd5: 04ac0000 00020000 "userdata"

确定mtd2为boot分区

8. cat /dev/mtd/mtd2 > /sdcard/boot.img

    adb pull /sdcard/boot.img .

9. ./extract-kernel.pl boot.img

   ./extract-ramdisk.pl boot.img

   rm boot.img-kernel

  cp zImage boot.img-kernel

  ./mkbootfs boot.img-ramdisk | gzip > ramdisk-boot

  ./mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o myBoot.img --base 0x2E00000

10. adb push myBoot.img /sdcard

11. adb shell

       flash_image boot /sdcard/myBoot.img

没有的命令可以通过搜索从网络上下载。

抱歉!评论已关闭.