Kernel on SliTaz

As mentioned in my previous post I was having trouble with Kernel shipped by default with SliTaz 3.0 so here is a procedure to compile a recent kernel which seemed to work better for me.

First we need to get the build dependencies
tux@slitaz:~/kernel/linux-$ su -
root@slitaz:~# tazpkg get-install slitaz-toolchain
root@slitaz:~# tazpkg get-install ncurses-dev
root@slitaz:~# tazpkg get-install perl
root@slitaz:~# exit

Now get the kernel source

tux@slitaz:~$ pwd
tux@slitaz:~$ mkdir kernel
tux@slitaz:~$ cd kernel
tux@slitaz:~/kernel$ wget
Connecting to (
linux- 100% |*******************************| 64667k 00:00:00 ETA

Extract the kernel source from the tar file

tux@slitaz:~/kernel$ tar xjf linux-
tar: warning: skipping header 'g'

And then prepare our build

tux@slitaz:~/kernel$ cd linux-
tux@slitaz:~/kernel/linux-$ make clean
tux@slitaz:~/kernel/linux-$ make mrproper

We’ll take the current config from the running kernel (this is ok for 2.6 to 2.6 kernels but if your kernel is say 2.4.x it’s probably not going to like it.

tux@slitaz:~/kernel/linux-$ zcat /proc/config.gz > .config

Answer any questions that are part of the new kernel config (just entering the default should get you by.

tux@slitaz:~/kernel/linux-$ make oldconfig

Now let’s get the config menu running. I personally prefer the curses version, I guess I’m just used to it now. If you want to run xconfig then you’ll need to install the widget library dependency (is it QT?)

tux@slitaz:~/kernel/linux-$ make menuconfig

In this case I want to enable the hostap kernel module for the Prism wireless card
You can search for items by typing / (slash)
For the hostap

Device Drivers -> Network Device Support -> Wireless LAN

for IEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP
[*] Support downloading firmware images with Host AP driver
[*] Support for non-volatile firmware download
Host AP driver for Prism2/2.5/3 in PLX9052 PCI adaptors
Host AP driver for Prism2/2.5 PCI adaptors
Host AP driver for Prism2/2.5/3 PC Cards

Save and exit (hit Esc a few times).

Now time to build the kernel and it’s modules

tux@slitaz:~/kernel/linux-$ make bzImage
... time passes
Kernel: arch/x86/boot/bzImage is ready (#1)
tux@slitaz:~/kernel/linux-$ make modules
... time passes
IHEX firmware/tigon/tg3_tso.bin
IHEX firmware/tigon/tg3_tso5.bin
IHEX firmware/3com/typhoon.bin

One the kernel and kernel modules (drivers) are built we need to do the install as root.

tux@slitaz:~/kernel/linux-$ su -
root@slitaz:~# pwd
root@slitaz:~# cd /home/tux/kernel/linux-

First the install the modules into /lib/modules/(kernel name)

root@slitaz:/home/tux/kernel/linux- make modules_install

Copy the kernel binary (bzImage) to /boot and name it something relevant

root@slitaz:/home/tux/kernel/linux- cp arch/i386/boot/bzImage /boot/bzImage-

To make kernel oops’ and panics easier to debug (tis really a nice to have) Setup the (again with a meaningful name) and SymLink it to /boot/

root@slitaz:/home/tux/kernel/linux- cp /boot/
root@slitaz:/home/tux/kernel/linux- ln -s /boot/ /boot/
root@slitaz:/home/tux/kernel/linux- ls -l /boot
-rw-r--r-- 1 root root 2342048 Mar 31 18:35 bzImage-
drwxr-xr-x 2 root root 4096 Mar 30 21:02 grub
drwxr-xr-x 2 root root 4096 Mar 30 21:01 isolinux
lrwxrwxrwx 1 root root 25 Mar 31 18:38 -> /boot/
-rw-r--r-- 1 root root 1222172 Mar 31 18:36
-rw-r--r-- 1 root root 2218576 Mar 30 21:01 vmlinuz-

Last of all we need to modify Grub’s menu.lst to know how to find and load the new kernel.

root@slitaz:/home/tux/kernel/linux- vi /boot/grub/menu.lst

Add the following to the end of grubs menu.lst

# For booting SliTaz from : /dev/hda1
title SliTaz GNU/Linux (cooking) (Kernel bzImage-
root (hd0,0)
kernel /boot/bzImage- root=/dev/hda1

Time for a reboot and you should be able to select the new kernel from Grub


5 Responses

  1. Why is so many soundcard relaited problems
    with linux ! Autodetection fails to detect and
    configure isapnp Vibra16s. Kernel module
    present snd-sb16 but not working ! Do i must to
    compile the whole system or what ? Alsa also
    installed supported but mixer not loading ! Its
    simply sucks ! Well known hardware present
    supported but not working at all ! Its like the
    linux in general is problem generator and not
    problem solver ! And fast problem solving with
    linux is somekind modern mythos ! (infinite time
    waisting and consuming) !

    • I understand your frustration, I’ve had it with various O/S’s when stuff is not working. These days I tend to find most hardware works out of the box with Linux and generally there is no need to search for drivers like some other systems. I also seem to remember the Vibra 16 SB cards tend to have a range of chipsets in them. Finding a good active support community and stating clearly your problem will probably be more likely to get the result you desire rather than a rant on my little obscure blog. If you machine has enough grunt perhaps trying a few of the Live-CD distros like Ubuntu . If the sound card does not work then a clearly stated request on the Ubuntu forums might shed some light. I also find the Debian forums to be knowledgeable too

  2. hey, your little ‘obscure’ blog saved me many hours reading (ahh — who am i lying too – trial and error hehe) having to get acquainted with slitaz’s peculiars for compiling the kern. I didnt know about the toolchain packages, and also didnt know the value of or using the oldconfig option. Been compiling and using linux (slack, embedded and bt) and bsd for 10 years on and off and do solaris admin for a living. Your information is solid and concise, a rarity on the internet. thanks

  3. […] Recompile the kernel as it is described here. […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: