1996856_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

1996856_en-US

1996856_en-US

[imx8mn lpddr4] how to replace kernel with my changes on android 14.0.0_2.2.0

dear nxp 

For example, 

I have modified as below

imx-android-14.0.0_2.2.0/android_build/vendor/nxp-opensource/kernel_imx$ vi arch/arm64/kernel/setup.c +97

pr_info("BCooting Linux on ...

then, executed below

./imx-make.sh kernel

./imx-make.sh bootimage


fastboot flash boot_a boot.img


But BCooting did not be presented at booting.

How do I apply kernel modifications?

Thanks in advanced


Re: [imx8mn lpddr4] how to replace kernel with my changes on android 14.0.0_2.2.0

dear Dhaval_Shiroya

First, thanks for your comments.

I have changes `arch/arm64/kernel/setup.c` and arch/arm64/boot/dts/freescale/imx8mn-evk.dts as below.

   pr_info("BBBCooting Linux

   model = "N_NXP i.MX8MNano EVK board";

then, 

Compile kernel, dtb and flash as below.

rm -rf out

./imx-make.sh kernel

./imx-make.sh dtboimage

adb reboot bootloader

fastboot flash boot boot.img

fastboot flash dtbo_a dtbo-imx8mn.img

then

adb logcat -b all | grep -i "N_NXP"
01-01 00:00:00.000 0 0 I Machine model: N_NXP i.MX8MNano EVK board

but 

adb logcat -b all | grep -i "BBBCooting"  <- it can't  be founded

so, In summary

It seems that Google's boot.img not being modified.

Thanks,

Bryan



Re: [imx8mn lpddr4] how to replace kernel with my changes on android 14.0.0_2.2.0

Hello,


Yes, it is possible to modify the kernel, and the changes are reflected in the boot.img.

After building, the boot.img file can be found in the following directory:

/imx-android-14.0.0_2.2.0/android_build/out/target/product/evk_8mn/boot.img


The boot.img is a composite image that includes the kernel and boot parameters. When you rebuild the kernel source code your changes are incorporated into this image.


Steps to Rebuild and Verify:

  1. Ensure Your Changes Are Saved:
    • After modifying the kernel source file (e.g., setup.c), save the changes.
    • Verify the modification by reopening the file:
      vim arch/arm64/kernel/setup.c
  2. Rebuild the Kernel and Boot Image:
    • Clean and rebuild the kernel and boot image to ensure the changes are applied:
      ./imx-make.sh clean  
      ./imx-make.sh kernel  
      ./imx-make.sh bootimage  
  3. Flash the Updated Boot Image:
    • Flash the newly built boot.img to the device:
      fastboot flash boot boot.img  
      fastboot reboot  
  4. Verify the Modification:
    • Use ADB logcat to confirm the pr_info() message is visible at boot time:
      adb logcat -b all | grep -i "BCooting"  
    • Alternatively, connect via Minicom serial communication to check the logs directly during boot.

 

Your modification "BCooting Linux on ..." should now appear in the logs if all the steps are followed correctly.

Re: [imx8mn lpddr4] how to replace kernel with my changes on android 14.0.0_2.2.0

thanks for your comments.

Could you share a document on how to modify kernels other than GKI? For example, is there a document on how to modify the source code for the vendor_boot.img?

Re: [imx8mn lpddr4] how to replace kernel with my changes on android 14.0.0_2.2.0

Hi @bryan_hong 


The modifications in your code is in boot.img.   it is under folder

/imx-android-14.0.0_2.2.0/android_build/out/target/product/evk_8mn

boot.img is a composite image, which includes the AOSP generic Kernel image and boot parameters.

danielchen_2-1732090282223.png

The boot.img is from google, you can not change it.   By default, fastboot only program the default image from google.


Regards

Daniel







Tags (1)
No ratings
Version history
Last update:
‎11-21-2025 02:56 PM
Updated by: