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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,480 次查看
bryan_hong
Senior Contributor I

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

 

0 项奖励
回复
1 解答
1,444 次查看
danielchen
NXP TechSupport
NXP TechSupport

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

 

 

 

 

 

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,351 次查看
bryan_hong
Senior Contributor I

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

 

 

0 项奖励
回复
1,431 次查看
bryan_hong
Senior Contributor I

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?

0 项奖励
回复
1,445 次查看
danielchen
NXP TechSupport
NXP TechSupport

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

 

 

 

 

 

 

0 项奖励
回复
1,364 次查看
Dhaval_Shiroya
Contributor I

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.

0 项奖励
回复