pixel android9 kernel 内核编译

  1. 下载内核源码
cd ~/Desktop/aosp9
git clone https://aosp.tuna.tsinghua.edu.cn/android/kernel/msm.git
cd msm
  1. 确定分支
    通过cat /proc/version确定内核版本,


    image.png
//安装必要的工具
$ sudo apt-get install liblz4-tool
//选择marlin-3.18-pie-qpr1
git branch -a |grep marlin 
git checkout remotes/origin/android-msm-marlin-3.18-pie-qpr1
  1. 添加交叉编译链
export CROSS_COMPILE=/home/ruin/Desktop/aosp9/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
export CROSS_COMPILE_ARM32=/home/ruin/Desktop/aosp9/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-
export ARCH=arm64
export SUBARCH=arm64
make marlin_defconfig
make -j8

4 生成镜像


image.png

5.生成boot.img

export TARGET_PREBUILT_KERNEL=~/Desktop/aosp9/msm/arch/arm64/boot/Image.lz4-dtb
source build/envsetup.sh
lunch [pixel]
rm out/target/product/sailfish/boot.img &&  make bootimage
  1. 刷机
adb reboot bootloader
fastboot flash boot boot.img

参考资料

google kernel compile

你可能感兴趣的:(pixel android9 kernel 内核编译)