what's the best way to compile android kernel?

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

what's the best way to compile android kernel?

跳至解决方案
3,615 次查看
Sun1z
Contributor III

Hi All,

I use android M6.0.1_2.1.0 GA for i.MX6Q sabre board, sometimes I will modify the kernel driver, after that, how can I update the boot-imx6q.img? in the android user guide there is a way to compile the kernel standalone, however, only zImage/uImage generated and no boot-imx6q.img is updated, currently I use "make bootimg" to update the boot-imx6q.img, it's a bit slower than compiling the kernel only, besides that, if I modify the menuconfig, "make bootimg" will be fail as followed:

No private recovery resources for TARGET_DEVICE sabresd_6dq
make: *** No rule to make target `bootimg'.  Stop.

#### make failed to build some targets (42 seconds) ####

Does someone can give me some advice on the actions for kernel modication? thanks.

B.R.

Sun

标签 (4)
0 项奖励
回复
1 解答
2,788 次查看
JayTu
NXP Employee
NXP Employee

You can un-pack boot.img (See device/fsl/common/tools/split_bootimg.pl) and replace with kernel or dtb then re-pack it.

In fact, it's android build system issue. In N7, android used ninja which is quite fast now.

在原帖中查看解决方案

0 项奖励
回复
5 回复数
2,788 次查看
JayTu
NXP Employee
NXP Employee

We checked if the .config in kernel is the same as the one in product out. If it's not, we will gernerate it again.

So, there's two options

1. Save your config to default or

2. Copy your .config to out

For each instance, you can compile it alone. But you still need gernerate boot.img for flashing.

0 项奖励
回复
2,788 次查看
Sun1z
Contributor III

Hi JayTu,

"But you still need gernerate boot.img for flashing."

That's my question indeed, if I have compiled the kernel and/or dts file, which way to generate boot.img quickly?

In the build-log I found mkbootimg and boot_signer are used, just wonder any official instruction is ready or not.

0 项奖励
回复
2,789 次查看
JayTu
NXP Employee
NXP Employee

You can un-pack boot.img (See device/fsl/common/tools/split_bootimg.pl) and replace with kernel or dtb then re-pack it.

In fact, it's android build system issue. In N7, android used ninja which is quite fast now.

0 项奖励
回复
2,788 次查看
Rita_Wang
NXP TechSupport
NXP TechSupport

Hi Sun,

When you uptate your kernel, after you build kernel images you can use the mfgtool to download all images to your board. But you need to download all images every time you do modify. So you can use the NFS, boot from NFS, it will be more convinent.
Have a great day,
Rita

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
2,788 次查看
Sun1z
Contributor III

Hi Rita,

I'm afraid you misunderstood what I said. I know how to program images to the board. my question is how to compile. suppose there are 3 instances:

1. modify kernel dts only

2. modify kernel config only (use "make menuconfig")

3. modify a driver source code in kernel

For each one in these 3 instances, how can I compile it to generate "boot-imx6q.img", of course re-compile whole the workspace is always doable but which is too slow. Currently for the 3rd instance I use "make bootimg" which saves a bit of  time but still is too slow, for the 1st and 2nd instance "make bootimg" fails to compile the image file.

I have found a batch file which can make the kernel only and pack required files to image file, however, it comes from android 4.4.2 BSP and seems not valid for android 6.0.1_2.1.0

B.R.

Sun

0 项奖励
回复