原文地址http://www.cnblogs.com/scue/archive/2012/11/12/2765813.html

由于之前手机是双卡的,不好研究,现在弄到一台中兴V880,今天早上来编译内核一下~

-1. Blade Kernel 2.6.35.7 Download page

Github :https://github.com/TomGiordano/kernel_zte_blade
官方网站:http://support.zte.com.cn/support/news/NewsDetail.aspx?newsId=1001722

0. 前边的步骤略过一下先,不过也写有在U8825D内核编译过程实录当中有记录,最主要的是export变量的配置上

1. 查找官方内核中的配置文件

scue@Link:~/Source/kernel/v880$ find ./arch/arm/configs/ | grep blade ./arch/arm/configs/msm7627_blade_defconfig scue@Link:~/Source/kernel/v880$ 

 可以确定为配置文件为./arch/arm/configs/msm7627_blade_defconfig

2. 开始make 配置文件 

「Android」ZTE V880(Blade)内核编译过程实录_Android
scue@Link:~/Source/kernel/v880$ make msm7627_blade_defconfig   HOSTCC  scripts/basic/fixdep   HOSTCC  scripts/basic/docproc   HOSTCC  scripts/basic/hash   HOSTCC  scripts/kconfig/conf.o scripts/kconfig/conf.c: 在函数‘conf_sym’中: scripts/kconfig/conf.c:159:6: 警告: 变量‘type’被设定但未被使用 [-Wunused-but-set-variable] scripts/kconfig/conf.c: 在函数‘conf_choice’中: scripts/kconfig/conf.c:231:6: 警告: 变量‘type’被设定但未被使用 [-Wunused-but-set-variable] scripts/kconfig/conf.c:307:9: 警告: 忽略声明有 warn_unused_result 属性的‘fgets’的返回值 [-Wunused-result] scripts/kconfig/conf.c: 在函数‘conf_askvalue’中: scripts/kconfig/conf.c:105:8: 警告: 忽略声明有 warn_unused_result 属性的‘fgets’的返回值 [-Wunused-result]   HOSTCC  scripts/kconfig/kxgettext.o   SHIPPED scripts/kconfig/zconf.tab.c   SHIPPED scripts/kconfig/lex.zconf.c   SHIPPED scripts/kconfig/zconf.hash.c   HOSTCC  scripts/kconfig/zconf.tab.o   HOSTLD  scripts/kconfig/conf drivers/usb/gadget/Kconfig:849:warning: defaults for choice values not supported drivers/usb/gadget/Kconfig:1053:warning: defaults for choice values not supported arch/arm/configs/msm7627_blade_defconfig:1484:warning: override: reassigning to symbol OV5642 # # configuration written to .config # scue@Link:~/Source/kernel/v880$ 
「Android」ZTE V880(Blade)内核编译过程实录_Android

 make完毕,有一些警告,但不是错误,可以不理会它(暂时也没空去分析、要上课了)

3. 开始编译V880手机内核

「Android」ZTE V880(Blade)内核编译过程实录_Android
scue@Link:~/Source/kernel/v880$ make -j8     ...        OBJCOPY arch/arm/boot/zImage     Kernel: arch/arm/boot/zImage is ready scue@Link:/media/scue/Source/kernel/zte-kernel-blade$ cp arch/arm/boot/zImage http://www.cnblogs.com/v880-bootimg/zImagescue
「Android」ZTE V880(Blade)内核编译过程实录_Android

4. 解包现有的手机内核

「Android」ZTE V880(Blade)内核编译过程实录_Android
scue@Link:/media/scue/Source/v880-bootimg$ bootimg --unpack-bootimg v880_boot.img arguments: [bootimg file] bootimg file: v880_boot.img output: kernel[.gz] ramdisk[.gz] second[.gz] base=0x2600000 page_size=2048 name="" cmdline="androidboot.hardware=blade console=null" padding_size=2048
「Android」ZTE V880(Blade)内核编译过程实录_Android

5. 打包V880手机内核

 (方法一,mkbootimg打包)

