Find the answer to your Linux question:
Results 1 to 5 of 5
i'm thinking of moving from Zenwalk to Gentoo but have second to none compiling experience (./configure, make, make install is pretty much all i can do). so to get a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    26

    genkernel


    i'm thinking of moving from Zenwalk to Gentoo but have second to none compiling experience (./configure, make, make install is pretty much all i can do). so to get a little picture of how the installation is done i went to read the handbook. i heard that one of the things that make linux boot fast is compiling your own kernel, however, i read in the handbook that a custom kernel will only support the selected hardware, while generic kernel detects everything on startup.

    does this mean that if i buy a new piece of hardware, say a wacom board or a scanner or a graphics/sound card i will have to recompile the kernel to make it work, unless i use the generic one? if so, is it hard to do or is it time consuming?

    thanks in advance.

  2. #2
    Linux Newbie sdimhoff's Avatar
    Join Date
    Jan 2007
    Posts
    191
    Recompiling your kernel is one of those things that can be intimidating to a new linux user, but it really isn't that bad (I went through that apprehension myself). You will find that it takes very little time and as long as you are somewhat comfortable it is painless.
    It is true that you can speed up your boot process by customizing your kernel, however that depends on how your genkernel is compiling in the first place. If you build in support for a device into the kernel, then it will always load that support on boot. If you build it as a module, it only loads it at boot time if you tell it to.

    I would suggest getting yourself comfortable with how exactly a kernel is configured. Once you are comfortable with how to make changes, then all you really need to know is what hardware is in your computer.

    Do the following (just explore, try to find your hardware, and don't save the configuration until you think you know what you are doing.)
    Code:
    cd /usr/src/
    ls -l
    <This is the output from mine>
    lrwxrwxrwx  1 root root   22 Oct  2 09:46 linux -> linux-2.6.22-gentoo-r8
    drwxr-xr-x 20 root root 4096 Jan 11 20:47 linux-2.6.22-gentoo-r8
    drwxr-xr-x 19 root root 4096 Nov 13 22:39 linux-2.6.22-gentoo-r9
    You will notice that the "linux" directory is actually a symlink to the current kernel.

    Now cd to the /usr/src/linux directory. If you type "make menuconfig" then you will enter into the configuration screen.

    Items have brackets next to them. If there is a[*] then that option is built right into the kernel. if it is [M] then it is built as a module. (i.e. you could call it with modprobe <module.name>).

    The gentoo How-To docs do a really good job at explaining the commands to build it once you have saved a new configuration.

    make & make modules_install

    To be able to boot the newly configured kernel you then just copy the bzImage to your boot directory and change your grub configuration.

    If you have any more questions this is the place to post them.

  3. #3
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    also to add, when you compile the kernel, most of the hardware support is from kernel modules, they only get loaded if you have the hardware that the module is being used for so you could leave them in the kernel building process to be safe, all it does is add compile time

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Aug 2007
    Posts
    26
    so if i understand correctly, hardware can be either supported by modules or support is built right into the kernel?

    I tried what you said sdimhoff and it doesn't look too hard. However, i still don't quite understand pros/cons of building hardware support into the kernel or just adding modules?

  6. #5
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by BillieJean View Post
    so if i understand correctly, hardware can be either supported by modules or support is built right into the kernel?
    Yes.

    I tried what you said sdimhoff and it doesn't look too hard. However, i still don't quite understand pros/cons of building hardware support into the kernel or just adding modules?
    There are many subtle differences.

    If you build as module you can dynamically load or unload modules, or pass arguments to them, with just modprobe or rmmod. That way you save a bit of ram, though that is not usually an important thing because modules are usually really small.

    Besides that, there's not a big difference about using modules or building statically into the kernel.

    There are, however, some security concerns. Some rootkits come as kernel modules, so, if you disable the module support interface on your kernel, you can avoid all of these without further tightening your security.

    But I tend to not care about this too much, because to load a rootkit module, an intruder needs to use modprobe, which means s/he has to become root first. By the time s/he is root, there are more important things to fear than rootkits.

    I usually build everything into the kernel, so I don't have to care about modules not loading automatically. Though with udev, hald and all this stuff usually you would not care about that either.

Posting Permissions

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