环境:ubuntu 12.04 x64
1. 安装编译环境
- sudo apt-get install ncurses-dev git-core gnupg flex bison gperf build-essential \
- zip curl libc6-dev x11proto-core-dev \
- libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
- libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
- python-markdown libxml2-utils xsltproc zlib1g-dev:i386
- sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
2. 下载samsung内核源码,checkout jb源码
- git clone
- cd samsung
- git branch -a
- git checkout -b android-samsung-3.0-jb origin/android-samsung-3.0-jb
3. 下载android交叉编译链
4. 设置交叉编译环境
- export PATH=~/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
- export ARCH=arm
- export SUBARCH=arm
- export CROSS_COMPILE=arm-eabi-
5. 查看内核版本是否与手机内核版本匹配
- cd samsung
- make kernelversion
6. 配置内核
- make herring_defconfig
- make menuconfig #添加其他配置
7. 编译内核
8. 内核外部模块makefile
- KERNELDIR := /home/android/android/samsung
- PWD :=$(shell pwd)
- ARCH=arm
- CROSS_COMPILE=arm-eabi-
- CC=$(CROSS_COMPILE)gcc
- LD=$(CROSS_COMPILE)ld
- obj-m := hello.o
- modules:
- $(MAKE) -C $(KERNELDIR) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) M=$(PWD) modules
- clean:
- $(MAKE) -C $(KERNELDIR) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) M=$(PWD) clean
阅读(6649) | 评论(0) | 转发(0) |