On Wed, Jan 16, 2013 at 7:17 AM, Shraddha Kamat wrote:
> I normally do the kernel configuration on my machine like this -
>
> * copy the distro configuration file to the kernel dir
> * make menuconfig (answer Y's/N's/M's) Normally keep return key pressed
> for default answers
> * then do the actual kernel compilation
>
>
> Now, I know that this is not a clean way to do the kernel compilation
> (although it has worked for me for thousands of times that I have
> compiled and successfully booted up with the kernel - without any issues
> - whatsoever !)
>
> But this time , I am bent upon coming up with a configuration
> specifically targeted to my machine. What is the best way to do this ?
Hi Shraddha,
your story is almost identical to mine. Although, I successfully
moved to the next chapter and I can surely share what I learned and
how I worked. I do not believe this is the best way, after all I'm
still just a noob. ;)
Oh and... I hope the contents of my email can be a sufficient excuse
for its length! I'm giving my experience, my method and the reasons
behind my choices and moves. I just hope reading this wont cause a
buffer overflow somewhere in your frontal cortex! ;)
I started very very long ago with Redhat (before year 2000), then I
moved to slackware and stayed there for a longer while. All this time
I was using the defaults provided by the distros. Then, perhaps
around 2008, I tried Slax and became very avid for fine tuning and
customizing everything. During my research I found the Gentoo
distribution, switched over, loved it and migrated all my computers
over to it. In the process I copied the ".config" file from my
previous stable install (I think it came from slackware) to all my
machines (at the time, they were all intel, single core). Soon after,
I added a quad-core, then an old AMD athlon, and later (and last) I
bought a AMD 64bit dual-core laptop. I used my 32bit distribution and
the same old 32bit kernel on that 64bit machine, until I decided this
whole situation was no longer tenable. I needed 64bit, I needed
better that 386, I needed SMP, I wanted to get rid of all those device
drivers I will never ever use... and more...
If I read your post right, this is where you stand now. So here's what I did:
The first thing was to start doing the same old way, but now using
git to get kernel updates. Once I got used to it, the next step was
to setup a new branch in my git repository on each machine and
configured it to update that branch from one of my computer that I
dedicated as the "authoritative" repository. Then I noticed it
doesn't quite work to take the 32bit config I had and simply switch it
to a 64bit architecture using menuconfig (really, don't even try,
there's lots of options to change, none of which are evident to the
newbie). So, on each machine I did a "make i386_defconfig" on the
32bit systems and "make x86_64_defconfig" on the 64bit one. I made a
commit of those .config files on each machine as the starting point of
my new configuration and I started compiling. Then I rebooted and
gave it a try.
Of course it didn't work and couldn't even boot up to init! So on
each machine I checked what the immediate problem was and applied the
most minimal correction to my .config (using menuconfig) and making a
new commit after the change. Some of the changes could be shared
among some of my machines so I pulled (aka merged) those commits onto
the other systems' config. Each commit or small group of commits
would represent one feature I needed to add on a machine. The commit
messages were like "Adding support for USB 1 and 2", then the next
would be "Fixing support for USB block devices (usbkeys)", etc...
This process was long and difficult but I got excellent help on
irc.freenode.net (in ##linux and #gentoo, thanks guys!). The reason
it was difficult was my lack of knowledge of the complex
interdependencies of various things I needed. But fortunately, the
needs that I had were very precise, the errors I got were very clear,
therefore my questions were very well stated, and the answers came
easilly and clearly (oh and pretty quickly too, except on Friday and
Saturday nights, hehe). Within about week, it was done. Everything
was supported on each machine (and nothing more), everything was very
stable (the video card was the only thing that kept giving me
trouble).
This led to a totally different configuration on each machine, with
a single way of handling them all in the exact same way (with git).
The kernel bzImage shrunk to around 50% what it was before (I dropped
support for so many unused network cards and other stuff)! I also
decided to make all these "features" built into the kernel (as opposed
to modules). And left the very minimum as module (actually only 1 or
2 modules I seldom used and were not needed at boot time). The result
was a kernel that no longer required an initrd to boot, which made the
whole process even simpler.
Keeping it up-