Buildroot linux kernel clean build
Asked Answered
D

3

8

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.

Diaphragm answered 17/5, 2018 at 21:21 Comment(2)
Please edit your post and include the messages/errors you have after those commands.Rothenberg
I usually cd to the kernel directory, then make ARCH=<arch> clean, and delete the salient .stamp* files, e.g. .stamp_build. Be careful to not delete all of them.Limb
R
15

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.

Rothenberg answered 18/5, 2018 at 3:53 Comment(3)
Thanks for your answer , and good to know about <pkg>-dirclean. but this is I was wanting to do , I was looking for a clean rebuild behaviour.Diaphragm
@Diaphragm how is the clean behaviour not clean with linux-dirclean? What do you observe?Kingcraft
just a note - if download cache is enabled in BR, you'll need to delete linux.tar distro thereLesser
E
-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.

Elba answered 8/2, 2019 at 20:32 Comment(0)
D
-4

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
Diaphragm answered 18/5, 2018 at 8:41 Comment(6)
"make clean linux" will clean the entire build, not just Linux, so this answer is wrong.Marginalia
wrong , atleast for 2016.02 for cleaning entire build i had to do - make clean all. Make clean linux rebuilds linux-custom.Diaphragm
Hmm, Thomas is a maintainer of BR distribution. I think he knows what he is talking about.Grube
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 <package name>Diaphragm
Or why on earth will make clean <package name> clean the entire build !! lolDiaphragm
@Diaphragm 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".Madelene

© 2022 - 2024 — McMap. All rights reserved.