Vince4Amy
January 5th, 2009, 12:24 PM
Due To The Closure Of Other OS Talk, This Guide Is No Longer Maintained. For An Up To Date Version Click Here (http://grubbn.org/otheros/showthread.php?tid=51)
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:
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:
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:
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:
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:
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:
make oldconfig
Now you can begin compiling your own Kernel:
make menuconfig - Select options using the command line.
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:
make
Then to install the modules:
make modules_install
Set up booting:
cp arch/i386/boot/bzImage /boot/vmlinuz-custom (Adding -custom so that it is easy to configure lilo.
Configure lilo:
nano /etc/lilo.conf
Add the following to the end of your lilo.conf file:
# 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:
lilo
Hopefully this will work for a basic kernel compilation. Please feel free to contribute any changes or error fixes you may find.
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:
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:
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:
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:
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:
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:
make oldconfig
Now you can begin compiling your own Kernel:
make menuconfig - Select options using the command line.
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:
make
Then to install the modules:
make modules_install
Set up booting:
cp arch/i386/boot/bzImage /boot/vmlinuz-custom (Adding -custom so that it is easy to configure lilo.
Configure lilo:
nano /etc/lilo.conf
Add the following to the end of your lilo.conf file:
# 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:
lilo
Hopefully this will work for a basic kernel compilation. Please feel free to contribute any changes or error fixes you may find.