Results 1 to 10 of 10

Thread: Howto: Kernel Compilation 2.6.27.x

  1. #1
    Join Date
    Aug 2007
    Beans
    582

    Howto: Kernel Compilation 2.6.27.x

    Due To The Closure Of Other OS Talk, This Guide Is No Longer Maintained. For An Up To Date Version Click Here

    I've made this guide to give a bit of information on compiling a custom kernel for Slackware. This is just something to get you started in compiling a kernel and removing options. Please make sure that before you remove things from the kernel you know what hardware is in your system and what things you can and cannot remove.

    All Stages will require that you are logged in as root.

    Which Kernel Version

    You can either install the kernel sources package when you install Slackware (On 12.2 it is 2.6.27.7) or you can download the latest version (At the time of writing 2.6.27.10)

    To download the latest version of the kernel please do the following:

    Code:
    cd /usr/src && wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.10.tar.bz2
    (When a new version is released you can change the .10 for .11 or whatever version at the time.

    Once the file has downloaded enter the following command:

    Code:
    bunzip linux-2.6.27.10.tar.bz2 && tar xvf linux-2.6.27.10.tar
    - This will extract the kernel. Make a link to this at usr/src/linux by using the following:

    Code:
    ln -s linux-2.6.27.10 /usr/src/linux
    If you installed the kernel source package and you are using the latest version from kernel.org you will have to remove the link to the old kernel source:

    Code:
    rm /usr/src/linux
    You are now ready to compile the kernel.

    -----------------------------------------------------------------

    You should already have a working Slackware system running with a kernel which has a variety of hardware support out of the box.

    The easiest way to compile your own kernel is to start by using what already worked with Slackware and building up and removing modules from there. To copy the current config file of the version of Slackware you are running you can run this command:

    Code:
    zcat /proc/config.gz > /usr/src/linux/.config
    If you're using a newer version of the kernel you must run oldconfig because of added/removed features:

    Code:
    make oldconfig
    Now you can begin compiling your own Kernel:

    Code:
    make menuconfig
    - Select options using the command line.

    Code:
    make xconfig
    - If you are using a working KDE you can use this to choose options with a GUI.

    You will want to change the name of your kernel so that you know that you are running the latest version. Go to General Setup>Change the release name

    You can then go through all the subcategories of menuconfig and disable/enable what you need. Once you have done this you can save the .config before you exit.

    -----------------------------------------------------------------

    To actually compile the kernel use:

    Code:
    make
    Then to install the modules:

    Code:
    make modules_install
    Set up booting:

    Code:
    cp arch/i386/boot/bzImage /boot/vmlinuz-custom
    (Adding -custom so that it is easy to configure lilo.

    Configure lilo:

    Code:
    nano /etc/lilo.conf
    Add the following to the end of your lilo.conf file:

    Code:
    # Linux bootable partition config begins
    image = vmlinuz-custom
    label = linux-custom
    root = /dev/(Whatever your primary hard drive is)
    read-only
    # Linux bootable partition config ends
    To update lilo run:

    Code:
    lilo
    Hopefully this will work for a basic kernel compilation. Please feel free to contribute any changes or error fixes you may find.
    Last edited by Vince4Amy; February 23rd, 2009 at 12:18 PM.

  2. #2
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Howto: Kernel Compilation 2.6.27.x

    For the sake of conciseness and simplicity, the first two steps can be done this way (I'm using sudo because old habits die hard, but feel free to do that while logged in as root instead, if you prefer):

    After changing to a directory of your choice :

    Code:
    wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.10.tar.bz2
    sudo tar xjf linux-2.6.27.10.tar.bz2 -C /usr/src
    Also, in case /usr/src/linux is already there, a new symlink to another version of the kernel can be created in one step :

    Code:
    sudo ln -snf linux-2.6.27.10 linux
    Another very important step, especially now that the version of the kernel has changed, is to run make oldconfig after copying over the config of your current kernel, so that any options that have been added/removed in the kernel will also be added/removed in your configuration.
    Last edited by Bachstelze; January 5th, 2009 at 07:34 PM.
    「明後日の夕方には帰ってるからね。」


  3. #3
    Join Date
    Aug 2007
    Beans
    582

    Re: Howto: Kernel Compilation 2.6.27.x

    Another very important step, especially now that the version of the kernel has changed, is to run make oldconfig after copying over the config of your current kernel, so that any options that have been added/removed in the kernel will also be added/removed in your configuration.
    Yes you're right, I forgot to include that one. I've added it. I'm using su in this guide and not sudo because I don't like sudo and it's not used by default on Slackware.

  4. #4
    Join Date
    Dec 2006
    Beans
    1,806

    Re: Howto: Kernel Compilation 2.6.27.x

    Quote Originally Posted by Vince4Amy View Post
    Set up booting:

    Code:
    cp arch/i386/bzImage /boot/vmlinuz-custom
    Should be:

    Code:
    cp arch/i386/boot/bzImage /boot/vmlinuz-custom

  5. #5
    Join Date
    Aug 2007
    Beans
    582

    Re: Howto: Kernel Compilation 2.6.27.x

    Yes you're right, I was typing this at school without access to Slackware at the time so I was working from memory.

  6. #6
    Join Date
    Aug 2007
    Beans
    582

    Re: Howto: Kernel Compilation 2.6.27.x

    Has anyone tried 2.6.28 on Slackware yet?

  7. #7
    Join Date
    Dec 2006
    Beans
    1,806

    Re: Howto: Kernel Compilation 2.6.27.x

    Quote Originally Posted by Vince4Amy View Post
    Has anyone tried 2.6.28 on Slackware yet?
    I did, right after 2.6.28 came out. A couple of days later, I switched back to Gentoo. I use the vanilla kernel sources on Gentoo as well, currently 2.6.28.2.

  8. #8
    Join Date
    Jul 2005
    Location
    2 exits past crazy
    Beans
    4,223
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: Howto: Kernel Compilation 2.6.27.x

    Quote Originally Posted by RedSquirrel View Post
    I did, right after 2.6.28 came out. A couple of days later, I switched back to Gentoo. I use the vanilla kernel sources on Gentoo as well, currently 2.6.28.2.
    Interesting. Any big differences from gentoo-sources?

  9. #9
    Join Date
    Dec 2006
    Beans
    1,806

    Re: Howto: Kernel Compilation 2.6.27.x

    Quote Originally Posted by yabbadabbadont View Post
    Interesting. Any big differences from gentoo-sources?
    Nothing that I've noticed, but then I haven't used gentoo-sources for a while (months, I guess), so it's difficult for me to compare them.

    Someday when I'm bored, I'll have to look through the patches the Gentoo devs apply to the kernel sources. I know they add a little functionality and address some bugs, but I don't know much about the specifics.

  10. #10
    Join Date
    Jul 2005
    Location
    2 exits past crazy
    Beans
    4,223
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: Howto: Kernel Compilation 2.6.27.x

    Quote Originally Posted by RedSquirrel View Post
    Nothing that I've noticed, but then I haven't used gentoo-sources for a while (months, I guess), so it's difficult for me to compare them.

    Someday when I'm bored, I'll have to look through the patches the Gentoo devs apply to the kernel sources. I know they add a little functionality and address some bugs, but I don't know much about the specifics.
    I should probably install the latest vanilla-sources and see if the shutdown issue with libata and sata_promise have been fixed. I would have to have them installed anyway if I were to try to file a bug upstream. Currently I just reboot and use the halt command in grub. It's a pain to go through all the hoops required to file a kernel bug that will be accepted.

Bookmarks

Posting Permissions

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