Updating your Kernel in Slackware 9.1

ck3k-ck3k@ck3k.org 2/21/04

Version 2.6.3

**This guide was written using Slackware 9.1 and using the newest 2.6.3 kernel**

First acquire the kernel at http://www.kernel.org/, current stable as of writing this is 2.6.3
(I use the full kernel, not the updates)

You want to select the "Full image" by using the "F" option to the right of the screen.

Save the kernel image to your /usr/src directory

Open your terminal

Make sure to log into root and enter the /usr/src directory

"tar -xvjf linux-2.6.3.tar.bz2"

for the 2.6.3 kernel this file will be entitled "linux-2.6.3.tar.bz2"

You should now have the file /usr/src/linux-2.6.3

ls -l to see which files are currently symbolically linked to the current kernel
use :

"ls -l"

there may be a link to your old kernel which looks like "linux-->/usr/src/linux-2.*.*" this is old and you want to remove this with "rm linux" which will clear that symoblic link.

Now link your new file the /usr/src/linux-2.6.3 to linux by using

"ln -s /usr/src/linux-2.6.3 linux"

This will link it to the directory.

You could at this point remove the old kernel directory, but you may want to keep it for backup purposes, just in case the newest kernel doesn't work

Now, on to the compile of the new kernel

You should still be in root, log in if your not. cd back in your /usr/src/linux directory, which should be symbolically linked to your /usr/src/linux-2.6.3

Now

"make mrproper" (optional in the 2.6 kernel, if compile fails run this and try again.)

which will clear out the kernel of any previous compiles and config files. After it is done run:

"make menuconfig"

or

"make xconfig"

Whatever works for your system, at this point I would suggest having another root term open and run "lspci" which will list your PCI devices which you need to know so you don't forget to compile these device's drivers into the kernel.

I am going to use "make menuconfig" for my build. You will be greeted with a screen that says "Linux Kernel v2.6.3 Configuration" at the top. You will be presented with a list of all the possible kernel configurations offered, I suggest you know your system before getting to this step, because if you miss something you may have to recompile.
The Kernel config is done thru a main menu, and then a system of sub menus, just keep track of where you are in the menu system at all times.

"Kernel Compile options", you will be given a list of options to compile, just remember the following:

[*] = compile directly into kernel
[ ] = excluded from your kernel (unwanted features)
<M> = compile as a kernel module
< > = module capable (you could compile it as a module into your kernel if needed)

The first option you want to pay attention to is the "Loadable Module Support" which you want to have set to "Automatic kernel module loading" as to allow you to load any possible kernel modules you have or will install in the future, set the option to be in the kernel by using the space bar to select the "[*]" option which will compile the feature directly into the kernel.

You now want to head down one space to "Processor type and features" once again, you need to know what kind of processor your system is using before doing this compile, you will see several options, you should be able to figured out what you need, but I am guessing you will want the common "Generic x86 support." Exit this menu to the main menu.

Moving down the list, you will see "Power Management support" this is important if you are on a laptop, a desktop system doesnt really need to much Power Management, but laptop users, may wish to use these features so scroll thru the menus here, and make sure you have what you need. Exit this menu to the main menu.

"Bus Options" is your next stop on making this work, you will see here a list of possible Bus systems "PCI, PCMCIA, ISA, etc." you should know what you want, for desktops typically you only need PCI for your sound and other multiuse cards, but take a look at the rest of the options, a lot of older systems still use the ISA style bus. WARNING to laptop users, do no skip over the PCMCIA enabling at the bottom of this section, it would be very very bad not to <*> include it with your kernel. Exit this menu to the main menu.

Next, on the list of important options is the "Device Driver" area, and as I am sure you have guessed, this houses all the drivers that you can compile or load as modules into the kernel. I cannot tell you what options you want, this is on a computer to computer basis, you need to know your system, remember to read this list completely as "sound" and "USB support" is near the bottom of the page. Some cd-burners use scsi emulation, and this is disabled by defualt. If you are running a newer style motherboard you may also want to activate the "I20" driver. Exit this menu to the main menu.

