7

I am using buildroot to build linux firmware. How can I do a clean rebuild the linux kernel only (without having to build the whole thing which take an hour)?

I tried -

make linux-rebuild

but that does not do a clean.

I have also tried

make linux-reconfigure && make linux-rebuild

but that does not work either.

NiladriBose
  • 1,849
  • 2
  • 16
  • 31
  • Please edit your post and include the messages/errors you have after those commands. – user2699113 May 18 '18 at 03:39
  • I usually `cd` to the kernel directory, then `make ARCH= clean`, and delete the *salient* **.stamp*** files, e.g. **.stamp_build**. Be careful to not delete all of them. – sawdust May 21 '18 at 06:49

3 Answers3

14

If you want to remove all of the changes in sources of the linux kernel be in buildroot directory (cd buildroot) and do following:

make linux-dirclean
make linux-rebuild

The first command will remove output/build/linux* directory and the second one will fetch and rebuild from scratch the kernel.

DungeonLords
  • 107
  • 7
user2699113
  • 4,262
  • 3
  • 25
  • 43
-1

I've found in the buildroot /dl folder a copy of the kernel repo is stored in there as a tar.gz file. If you do not delete that file, buildroot will not pull any kernel updates.

Adam
  • 1
-3

after reading a lot through buildroot manual and trail and error - this is what you need to do for cleaning of linux only -

make clean linux
NiladriBose
  • 1,849
  • 2
  • 16
  • 31
  • 8
    "make clean linux" will clean the entire build, not just Linux, so this answer is wrong. – Thomas Petazzoni May 18 '18 at 09:46
  • wrong , atleast for 2016.02 for cleaning entire build i had to do - make clean all. Make clean linux rebuilds linux-custom. – NiladriBose May 18 '18 at 12:48
  • 1
    Hmm, Thomas is a maintainer of BR distribution. I think he knows what he is talking about. – 0andriy May 20 '18 at 18:12
  • Ok , what is the difference between make clean linux and make clean all? or in other words what is the purpose of make clean linux or make clean – NiladriBose May 21 '18 at 11:57
  • Or why on earth will make clean clean the entire build !! lol – NiladriBose May 21 '18 at 12:04
  • 2
    @NiladriBose Why `make clean linux` cleans the entire build? Because that's how `make` works: `make clean linux` will basically run `make clean` followed by `make linux`. It's not "Hey *make*, please clean the linux package" but: "*make*, please run the `clean` target and then run the `linux` target". – Stephan Henningsen Nov 08 '20 at 22:05