View Full Version : Re-compiling a kernel
02-24-2004, 06:39 PM
If one builds a kernel, then goes for days thinking everything is right, then finds out something was left out, how do you go about rebuilding?
In the past, I have simply deleted the whole damn build tree and started over. I know there is an easier way, but I have never seen that addressed. After the build, I always use "make clean" to ready the build tree for the next one if necessary.
Now it's necessary. Everything was fine until I mounted a floppy. I forgot vfat! Don't laugh too daggone hard please.
I knew it was too smooth to be true!
:-) :-) :-) :-) :-)
02-24-2004, 06:45 PM
Just cd into the directory and type
This does not clobber your .config or .depend files. So all you have to do after that is type make menuconfig and change what you want, save the config and then make bzImage and follow the usual steps after that.
02-24-2004, 06:47 PM
Don't quote me on this but open a terminal and cd to where you current .config file is and make clean, make oldconfig or what I do is make menuconfig and just change what you need to.
Then go through the rest of the building a kernel process.
Better wait for confirmation first ;)
02-24-2004, 06:50 PM
What about "make dep"? Is that not necessary for rebuilding? The last time I tried a rebuild, I used "make dep after saving the changes. I got an error after bzImage that said a file of that name was already there.
02-24-2004, 06:56 PM
There is no need to repeat make dep, when all you are doing is changing an option and recompiling. As I said, make clean does not remove the .depend file, where the generated dependency info is stored and nor does it remove your .config or any architecture specific symbolic links. It just removes the old object files and prepares the tree for a recompile.
02-24-2004, 06:57 PM
Thanks G, starting the recompile now.
Quick edit - after bzImage I am assuming there is no need to redo modules since this is being built straight in the kernel. Is that a correct assumption?
02-24-2004, 07:04 PM
Yes, I would also redo the modules... that falls under "follow the usual steps after that"
You probably don't absolutely have to, but do it anyway. Don't forget about your System.map file too. It's best if all this shit comes from the same build.
02-24-2004, 07:08 PM
Roger that! It would be best anyway because when I build an absolutely new one, I would probably forget a step. Next up is to tackle 2.6. This one is 2.4.25
02-24-2004, 07:17 PM
By the way, just so you know, and again this isn't something I'd do, but a lot of the time you don't even have to do make clean. You can just change an option and then repeat make bzImage. It should re-use as many of the .o files that it can, from the previous compile and re-link them and re-assemble your bzImage.
The kernel build system in the 2.6 kernels is purported to be much better at this also. I still don't do it though, for all the time it really takes to recompile. It's another "but do it anyway"
02-24-2004, 07:19 PM
Time to reboot.
When I make a build, I save the config file in my home directory. When I do another, I use that file when I go into xconfig. I really don't use menuconfig unless I have no xserver - which has happened! It seems to go faster, which is why I screw it up so much! HEHEHE!
02-24-2004, 07:26 PM
As long as you know how to use menuconfig... because you can't always rely on xconfig not being broken in a particular release. Also, it may not be convenient to have it's dependencies installed at the time.
02-24-2004, 07:45 PM
Well - I'm back, and the floppy is now working. Took longer than it should have and you will probably guess why. I forgot something!
I simply didn't run lilo - I am a fucking idiot at times. However, I did make a boot disk on the very first kernel build so fixing it wasn't too bad. Just irritates the hell out of me. I get in a hurry and it shows. Enough rantin'!
02-24-2004, 07:48 PM
That's why you're supposed to keep more than one working kernel installed :roflmao:
02-24-2004, 07:53 PM
I have three installed, and two still work
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.