what's the best way to compile android kernel?

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

what's the best way to compile android kernel?

Jump to solution
2,119 Views
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

Labels (4)
0 Kudos
1 Solution
1,292 Views
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.

View solution in original post

0 Kudos
5 Replies
1,292 Views
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 Kudos
1,292 Views
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 Kudos
1,293 Views
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 Kudos
1,292 Views
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 Kudos
1,292 Views
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 Kudos