Find the answer to your Linux question:
Results 1 to 4 of 4
When you download kernel sources it is around 60 mb. When you compile it with standard .config file it is around 5 gb. So i have feeling that it should ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! probe's Avatar
    Join Date
    Oct 2009
    Location
    Belgrade, Serbia
    Posts
    29

    optimal kernel compilation


    When you download kernel sources it is around 60 mb. When you compile it with standard .config file it is around 5 gb. So i have feeling that it should be around 500 mb, for standard pc computer. So what is the process of determining the optimal .config file for your machine ??

    I know I can find out my hardware with:

    /sbin/lspci
    cat /proc/cpuinfo

    But when you look into configuration (make menuconfig) it is far from understanding what you should include and what not ??

    So does anyone have a clue ??

    regards

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,206
    You could try this site. It's a good place for a newbie kernel builder to start.

    You also need to make full use of the online help that comes with menuconfig. Kernel help knocks all other help systems into a cocked hat! It not only tells you what each option means but often whether you need it or not.

    The reason stock kernels are so large is because they have to include driver modules for every possible type of hardware and filesystem.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  3. #3
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Quote Originally Posted by probe View Post
    So what is the process of determining the optimal .config file for your machine ??
    Iterative trial&error.
    You start with the bare minimum you know you have&need.
    Then you compile and start your first kernel.

    Most likely it will not boot very much. Why? Well of course you forget not that not only you need the driver for your MoBo and harddrive, but also the correct filesystem driver statically linked in. So back to make config and fix it.

    The good thing is that switching to your old standard kernel is as easy as selecting it during boot in GRUB. This you will do often the first days to ensure your custom kernel does not perform worse than the stock kernel. "Why is the system suddenly so slow when I compile something in the background? Oh, because I did not activate SMP, so it only uses one of four cores contrary to the stock kernel."

    After some iterations, the system becomes more and more usable and the above experiences become less common. But still you will experience this after even several weeks occasionally when you realize you had better not disabled the old LTP driver just to safe 3kb of space. Because now you cannot print.

    So whatever you do, keep the old stock kernel as a fallback option. Because it always hits you just when you are not in the mood to configure&compile a new one.
    Debian GNU/Linux -- You know you want it.

  4. #4
    Just Joined! probe's Avatar
    Join Date
    Oct 2009
    Location
    Belgrade, Serbia
    Posts
    29
    Thanks,

    it is obvious that try&test will help determining the needed things in .config
    Off course, I always have one generic and one custom stable kernel to boot
    if something goes wrong

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •