eve icon indicating copy to clipboard operation
eve copied to clipboard

Makefile: include kernel image from a file into resulting rootfs

Open rouming opened this issue 11 months ago • 3 comments

< hack-mode-to-ease-kernel-prototypes-and-quick-testing-iterations >

Consider this as a cry from my heart: enormous amount of time is wasted during kernel rebuild on every small testing change in the kernel. Now any kernel image can be used by providing path to a file. You heard it right: path-to-a-file. No docker. Yay!

How? Simple:

make KERNEL_IMAGE=~/devel/linux/arch/x86_64/boot/bzImage live

cc: @rene @rucoder (For some reason, I can't add @rene as a reviewer. What a bummer)

</ hack-mode-to-ease-kernel-prototypes-and-quick-testing-iterations >

rouming avatar Mar 13 '24 17:03 rouming

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 17.51%. Comparing base (eac1aff) to head (ad90c4e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3814   +/-   ##
=======================================
  Coverage   17.51%   17.51%           
=======================================
  Files           3        3           
  Lines         805      805           
=======================================
  Hits          141      141           
  Misses        629      629           
  Partials       35       35           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 13 '24 17:03 codecov[bot]

@rouming , I totally understand your pain, but this will be the kind of hack that will be merged and forget it without solve the real issue, the time that still takes to build our kernel... I bet that the time it takes to remove the image from the tarball and build it with the new one is not so different than build a container just with your kernel image (I'm thinking in a custom container that just takes your binaries from a mounted folder....). Also, you are just replacing the kernel image without any care with the modules... so this approach in the Makefile can easily turn the image non-bootable....

IMHO the right way to solve the problem is to customize the Makefile.eve from eve-kernel and create a custom target that won't build the whole kernel inside the container, but it just considers kernel is built locally and take the binaries (image + modules) to build the final container, then it can be integrated in EVE using the standard way (KERNEL_TAG variable)....

rene avatar Mar 13 '24 18:03 rene

@rene Rene, probably I was not clear enough, sorry about that. This is only for daily development usage. You build kernel with the 'make' in your local directory (this can be eve-kernel repo or original), and immediately get a working live image, do tests, repeat. Again, hacking mode, quick solution. I miss that. I'm tired of product approach "everything docker" we have.

And absolutely you are right, I missed a lot of things (modules are parts of that). I'm not making a feature here. I'm opening a door for you and Mike for easy development and hacking. If you start using this KERNEL_IMAGE for quick build-test-repeat iterations for your daily needs and you missed modules (or anything else) - you are welcome, add few lines more, update tar, or invent something else. My approach is similar to collect-info.sh script, which I did to fix immediate gap and ease collecting states, now there are plans to make a feature out of this (but you should be aware).

rouming avatar Mar 14 '24 09:03 rouming

@eriknordmark If you don't have any objections, can we merge this? This simple "hack" reduces time of build-try-repeat kernel testing cycles from minutes to seconds and does not affect anything else.

rouming avatar Mar 21 '24 12:03 rouming

@eriknordmark If you don't have any objections, can we merge this? This simple "hack" reduces time of build-try-repeat kernel testing cycles from minutes to seconds and does not affect anything else.

If others plan to use this then I have no issue with merging it. Just want to make sure it isn't a special thing for only one developer.

eriknordmark avatar Mar 21 '24 14:03 eriknordmark