Category Archives: Kernel

linux 3.2.2 and iptables

MODULE ip_tables not found

as the last posts show I’m compiling and configuring my own kernel. As I want iptables to work, I opened my .config and enabled all flags under “IP: Netfilter Configuration” by changing the comment from “#… is not set” to “…=y”. Then I answered all questions as needed during the next compilation leaving the most question on the default value.

make xconfig

* Unable to find the QT4 tool qmake. Trying to use QT3
* Unable to find any QT installation. Please make sure that
* the QT4 or QT3 development package is correctly installed and
* either qmake can be found or install pkg-config or set
* the QTDIR environment variable to the correct location.

for using make xconfig to configure your kernel, you need to install the following packages:


make gconfig

* Unable to find the GTK+ installation. Please make sure that
* the GTK+ 2.0 development package is correctly installed...
* You need gtk+-2.0, glib-2.0 and libglade-2.0.

for configuring your kernel with make gconfig, you need to install the following packages:


make menuconfig

 *** Unable to find the ncurses libraries or the
 *** required header files.
 *** 'make menuconfig' requires the ncurses libraries.
 *** Install ncurses (ncurses-devel) and try again.

if you want to make changes to your kernel configuration under ubuntu 11.10 you have to install libncurses5-dev to be able to run make menuconfig.

Realtek 8168 with kernel 3.2.*

Since kernel version 3.2 my network driver doesn’t compile anymore. I downloaded the latest version from Realtek and made the following change in r8168_n.c:

addr = ((void *) page_address(frag->page)) + frag->page_offset;


addr = ((void *) page_address(&frag->page)) + frag->page_offset;

After this change the driver compiled and worked again.


Custom Kernel

To compile your own kernel you can follow these steps

sudo su
cd /usr/src
tar -xf linux-3.2.1.tar.bz2
cd linux-3.2.1

# if you dont have already installed these
apt-get install build-essential kernel-package

# use local config to get a kernel based on actual configuration
make localmodconfig

# always use available cores + 1 for concurrency level
 --revision 1 --append_to_version -custom --bzImage --arch-in-name 
 --initrd kernel-image

dpkg -i ../linux-image-3.2.1-custom_1_amd64.deb

modprobe self compiled modules

I have the problem, that ubuntu uses the wrong driver for my ethernet card, so I have to use a self compiled driver. After compiling the driver I got a file r8168.ko that is automatically copied to /lib/modules/`uname -r`/kernel/drivers/net/. So far so good. The problem is, that the module is not found by modprobe. Therefore insert the appropriate path (kernel/drivers/net/r8168.ko) into /lib/modules/`uname -r`/modules.dep and /lib/modules/`uname -r`/modules.order. Make sure not to forget the colon in modules.dep. Then run depmod -a to make modprobe r8168 work.