Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I build bootimage without going through all Makefiles

I am currently working on the Linux kernel for an Android phone. My workflow is:

  1. Make changes to kernel code
  2. Build with make bootimage
  3. Flash with fastboot flash boot

This works fine. However building takes unnecessary long because make bootimage first goes through the entire tree and includes all Android.mk files. This takes longer than actually compiling the kernel and creating a boot image. Including these files should not be necessary since there are no changes to them. To decrease turnaround time in my workflow, I would like to speed up the build step.

When building other other projects, there are ways to to not build dependencies and thus skip reading all Android.mk files (for instance mm).

There is a make target bootimage-nodeps which seems to do the right thing: It makes a new boot image without going through all Android.mk files. Unfortunately dependencies also include the kernel itself (which therefore does not get built although there are changes).

My question is: Is there a way to build the kernel and create a boot image withouth having to read all Android.mk files.

like image 784
justfortherec Avatar asked Apr 19 '17 15:04

justfortherec


1 Answers

In case you 're still looking into it, try using the showcommands goal at make, for example :

make bootimage showcommands

The showcommands goals will show all commands needed to build the kernel and the bootimage. Some of the commands, including the one to create the bootimage have $(hide) in front and are not shown.

Once you know the commands and the arguments, next time you need to make the bootimage you can run the commands manually (without using make bootimage and without including all the makefiles). I have exactly the same problem and this is the only working solution I've found.

like image 179
Joo Avatar answered Sep 22 '22 21:09

Joo