en Packaging and Flashing - JackA1ltman/NonGKI_Kernel_Build_2nd GitHub Wiki
Packaging and Flashing
Local Build ยท Step 4
After a successful build, the kernel image is located at out/arch/arm64/boot/. Two packaging methods are available.
Method 1: Anykernel3
- Repository:
https://github.com/osm0sis/AnyKernel3 - Branch:
master
Steps:
-
Move
out/arch/arm64/boot/Image.gz-dtbinto the Anykernel3 directory -
Edit
anykernel.shand set the following three values:
do.devicecheck=0
BLOCK=auto;
is_slot_device=auto;
-
Zip the entire Anykernel3 directory into a flashable package
-
Boot into Recovery and flash the zip
Method 2: MKBOOTIMG
- Repository:
https://android.googlesource.com/platform/system/tools/mkbootimg - Branch:
main-kernel-build-2024
Steps:
-
Extract a clean
boot.imgfrom your device and place it at/home/username/boot.img -
Unpack the image and capture the repacking parameters:
BOOT_CMD=$(echo `mkbootimg/unpack_bootimg.py --boot_img=boot.img --format mkbootimg`)
mkbootimg/unpack_bootimg.py --boot_img boot.img
-
Rename your compiled
Image.gz-dtbtokerneland replace the existingkernelfile inside theout/directory -
Repack the boot image:
eval "mkboottools/mkbootimg.py $BOOT_CMD -o boot_moded.img"
- Boot into fastboot and flash:
fastboot flash boot boot_moded.img