東川印記

一本東川,笑看爭龍斗虎;寰茫兦者,度橫佰昧人生。

三星S4韩版SHV-E300L源码编译(内核Kernel+ROM)

2015年3月31日星期二



1,下载源码
之前github上下载的烧进去死活无法启动。
现在自己下了一套,地址opensource.samsung.com/reception.do

下载了第一个KK。
下载后可得源码文件SHV-E300L_KK_Opensource.zip和说明SHV-E300L_NOTICE.html
解压,查看
  1. senrsl@senrsl-ubuntu:~$ cd android/source/SHV-E300L_KK_Opensource/
  2. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource$ ll
  3. 总用量 847096
  4. drwxrwxr-x  4 senrsl senrsl      4096  3月 30 13:12 ./
  5. drwxrwxr-x  8 senrsl senrsl      4096  3月 30 13:08 ../
  6. drwxrwxr-x 23 senrsl senrsl      4096  3月 30 13:11 Kernel/
  7. -rw-r--r--  1 senrsl senrsl  99288698 10月 14 16:47 Kernel.tar.gz
  8. drwxrwxr-x  5 senrsl senrsl      4096  3月 30 13:10 Platform/
  9. -rw-r--r--  1 senrsl senrsl 765711173 10月 14 16:47 Platform.tar.gz
  10. -rw-r--r--  1 senrsl senrsl       779 10月 14 16:47 README_Kernel.txt
  11. -rw-r--r--  1 senrsl senrsl      1395 10月 14 16:47 README_Platform.txt
  12. -rw-r-----  1 senrsl senrsl   2380626  3月 30 12:27 SHV-E300L_NOTICE.html
