01, Getting the kernel source android-kernel-samsung-dev.tar.gz
转载请注明出处[By SELinux+]
Getting the arm-gcc arm-linux-androideabi-4.4.x.tar.gz
We can find arm-gcc in framework /prebuilt/linux-x86/toolchain/arm-eabi-*
02, extract kernel source and arm-gcc
03, Set environment:
export ARCH=arm export SUBARCH=arm export CROSS_COMPILE=arm-linux-androideabi- export KERNEL_DIR=/PATH/android-kernel-samsung-dev export PATH=$PATH:/PATH/arm-linux-androideabi-4.4.x/bin
04, goto kernel source folder:
make distclean make smdk4412_android_defconfig make -j4
05, When done, you can find kernel “zImage” in ./arch/arm/boot
/tmp/cc83jIHf.s: Assembler messages: /tmp/cc83jIHf.s:69: Error: unknown pseudo-op: `.arch_extension' /tmp/cc83jIHf.s:282: Error: unknown pseudo-op: `.arch_extension' /tmp/cc83jIHf.s:304: Error: unknown pseudo-op: `.arch_extension' make[2]: *** [drivers/misc/tzic.o] 错误 1 make[1]: *** [drivers/misc] 错误 2 make: *** [drivers] 错误 2
[root@fc16 smdk4412]# make mrproper
[root@fc16 smdk4412]# mkdir out [root@fc16 smdk4412]# make -C . O=./out ARCH=arm CROSS_COMPILE=/root/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin cyanogenmod_n8000_defconfig make: 进入目录“/root/android/system/kernel/samsung/smdk4412” HOSTCC scripts/basic/fixdep GEN /root/android/system/kernel/samsung/smdk4412/out/Makefile HOSTCC scripts/kconfig/conf.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 arch/arm/mach-exynos/Kconfig:875:warning: choice value used outside its choice group arch/arm/mach-exynos/Kconfig:877:warning: defaults for choice values not supported # # configuration written to .config # make: 离开目录“/root/android/system/kernel/samsung/smdk4412”
编译时候注意CROSS_COMPILE版本问题
[root@fc16 smdk4412]# make -C . O=./out ARCH=arm CROSS_COMPILE=/root/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi- zImage -j4