PDA

View Full Version : kernel compilation



mnguyen
28th December 2004, 02:34 AM
Hi all

I am using FC2, kernel 2.6.9. I want to recompile the kernel to support NTFS. So i get the kernel source and follow the instruction in the README file along with the source.

I reuse the configuration file of the pre-built kernel in the /boot directory. I just change the file at one or two line to support the NTFS filessystem. Everything goes fine. I can get the new kernel. However, there is a little problem.

When I do "make modules_install", the new modules are installed to /lib/modules directory. I check the size of the newly installed modules and find that it's much much bigger than the pre-built one.
For the newly installed modules :


[root@localhost titan]# du /lib/modules/2.6.9 -sh
377M /lib/modules/2.6.9


While the pre-built one of FC2 is

[root@localhost titan]# du /lib/modules/2.6.9-1.6_FC2/ -sh
67M /lib/modules/2.6.9-1.6_FC2/


From 67MB to 377MB is a big different and I don't think that only the module which supports ntfs takes so much space. Moreover, i reused the FC2's configuration.

Has anyone faced this problem before ? Can give me some advices or clue ?

Tks you guys a lot :)

owakroeger
28th December 2004, 03:40 AM
I agree. The module/modules to support NTFS should not make your kernel be 310M larger. There must be some other modules being loaded in the fresh kernel which are not loaded in the first. It may be tedious, but I'd suggest printing the original config file, and doing a line-by-line comparison.
Someone else might suggest something less tedious, but that would be my suggestion.

There is a really good howto for compiling kernels at http://www.webhostgear.com/138.html


owa :o :o :o

mnguyen
28th December 2004, 10:32 AM
Your link is dead :( . I cannot access.

I do compare the two configuration files. They are a little bit different. It seemed that when I did "make" to compile the code, some more choice has been added in. There are prompts to ask me to select the features and I chose NO to all those offers. However, there are some options that are automatically chosen without asking my acceptance. I think those unwanted options make the modules bigger (just the modules directory, the kernel image size is more or less the same).

In my guess, i think that Fedora distributor deleted some unnecessary modules before packing up the kernel rpms and releasing them ( just my guess). Has anyone experience this before ?

Thanks for any good will reply (whether it works or not) :rolleyes:

owakroeger
28th December 2004, 01:58 PM
mnguyen, I appologize. I misstyped the link address. With my fat fingers and this tiny keyboard on this company laptop, I hit the ' t ' instead of the ' r ' The link works, now. I just tried it. Here it is again.
http://www.webhostgear.com/138.html
This method works better for me than the 'rpm-build' method. In addition, if there is something you don't like about the kernel you just compiled, you can get back into it and make more modifications without having to build another rpm.
This probably goes without saying, but I'll say it again. ALWAYS have a backup of your critical files before you start tinkering with the kernel.
I do all the building of the kernel as 'user.' This will prevent mistakes from getting out of control, as they might if you do these steps as 'su.' I also like to name the kernel I'm working on something unique to identify who built it and the date. i.e. 2.6.9W4Lak112804 (2.6.9 kernel) modified for Win4Lin (by me, ak) and the date.
The instructions don't mention it, but when you finish the 'make modules' step, you will have to 'su'
Then 'make modules_install' as root. And, finish the rest as root.
If it takes you a few tries to get the kernel just the way you like it, you'll have your unsatisfactory attempts easily identified in your /boot directory by your unique name, so that you can do some housecleaning safely, when you're all done. I don't like to have a lot of useless clutter lying around
I hope it works for you

owa