赞
踩
使用git clone
git clone --depth=1 https://github.com/ASUS-X00TD/android_kernel_asus_sdm660 -b S240
或者直接在github上下载:https://github.com/ASUS-X00TD/android_kernel_asus_sdm660/tree/S240
此路径提供的版本可能不对,git clone --depth=1 https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9,请使用:https://download.csdn.net/download/u011057800/11327980
sudo apt install -y bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev unzip openjdk-8-jdk language-pack-zh-hans
- export ANDROID_AARCH64=/home/chenls/aarch64-linux-android-4.9/bin/
- export ARCH=arm64
- export SUBARCH=arm64
- export PATH=$PATH:$ANDROID_AARCH64
- export CROSS_COMPILE=aarch64-linux-android-
注意:ANDROID_AARCH64为编译链工具所在路径。
在arch/arm64/configs/目录下有不同配置文件,我们选择ql1650-perf_defconfig
- mkdir out
- make O=out ql1650-perf_defconfig
- cd out # 进入out目录
- make -j4 O=out # 开始编译,-j4表示并行编译数,即4个进程并行编译
- cd .. # 回到跟目录
编译完成后,会在out/arch/arm64/boot目录生成Image.gz-dtb文件,此为编译出来的内核文件。
将刷机包中的boot.img拷贝到AIK-Linux目录下,执行./unpackimg.sh解包,把./split_img/boot.img-zImage文件删掉,然后将Image.gz-dtb文件拷贝到./split_img目录下,并重命名为boot.img-zImage。
执行./repackimg.sh,生成image-new.img文件,即我们可以刷入的boot.img文件。
AIK-Linux下载:https://download.csdn.net/download/u011057800/10955558
工程机原boot.img下载:https://download.csdn.net/download/u011057800/10955542
- adb reboot bootloader
- secret_key=`fastboot getvar secret-key-opt 2>&1 | grep secret-key-opt | awk '{print $NF}'`
- secret_partition=`fastboot oem get_random_partition 2>&1 | grep bootloader | awk '{print $NF}'`
- echo $secret_key > default_key.bin
- fastboot flash $secret_partition default_key.bin
- fastboot flashing unlock
- fastboot flashing unlock_critical
- fastboot reboot
- adb reboot bootloader
- fastboot flash boot image-new.img
- fastboot reboot
注意:由于WIFI模块在Qualcomm中管理,刷入后WIFI 不能正常工作。可参考此链接查看详情:https://github.com/MiCode/Xiaomi_Kernel_OpenSource/wiki/FAQ
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。