How can I create a download without going through all the makefiles

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

  • Make kernel code changes
  • Build with make bootimage
  • Flash with fastboot flash boot

It works great. However, building takes unnecessary time because make bootimage first goes through the whole tree and includes all the Android.mk files. This takes longer than compiling the kernel itself and creating a boot image. Inclusion of these files is not required since there are no changes to them. To reduce the processing time in my workflow, I would like to speed up the build step.

When creating other other projects, there are ways to not create dependencies and thus skip reading all Android.mk files (for example, mm ).

There is a goal to make bootimage-nodeps , which seems to do the right thing: it creates a new boot image without going through all the Android.mk files. Unfortunately, dependencies also include a kernel (which is therefore not created, although there are changes).

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

+5
source share
3 answers

If you are still looking at it, try using the showcommands target in make , for example:

 make bootimage showcommands 

showcommands will display all the commands needed to build the kernel and boot image. Some of the commands, including for creating a boot image, have $(hide) in front and are not displayed.

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

+2
source

I'm not sure that you can save time this way (since this solution needs to be zipped / unzipped several times, which takes more time than to search all Android.mks on my machine), but as your question:

Is there a way to create a kernel and create a bootable image using to read all Android.mk files.

you can try:

Preperations:

  • call make dist once
  • unzip target_files.zip to out/dist/

now create a script that does the following for you:

  • overwrite the kernel in the unpacked target_files with the new kernel core
  • Replace target_files with your new kernel
  • use the python script img_from_target_files from build/tools/releasetools/ with the optional -z option. Example: img_from_target_files -z out/dist/target_files.zip new_imgs.zip
  • inside the newly created new_imgs.zip you will find a new boot.img with a new kernel
0
source

You can try the make SINGLE_SHOT - if you know the path to your Andorid.mk:-

m -j8 ONE_SHOT_MAKEFILE=build/target/board/Android.mk bootimage

This worked pretty well for me in Android L / M / N releases.

0
source

Source: https://habr.com/ru/post/1266928/


All Articles