美文网首页
Pixel3XL 构建自己的内核

Pixel3XL 构建自己的内核

作者: 付凯强 | 来源:发表于2024-04-24 08:14 被阅读0次
    1. 找到Pixel 3XL对应的内核版本
      https://source.android.com/docs/setup/build/building-kernels?hl=zh-cn#supported-kernel-branches
      Pixel 3 XL (crosshatch) android-msm-crosshatch-4.9-android12
    2. 下载内核源代码
    mkdir android-kernel && cd android-kernel
    repo init -u https://android.googlesource.com/kernel/manifest -b android-msm-crosshatch-4.9-android12
    repo sync -cdj4
    
    1. 删除源码下载的img
    cd out/target/product/crosshatch
    
    $rm *.img kernel
    rm: remove regular file 'boot-debug.img'? 
    rm: remove regular file 'boot.img'? 
    rm: remove regular file 'bootloader.img'? 
    rm: remove regular file 'boot-test-harness.img'? 
    rm: remove regular file 'dtb.img'? 
    rm: remove regular file 'dtbo.img'? 
    rm: remove regular file 'persist.img'? 
    rm: remove regular file 'product.img'? 
    rm: remove regular file 'radio.img'? 
    rm: remove regular file 'ramdisk-debug.img'? 
    rm: remove regular file 'ramdisk.img'? 
    rm: remove regular file 'ramdisk-recovery.img'? 
    rm: remove regular file 'ramdisk-test-harness.img'? 
    rm: remove regular file 'super_empty.img'? 
    rm: remove regular file 'system_ext.img'? 
    rm: remove regular file 'system.img'? 
    rm: remove regular file 'system_other.img'? 
    rm: remove regular file 'userdata.img'? 
    rm: remove regular file 'vbmeta.img'? 
    rm: remove regular file 'vendor.img'? 
    rm: remove regular file 'kernel'? 
    

    TODO: 这里是不是删除boot.img和kernel就可以了?

    1. 替换Image.lz4
    mv Image.lz4 ../../../../android_backup
    

    等待kernel编译完成,编译完成之后:

    cp /home/fukaiqiang/work/android-kernel/out/android-msm-pixel-4.9/dist/Image.lz4 /home/fukaiqiang/work/code/device/google/crosshatch-kernel
    
    1. 再次编译android工程
    source build/envsetup.sh
    lunch aosp_crosshatch-userdebug
    make -j16
    
    1. 刷机
      还不知道如何编译下载和编译和刷写android源码的,可以看这篇文章 https://www.jianshu.com/p/8c402a0210d9

    参考:https://juejin.cn/post/7250756790240018492#heading-28

    相关文章

      网友评论

          本文标题:Pixel3XL 构建自己的内核

          本文链接:https://www.haomeiwen.com/subject/ijgwxjtx.html