2,编译内核
①查看编译内核说明README_Kernel.txt
  1. 1. How to Build
  2.     - get Toolchain
  3.             From Android Source Download site( http://source.android.com/source/downloading.html )
  4.             Toolchain is included in Android source code(arm-eabi-4.7)
  5.     - edit build_kernel.sh
  6.             edit "CROSS_COMPILE" to right toolchain path(You downloaded).
  7.             ex) CROSS_COMPILE= $(android platform directory you download)/android/prebuilt/linux-x86/toolchain/arm-eabi-4.7/bin/arm-eabi-
  8.             ex) CROSS_COMPILE=/usr/local/toolchain/arm-eabi-4.7/bin/arm-eabi-
  9.   - execute Kernel script
  10.             $ ./build_kernel.sh
  11. 2. Output files
  12.     - Kernel : Kernel/arch/arm/boot/zImage
  13.     - module : Kernel/drivers/*/*.ko
  14. 3. How to make .tar binary for downloading into target.
  15.     - change current directory to Kernel/arch/arm/boot
  16.     - type following command
  17.     $ tar cvf Kernel.tar zImage
言简意赅
②然后照此,修改build_kernel.sh
  1. #!/bin/bash
  2. BUILD_TOP_DIR=$(pwd)
  3. export ARCH=arm
  4. export CROSS_COMPILE=/home/senrsl/android/source/WORKING_DIRECTORY/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-
  5. make jalteskt_00_defconfig
  6. make
③执行
  1. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Kernel$ ./build_kernel.sh
报错
  1. drivers/media/common/tuners/tda18218.c: In function 'tda18218_attach':
  2. drivers/media/common/tuners/tda18218.c:310:2: error: 'val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  3. cc1: all warnings being treated as errors
  4. make[4]: *** [drivers/media/common/tuners/tda18218.o] 错误 1
  5. make[3]: *** [drivers/media/common/tuners] 错误 2
  6. make[2]: *** [drivers/media/common] 错误 2
  7. make[1]: *** [drivers/media] 错误 2
  8. make: *** [drivers] 错误 2
我去,竟然报错了。
然后,试着把build_kernel.sh里的交叉编译换成4.6
换成这样
  1. #!/bin/bash
  2. BUILD_TOP_DIR=$(pwd)
  3. export ARCH=arm
  4. export CROSS_COMPILE=/home/senrsl/android/source/WORKING_DIRECTORY/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
  5. make jalteskt_00_defconfig
  6. make
然后再执行,竟然成功了!
  1. OBJCOPY arch/arm/boot/zImage
  2.   Kernel: arch/arm/boot/zImage is ready
  3.   Building modules, stage 2.
  4.   MODPOST 29 modules
  5.   CC      crypto/ansi_cprng.mod.o
  6.   LD [M]  crypto/ansi_cprng.ko
  7.   CC      drivers/media/common/tuners/max2165.mod.o
  8.   LD [M]  drivers/media/common/tuners/max2165.ko
  9.   CC      drivers/media/common/tuners/mc44s803.mod.o
  10.   LD [M]  drivers/media/common/tuners/mc44s803.ko
  11.   CC      drivers/media/common/tuners/mt2060.mod.o
  12.   LD [M]  drivers/media/common/tuners/mt2060.ko
  13.   CC      drivers/media/common/tuners/mt2063.mod.o
  14.   LD [M]  drivers/media/common/tuners/mt2063.ko
  15.   CC      drivers/media/common/tuners/mt20xx.mod.o
  16.   LD [M]  drivers/media/common/tuners/mt20xx.ko
  17.   CC      drivers/media/common/tuners/mt2131.mod.o
  18.   LD [M]  drivers/media/common/tuners/mt2131.ko
  19.   CC      drivers/media/common/tuners/mt2266.mod.o
  20.   LD [M]  drivers/media/common/tuners/mt2266.ko
  21.   CC      drivers/media/common/tuners/mxl5005s.mod.o
  22.   LD [M]  drivers/media/common/tuners/mxl5005s.ko
  23.   CC      drivers/media/common/tuners/mxl5007t.mod.o
  24.   LD [M]  drivers/media/common/tuners/mxl5007t.ko
  25.   CC      drivers/media/common/tuners/qt1010.mod.o
  26.   LD [M]  drivers/media/common/tuners/qt1010.ko
  27.   CC      drivers/media/common/tuners/tda18212.mod.o
  28.   LD [M]  drivers/media/common/tuners/tda18212.ko
  29.   CC      drivers/media/common/tuners/tda18218.mod.o
  30.   LD [M]  drivers/media/common/tuners/tda18218.ko
  31.   CC      drivers/media/common/tuners/tda18271.mod.o
  32.   LD [M]  drivers/media/common/tuners/tda18271.ko
  33.   CC      drivers/media/common/tuners/tda827x.mod.o
  34.   LD [M]  drivers/media/common/tuners/tda827x.ko
  35.   CC      drivers/media/common/tuners/tda8290.mod.o
  36.   LD [M]  drivers/media/common/tuners/tda8290.ko
  37.   CC      drivers/media/common/tuners/tda9887.mod.o
  38.   LD [M]  drivers/media/common/tuners/tda9887.ko
  39.   CC      drivers/media/common/tuners/tea5761.mod.o
  40.   LD [M]  drivers/media/common/tuners/tea5761.ko
  41.   CC      drivers/media/common/tuners/tea5767.mod.o
  42.   LD [M]  drivers/media/common/tuners/tea5767.ko
  43.   CC      drivers/media/common/tuners/tuner-simple.mod.o
  44.   LD [M]  drivers/media/common/tuners/tuner-simple.ko
  45.   CC      drivers/media/common/tuners/tuner-types.mod.o
  46.   LD [M]  drivers/media/common/tuners/tuner-types.ko
  47.   CC      drivers/media/common/tuners/tuner-xc2028.mod.o
  48.   LD [M]  drivers/media/common/tuners/tuner-xc2028.ko
  49.   CC      drivers/media/common/tuners/xc4000.mod.o
  50.   LD [M]  drivers/media/common/tuners/xc4000.ko
  51.   CC      drivers/media/common/tuners/xc5000.mod.o
  52.   LD [M]  drivers/media/common/tuners/xc5000.ko
  53.   CC      drivers/media/video/gspca/gspca_main.mod.o
  54.   LD [M]  drivers/media/video/gspca/gspca_main.ko
  55.   CC      drivers/net/wireless/bcmdhd/dhd.mod.o
  56.   LD [M]  drivers/net/wireless/bcmdhd/dhd.ko
  57.   CC      drivers/scsi/scsi_wait_scan.mod.o
  58.   LD [M]  drivers/scsi/scsi_wait_scan.ko
  59.   CC      net/ipv4/tcp_htcp.mod.o
  60.   LD [M]  net/ipv4/tcp_htcp.ko
  61.   CC      net/ipv4/tcp_westwood.mod.o
  62.   LD [M]  net/ipv4/tcp_westwood.ko
  63. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Kernel$
④打包内核
  1. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Kernel$ cd arch/arm/boot/
  2. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Kernel/arch/arm/boot$ tar cvf Kernel.tar zImage
  3. zImage
三星的odin3工具需要的是tar,里面包含的是boot.img,而不是zImage.
 打包工具是/home/senrsl/android/source/WORKING_DIRECTORY/system/core /mkbootimg
编译好麻烦,直接从之前那个github那里面把工具拷过来
把官方包里的boot.img解包查看信息。
  1. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Kernel/bin$ ./unpackbootimg -i boot_old.img -o /home/senrsl/android/source/SHV-E300L_KK_Opensource/Kernel/bin/out/
  2. Android magic found at: 0
  3. BOARD_KERNEL_CMDLINE
  4. BOARD_KERNEL_BASE 10000000
  5. BOARD_RAMDISK_OFFSET 01000000
  6. BOARD_SECOND_OFFSET 00f00000
  7. BOARD_TAGS_OFFSET 00000100
  8. BOARD_PAGE_SIZE 2048
  9. BOARD_SECOND_SIZE 0
  10. BOARD_DT_SIZE 0
查看解开的包
  1. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Kernel/bin$ cd out/
  2. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Kernel/bin/out$ ll总用量 6688
  3. drwxrwxr-x 2 senrsl senrsl    4096  3月 30 16:59 ./
  4. drwxrwxr-x 3 senrsl senrsl    4096  3月 30 16:59 ../
  5. -rw-rw-r-- 1 senrsl senrsl       9  3月 30 16:59 boot_old.img-base(5mkbootimg base参数)
  6. -rw-rw-r-- 1 senrsl senrsl       1  3月 30 16:59 boot_old.img-cmdline(3mkbootimg cmdline参数)
  7. -rw-rw-r-- 1 senrsl senrsl       0  3月 30 16:59 boot_old.img-dt
  8. -rw-rw-r-- 1 senrsl senrsl       5  3月 30 16:59 boot_old.img-pagesize(4mkbootimg pagesize参数)
  9. -rw-rw-r-- 1 senrsl senrsl 1405151  3月 30 16:59 boot_old.img-ramdisk.gz(2根文件系统打包文件)
  10. -rw-rw-r-- 1 senrsl senrsl       9  3月 30 16:59 boot_old.img-ramdisk_offset
  11. -rw-rw-r-- 1 senrsl senrsl       0  3月 30 16:59 boot_old.img-second
  12. -rw-rw-r-- 1 senrsl senrsl       9  3月 30 16:59 boot_old.img-second_offset
  13. -rw-rw-r-- 1 senrsl senrsl       9  3月 30 16:59 boot_old.img-tags_offset
  14. -rw-rw-r-- 1 senrsl senrsl 5403616  3月 30 16:59 boot_old.img-zImage(1内核文件)
打包boot.img
  1. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Kernel/bin$ ./mkbootimg --cmdline '' --kernel zImage --ramdisk ramdisk.img  -o boot.img --base 10000000
封tar
  1. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Kernel/bin$ tar cvf boot.tar boot.img
  2. boot.img
⑤尝试烧入
烧入成功,重启后显示第一屏厂商后黑屏。
拉出原版的boot.img打包成boot.tar,烧入后启动成功。

初步认为是ramdisk.img问题。
此时,bootimg工具文件夹bin上移为bootimg.
bootimg改为build_bootimg.

  1. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/build_bootimg$ ./mkbootimg --cmdline '' --kernel zImage --ramdisk ramdisk.img  -o boot.img --base 10000000
  2. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/build_bootimg$ ./unpackbootimg -i boot.img -o /home/senrsl/android/source/SHV-E300L_KK_Opensource/build_bootimg/out/
解包官方boot.img,提取boot.img-ramdisk.gz,查看结构为


重新打包自定义的boot.img,解包,查看boot.img-ramdisk.gz


//TODO 未成功,成功烧入后启动第一屏厂商logo后黑屏。

3,编译ROM

①准备工作
先看说明README_Platform.txt
  1. How to build Module for Platform
  2. - It is only for modules are needed to using Android build system.
  3. - Please check its own install information under its folder for other module.
  4. [Step to build]
  5. 1. Get android open source.
  6.     : version info - Android 4.4
  7.     ( Download site : http://source.android.com )
  8. 2. Copy module that you want to build - to original android open source
  9.    If same module exist in android open source, you should replace it. (no overwrite)
  10.     # It is possible to build all modules at once.
  11. 3. You should add module name to 'PRODUCT_PACKAGES' in 'build\target\product\core.mk' as following case.
  12.     case 1) e2fsprog : should add 'e2fsck' to PRODUCT_PACKAGES
  13.     case 2) blkid : should add 'libkeyutils' to PRODUCT_PACKAGES
  14.     case 3) libhyphenation : should add 'libkeyutils' to PRODUCT_PACKAGES
  15.     case 4) KeyUtils : should add 'libkeyutils' to PRODUCT_PACKAGES
  16.     case 5) libexifa : should add 'libexifa' to PRODUCT_PACKAGES
  17.     case 6) libjpega : should add 'libjpega' to PRODUCT_PACKAGES
  18.     ex.) [build\target\product\core.mk] - add all module name for case 1 ~ 5 at once
  19.         PRODUCT_PACKAGES += \
  20.             e2fsck \
  21.             blkid \
  22.             libhyphenation \
  23.             libkeyutils \
  24.             libexifa \
  25.             libjpega \
  26.             ebtables
  27. 4. excute build command
  28.     ./build_platform.sh
  29. Note :
  30. to build SBrowser (vendor/samsung/packages/apps/SBrowser),
  31. please refer to Buildme.txt at the folder mentioned above.
意思就是说分4部走,后面加了个注释。
分别是下载4.4的源码,把包里的要编译的模块拷进去(替换,非覆盖),增加要编译的模块到core.mk进行注册,执行编译脚本。
查看当前源码版本
senrsl@senrsl-ubuntu:~$ cd android/source/WORKING_DIRECTORY/
senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ repo branches
*  android-4.4.2_r2          | in all projects
    master                    | in:
                                      abi/cpp
                                      ....
所有的版本号里没有叫4.4的,只有4.4.*的。。。。
好吧,就用这个。

②替换模块
1)external目录,把这些目录剪出来
  1. senrsl@senrsl-ubuntu:~/android/source/test/三星替换 /external$ ll
  2. 总用量 40
  3. drwxrwxr-x 10 senrsl senrsl 4096  3月 30 14:53 ./
  4. drwxrwxr-x  4 senrsl senrsl 4096  3月 30 15:02 ../
  5. drwxrwxr-x 17 senrsl senrsl 4096  3月 20 13:35 chromium/
  6. drwxrwxr-x  9 senrsl senrsl 4096  3月 20 13:36 dnsmasq/
  7. drwxrwxr-x 19 senrsl senrsl 4096  3月 20 13:36 e2fsprogs/
  8. drwxrwxr-x  3 senrsl senrsl 4096  3月 20 13:36 gcc-demangle/
  9. drwxrwxr-x  4 senrsl senrsl 4096  3月 20 13:36 hyphenation/
  10. drwxrwxr-x 15 senrsl senrsl 4096  3月 20 13:36 iproute2/
  11. drwxrwxr-x 11 senrsl senrsl 4096  3月 20 13:36 iptables/
  12. drwxrwxr-x  4 senrsl senrsl 4096  3月 20 13:36 junit/
把这些目录放进去
  1. senrsl@senrsl-ubuntu:~$ cd android/source/SHV-E300L_KK_Opensource/Platform/external/
  2. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Platform/external$ ll
  3. 总用量 44
  4. drwxrwxr-x 11 senrsl senrsl 4096 10月 14 09:23 ./
  5. drwxrwxr-x  5 senrsl senrsl 4096  3月 30 13:10 ../
  6. drwxrwxr-x 17 senrsl senrsl 4096 10月  8 12:16 chromium/
  7. drwxrwxr-x  9 senrsl senrsl 4096 10月  8 09:07 dnsmasq/
  8. drwxrwxr-x 18 senrsl senrsl 4096 10月  8 09:07 e2fsprogs/
  9. drwxrwxr-x  2 senrsl senrsl 4096 10月  8 09:07 gcc-demangle/
  10. drwxrwxr-x  3 senrsl senrsl 4096 10月  8 09:07 hyphenation/
  11. drwxrwxr-x 14 senrsl senrsl 4096 10月  8 09:07 iproute2/
  12. drwxrwxr-x 10 senrsl senrsl 4096 10月  8 09:07 iptables/
  13. drwxrwxr-x  3 senrsl senrsl 4096 10月  8 09:07 junit/
  14. drwxrwxr-x 10 senrsl senrsl 4096 10月  8 12:23 webkit/
2)vendor目录,把vendor/samsung放进去
3)build目录,把这俩文件剪出来,把Platform里的放进去
  1. senrsl@senrsl-ubuntu:~/android/source/SHV-E300L_KK_Opensource/Platform/build$ tree
  2. .
  3. └── target
  4.     ├── board
  5.     │   └── generic
  6.     │       └── BoardConfig.mk
  7.     └── product
  8.         └── core.mk
  9. 4 directories, 2 files
③执行编译
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ ./build_platform.sh
报错
  1. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  2. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  3. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  4. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  5. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  6. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  7. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  8. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  9. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  10. Export includes file: frameworks/opt/emoji/Android.mk -- out/target/product/generic/obj/SHARED_LIBRARIES/libemoji_intermediates/export_includes
  11. Export includes file: external/harfbuzz/Android.mk -- out/target/product/generic/obj/SHARED_LIBRARIES/libharfbuzz_intermediates/export_includes
  12. Export includes file: external/webkit/Android.mk -- out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/export_includes
  13. Export includes file: external/libxml2/Android.mk -- out/target/product/generic/obj/STATIC_LIBRARIES/libxml2_intermediates/export_includes
  14. Export includes file: external/libxslt/Android.mk -- out/target/product/generic/obj/STATIC_LIBRARIES/libxslt_intermediates/export_includes
  15. Export includes file: external/hyphenation/Android.mk -- out/target/product/generic/obj/STATIC_LIBRARIES/libhyphenation_intermediates/export_includes
  16. Import includes file: out/target/product/generic/obj/SHARED_LIBRARIES/libemoji_intermediates/import_includes
  17. Import includes file: out/target/product/generic/obj/SHARED_LIBRARIES/libharfbuzz_intermediates/import_includes
  18. target Generated: libwebcore <= external/webkit/Source/WebCore/html/DocTypeStrings.gperf
  19. Generating HTMLEntityTable.cpp
  20. target Generated: libwebcore <= external/webkit/Source/WebCore/platform/ColorData.gperf
  21. WebCore Yacc: libwebcore <= external/webkit/Source/WebCore/css/CSSGrammar.y
  22. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  23. WebCore Yacc: libwebcore <= external/webkit/Source/WebCore/xml/XPathGrammar.y
  24. target Generated: libwebcore <= external/webkit/Source/WebCore/dom/make_names.pl
  25. Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
  26. BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
  27. Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
  28. BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
  29. make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/html/DocTypeStrings.cpp] 错误 2
  30. make: *** 正在等待未完成的任务....
  31. make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/platform/ColorData.cpp] 错误 2
  32. target Generated: libwebcore <= external/webkit/Source/WebCore/html/parser/HTMLEntityNames.in
  33. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ ./build_platform.sh
在core.mk里把    libwebcore \删掉,再build,报错
  1. Install: out/target/product/generic/system/fonts/NotoSansKhmerUI-Bold.ttf
  2. Install: out/target/product/generic/system/fonts/NotoSansKhmerUI-Regular.ttf
  3. Install: out/target/product/generic/system/fonts/NotoSansLao-Bold.ttf
  4. Install: out/target/product/generic/system/fonts/NotoSansLao-Regular.ttf
  5. Install: out/target/product/generic/system/fonts/NotoSansLaoUI-Bold.ttf
  6. Install: out/target/product/generic/system/fonts/NotoSansLaoUI-Regular.ttf
  7. Install: out/target/product/generic/system/fonts/NotoSansMalayalam-Bold.ttf
  8. collect2: error: ld returned 1 exit status
  9. Install: out/target/product/generic/system/fonts/NotoSansMalayalam-Regular.ttf
  10. make: *** [out/target/product/generic/obj/EXECUTABLES/dnsmasq_intermediates/LINKED/dnsmasq] 错误 1
  11. make: *** 正在等待未完成的任务....
  12. Install: out/target/product/generic/system/fonts/NotoSansMalayalamUI-Bold.ttf
  13. external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:339: error: undefined reference to 'ext2fs_test_bit64'
  14. external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:390: error: undefined reference to 'ext2fs_test_bit64'
  15. external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:186: error: undefined reference to 'ext2fs_test_bit64'
  16. external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:281: error: undefined reference to 'ext2fs_mem_is_zero'
  17. external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:178: error: undefined reference to 'ext2fs_clear_bit64'
  18. external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:170: error: undefined reference to 'ext2fs_set_bit64'
  19. external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:141: error: undefined reference to 'ext2fs_clear_bit64'
  20. external/e2fsprogs/lib/ext2fs/gen_bitmap64.c:735: error: undefined reference to 'ext2fs_get_bitmap_granularity'
  21. external/e2fsprogs/lib/ext2fs/gen_bitmap64.c:790: error: undefined reference to 'ext2fs_find_first_zero_generic_bitmap'
  22. external/e2fsprogs/lib/ext2fs/mmp.c:57: error: undefined reference to 'ext2fs_get_dio_alignment'
  23. external/e2fsprogs/lib/ext2fs/mmp.c:213: error: undefined reference to 'ext2fs_alloc_block2'
  24. collect2: error: ld returned 1 exit status
  25. make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/libext2fs_intermediates/LINKED/libext2fs.so] 错误 1
  26. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$
再把 libexifa \删掉,报错
  1. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/blkmap64_ba.o: In function `ba_find_first_zero':
  2. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:339: undefined reference to `ext2fs_test_bit64'
  3. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:390: undefined reference to `ext2fs_test_bit64'
  4. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/blkmap64_ba.o: In function `ba_test_bmap':
  5. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:186: undefined reference to `ext2fs_test_bit64'
  6. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/blkmap64_ba.o: In function `ba_test_clear_bmap_extent':
  7. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:281: undefined reference to `ext2fs_mem_is_zero'
  8. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/blkmap64_ba.o: In function `ba_unmark_bmap':
  9. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:178: undefined reference to `ext2fs_clear_bit64'
  10. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/blkmap64_ba.o: In function `ba_mark_bmap':
  11. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:170: undefined reference to `ext2fs_set_bit64'
  12. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/blkmap64_ba.o: In function `ba_resize_bmap':
  13. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/blkmap64_ba.c:141: undefined reference to `ext2fs_clear_bit64'
  14. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/gen_bitmap64.o: In function `ext2fs_convert_subcluster_bitmap':
  15. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/gen_bitmap64.c:735: undefined reference to `ext2fs_get_bitmap_granularity'
  16. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/gen_bitmap64.o: In function `ext2fs_find_first_zero_generic_bmap':
  17. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/gen_bitmap64.c:790: undefined reference to `ext2fs_find_first_zero_generic_bitmap'
  18. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/mmp.o: In function `ext2fs_mmp_read':
  19. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/mmp.c:57: undefined reference to `ext2fs_get_dio_alignment'
  20. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/mmp.o: In function `ext2fs_mmp_init':
  21. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/mmp.c:213: undefined reference to `ext2fs_alloc_block2'
  22. collect2: ld returned 1 exit status
  23. make: *** [out/host/linux-x86/obj/lib/libext2fs_host.so] 错误 1
  24. make: *** 正在等待未完成的任务....
  25. 1 warning generated.
  26. external/openssl/ssl/s2_clnt.c:1027:38: warning: unused parameter 'type' [-Wunused-parameter]
  27. int ssl2_set_certificate(SSL *s, int type, int len, const unsigned char *data)
  28.                                      ^
  29. 1 warning generated.
  30. external/openssl/ssl/s2_lib.c:385:38: warning: unused parameter 'larg' [-Wunused-parameter]
  31. long ssl2_ctrl(SSL *s, int cmd, long larg, void *parg)
  32.                                      ^
  33. external/openssl/ssl/s2_lib.c:385:50: warning: unused parameter 'parg' [-Wunused-parameter]
  34. long ssl2_ctrl(SSL *s, int cmd, long larg, void *parg)
  35.                                                  ^
  36. external/openssl/ssl/s2_lib.c:400:30: warning: unused parameter 's' [-Wunused-parameter]
  37. long ssl2_callback_ctrl(SSL *s, int cmd, void (*fp)(void))
  38.                              ^
  39. external/openssl/ssl/s2_lib.c:400:37: warning: unused parameter 'cmd' [-Wunused-parameter]
  40. long ssl2_callback_ctrl(SSL *s, int cmd, void (*fp)(void))
  41.                                     ^
  42. external/openssl/ssl/s2_lib.c:400:49: warning: unused parameter 'fp' [-Wunused-parameter]
  43. long ssl2_callback_ctrl(SSL *s, int cmd, void (*fp)(void))
  44.                                                 ^
  45. external/openssl/ssl/s2_lib.c:405:29: warning: unused parameter 'ctx' [-Wunused-parameter]
  46. long ssl2_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
  47.                             ^
  48. external/openssl/ssl/s2_lib.c:405:38: warning: unused parameter 'cmd' [-Wunused-parameter]
  49. long ssl2_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
  50.                                      ^
  51. external/openssl/ssl/s2_lib.c:405:48: warning: unused parameter 'larg' [-Wunused-parameter]
  52. long ssl2_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
  53.                                                ^
  54. external/openssl/ssl/s2_lib.c:405:60: warning: unused parameter 'parg' [-Wunused-parameter]
  55. long ssl2_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
  56.                                                            ^
  57. external/openssl/ssl/s2_lib.c:410:38: warning: unused parameter 'ctx' [-Wunused-parameter]
  58. long ssl2_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void))
  59.                                      ^
  60. external/openssl/ssl/s2_lib.c:410:47: warning: unused parameter 'cmd' [-Wunused-parameter]
  61. long ssl2_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void))
  62.                                               ^
  63. external/openssl/ssl/s2_lib.c:410:59: warning: unused parameter 'fp' [-Wunused-parameter]
  64. long ssl2_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void))
  65.                                                           ^
  66. 12 warnings generated.
  67. 1 warning generated.
  68. make: *** wait: 没有子进程。 停止。
  69. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$
然后把之前的core.mk第二部分替换成README里的,报错
  1. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/mmp.c:57: undefined reference to `ext2fs_get_dio_alignment'
  2. out/host/linux-x86/obj/SHARED_LIBRARIES/libext2fs_host_intermediates/mmp.o: In function `ext2fs_mmp_init':
  3. /home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/mmp.c:213: undefined reference to `ext2fs_alloc_block2'
  4. collect2: ld returned 1 exit status
  5. make: *** [out/host/linux-x86/obj/lib/libext2fs_host.so] 错误 1
  6. make: *** 正在等待未完成的任务....
  7. Processing target/product/generic/dex_bootjars/system/framework/core.jar
  8. Done!
然后把core.mk里第二部分全都删掉,报的错还是上面那个。
恢复下core.mk重来,
报1:报错external/webkit/Source/WebCore/make-hash-tools.pl line 23.,core.mk砍掉 libwebcore \ 代码砍掉external/webkit.
报2:/home/senrsl/android/source/WORKING_DIRECTORY/external/e2fsprogs/lib/ext2fs/mmp.c:213: undefined reference to `ext2fs_alloc_block2',external/e2fsprogs 代码换回原版。
报3/home/senrsl/android/source/WORKING_DIRECTORY/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: out/target/product/generic/obj/EXECUTABLES/dnsmasq_intermediates/dhcp-common.o: multiple definition of 'option_string'
/home/senrsl/android/source/WORKING_DIRECTORY/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: out/target/product/generic/obj/EXECUTABLES/dnsmasq_intermediates/option.o: previous definition here
,external/dnsmasq换回原版。
然后编译
这样竟编译成功
  1. Creating filesystem with parameters:
  2.     Size: 576716800
  3.     Block size: 4096
  4.     Blocks per group: 32768
  5.     Inodes per group: 7040
  6.     Inode size: 256
  7.     Journal blocks: 2200
  8.     Label:
  9.     Blocks: 140800
  10.     Block groups: 5
  11.     Reserved block group size: 39
  12. Created filesystem with 892/35200 inodes and 65272/140800 blocks
  13. + '[' 0 -ne 0 ']'
  14. Install system fs image: out/target/product/generic/system.img
  15. out/target/product/generic/system.img+ maxsize=588791808 blocksize=2112 total=576716800 reserve=5947392
镜像文件输出到了/home/senrsl/android/source/WORKING_DIRECTORY/out/target /product/generic

4)封包
查看下官方提供的E300LKLUFNE4_E300LLGTFNE4_E300LKLUFNC1_HOME.tar

依次罗列了这几个img.
尝试封装
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/out/target/product/generic$ tar cvf p.tar cache.img ramdisk.img system.img userdata.img
  2. cache.img
  3. ramdisk.img
  4. system.img
  5. userdata.img
然后重启系统去烧。

//TODO 未成功,无法烧入


代码回退,编别的。
2015年03月31日19:09:31

--
senRsl
2015年03月30日13:21:20

没有评论 :

发表评论