「Android」ZTE V880(Blade)内核编译过程实录_Android
scue@Link:/media/scue/Source/v880-bootimg$ ls -l 总用量 20856
-rw-r--r-- 1 scue scue 3721216 11月 12 17:38 boot2.img -rw-r--r-- 1 scue scue 5242880 11月 12 09:43 v880_boot.img -rw-rw-r-- 1 scue scue 3540992 11月 12 17:49 v880_boot.img-kernel.gz drwxrwxr-x 8 scue scue    4096 11月 12 17:49 v880_boot.img-ramdisk -rw-rw-r-- 1 scue scue 1699840 11月 12 17:49 v880_boot.img-ramdisk.cpio.gz -rwxrwxr-x 1 scue scue 3567788 11月 12 17:11 zImage -rwxrwxr-x 1 scue scue 3567812 11月 12 17:21 zImagescue scue@Link:/media/scue/Source/v880-bootimg$ chmod 755 /media/scue/Source/bootimg-scripts/repack-bootimg-v880.pl scue@Link:/media/scue/Source/v880-bootimg$ repack repack_bootimg       repack-bootimg-v880   scue@Link:/media/scue/Source/v880-bootimg$ repack repack_bootimg       repack-bootimg-v880   scue@Link:/media/scue/Source/v880-bootimg$ repack-bootimg-v880 zImagescue v880_boot.img-ramdisk boot3.img 478 块  repacked boot p_w_picpath written at v880_boot.img-ramdisk-repack.img scue@Link:/media/scue/Source/v880-bootimg$ adb reboot bootloader scue@Link:/media/scue/Source/v880-bootimg$ fastboot devices ????????????    fastboot scue@Link:/media/scue/Source/v880-bootimg$ fastboot erase boot erasing 'boot'... OKAY [  0.033s] finished. total time: 0.033s scue@Link:/media/scue/Source/v880-bootimg$ fastboot flash boot boot3.img  sending 'boot' (3636 KB)... OKAY [  0.910s] writing 'boot'... OKAY [  0.673s] finished. total time: 1.583s scue@Link:/media/scue/Source/v880-bootimg$ fastboot reboot rebooting...  finished. total time: 0.001s scue@Link:/media/scue/Source/v880-bootimg$ 
「Android」ZTE V880(Blade)内核编译过程实录_Android

 (方法二,bootimg打包) 

「Android」ZTE V880(Blade)内核编译过程实录_Android
scue@Link:/media/scue/Source/v880-bootimg$ bootimg --repack-bootimg 0x2600000 "androidboot.hardware=blade console=null" 2048 2048  arguments: [base] [cmdline] [page_size] [padding_size] kernel: kernel ramdisk: ramdisk.gz second:  base: 0x2600000 cmdline: androidboot.hardware=blade console=null page_size: 2048 padding_size: 2048 output: boot.img scue@Link:/media/scue/Source/v880-bootimg$ ls boot2.img  boot3.img  boot.img  kernel  ramdisk.gz  v880_boot.img  zImage  zImagescue scue@Link:/media/scue/Source/v880-bootimg$ adb reboot bootloader scue@Link:/media/scue/Source/v880-bootimg$ fastboot devices ????????????    fastboot scue@Link:/media/scue/Source/v880-bootimg$ fastboot erase boot erasing 'boot'... OKAY [ 0.033s] finished. total time: 0.033s scue@Link:/media/scue/Source/v880-bootimg$ fastboot flash boot boot.img  sending 'boot' (3634 KB)... OKAY [ 0.910s] writing 'boot'... OKAY [ 0.673s] finished. total time: 1.583s scue@Link:/media/scue/Source/v880-bootimg$ fastboot reboot rebooting...  finished. total time: 0.001s scue@Link:/media/scue/Source/v880-bootimg$
「Android」ZTE V880(Blade)内核编译过程实录_Android

 「Android」ZTE V880(Blade)内核编译过程实录_V880_11

注:不过有一点遗憾就是,替换了内核之后,手机没有能够识别SIM卡,准备要家教去了,这个事情以后再处理~
  不过现在这个问题已经解决了,解决时间:
2012年 11月 12日 星期一 18:44:42 HKT