个人备忘:Nexus 4 Faux 内核编译

测试环境:Ubuntu x64
先安装软件:

sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre phablet-tools pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

64位还需安装:

sudo apt-get install g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

(好多包要装,还好digitalocean有mirror,应该是内网下载吧)

新建目录:

mkdir ~/android
cd ~/android

准备代码和编译工具:

git clone https://github.com/faux123/mako.git kernel
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8 toolchain

打上 CAF 补丁:

cd kernel/
git remote add cm https://github.com/CyanogenMod/android_kernel_google_msm.git
git fetch cm
git cherry-pick c53fb6d134fab3e3d7a022ba857d9cad4fcfa59a
git cherry-pick 07cbfb9a9cededdb5a283b56dded9c9ff69656a1
cd ..

配置参数:

export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=~/android/toolchain/bin/arm-linux-androideabi-
cd ~/android/kernel
make defconfig
make -j2

可以提取手机的 /proc/config.gz 解压得到编译配置,改名为 .config 放到源代码目录可使用之前的配置

标签:


添加新评论