Scroll down to find "File Systems" as the next item on the list. This is where knowing your hard drive comes into play, you can select support for most of the popular linux file systems like "Ext2, Ext3" as well as supporting "Fat and NTFS." Support what you need, and exit this submenu.

Now, scroll to the bottom of this screen, unless you wish to play with the different "kernel security" features, and go to the option <exit> on exit, you will be asked if you wish to save your new configuration, select yes, and it will be placed in your "/usr/src/linux", this is important for later.


After your finished with the config of the kernel, double check to make sure all devices are in the config, you don't want to have to do this again.

Make sure to exit out of the kernel "config" program, and make sure to save the configuration file.

Now run:

"make all && make modules_install"

This will compile the kernel, as well as create the bzImage, as well as the modules, as well as install them.

Now to replace your kernel

Then, you want to move your files into a backup directory, just in case the kernel doesn't work properly.

Now, copy your new system.map and .config files from your "/usr/src/linux" use "ls -a" to locate them, to the /boot directory. Then rename them to "sytem.map-(something)" and "config-(something)", you can drop the "." in front of config and you can just symbolic link them to the real files, so you can tell what version of your config and system.map you are using I personally suggest system.map-2.6.3 and config-2.6.3

"cp /usr/src/linux/.config /boot/config-2.6.3"
"cp /usr/src/linux/System.map /boot/System.map-2.6.3"

Now, link your config-2.6.3 to your config also link your system.map-2.6.3 to your system.map

"cd /boot" make sure your in the /boot directory

"ln -s config-2.6.3 config"
"ln -s system.map-2.6.3 System.map"

Then, you want to move your new kernel to the current directory using a different name,
so that your old one is still there, in case of a failure of panic.

"cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage-2.6.3"

Now open up your text editor and open /etc/lilo.conf switch around the values to your new bzImage and label it.

You will see something similar to the following, You want to add to your existing config, so that you can switch kernels at the touch of a screen. Add something similar to the config below.

# Linux bootable partition config begins
image = /boot/bzImage-2.6.3
root = /dev/hda2
label = Linux263
read-only
optional
# Linux bootable partition config ends

Please take note you should ADD to your exsiting lilo.conf, do not delete your old entrys, just perhaps relabel it to "Linux-old" as to tell the differance between kernel versions on boot.

If you have a windows partition on the same system, it is quite easy to set lilo.conf to dual boot with this partition. add the following lines under your last entry, before the "#Linux bootable partition config ends."

**your other lilo info should be here**

other = /dev/hda2
lablel = WinXP

#Linux bootable partition config ends

make sure that your harddrive is set in place of "/dev/hda2" this is only my system that this appears on, yours may and I am guessing will vary.

Save the file, and not that the "label" can be anything (remember that you can't have spaces, and there is a lenght limit), just as long as you remember it.
now, run /sbin/lilo -v to update your lilo to boot your new kernel.

"/sbin/lilo -v"

You should see it add the options you entered, if errors appear here, never fear it is most likly a typo in the /etc/lilo.conf file. Your kernel will not be able to boot if you do not complete this step.

Finally, run the shut down

"/sbin/shutdown -r now"

or a simple "Alt+Ctl+Del" should reboot the system.

Finally you should reboot the computer, and your common configuration process will begin.

**There have been reports of issues with modules on this kernel level, download and install "module-init-tools" after a compile, this should solve any issues you may have been having.

the tarball can be found on

http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/

or

http://slackware.oregonstate.edu/slackware-current/source/a/module-init-tools/

Sources:
http://www.kernel.org/
http://www.securitytribe.com/whitepapers/blackwavesGuidetoASaneKismet.html

Thanks to :

Octalpuss, for testing this, and pointing out alot of the stupid things I missed.