Howto compile kernel on Ubuntu Dapper B2

Recommended Posts


*updated for kernel 2.6.17*

Another ubuntu howto wahey :p

This one is a mission so I hope you have plenty of time on your hands



Firstly, you should download kernel 2.6.17 from the ftp

I suggest this version because various kernel patches can be applied directly to this

get the latest patch for the stable kernel from

put the kernel and patch in /usr/src and tar xvf filename.bz2 to extract them

cd into the kernel source directory and bzip2 -dc ../patch.bz2 | patch -p1 to patch the kernel source

the latest suspend2 can be downloaded from here:

extract to the /usr/src/linux-2.6.17 folder and ./apply to apply the patches

the latest reiser4 can be downloaded from here:

gunzip -dc ./reiser4-for-2.6.17-rc4-mm1-2.patch.gz | patch -p0

now to configure the kernel,

you can either

a) copy the /boot/config-2.6.15-23-k7 to /usr/src/linux-2.6.17/.config to use Ubuntus default configuration

b) you can get the packages from the apt repositories for xconfig and "make xconfig" an X kernel config program and change all the kernel options one by one which will take a few hours

or c) do b) but use my working desktop configuration and select your own sata/raid/network/sound card drivers etc from this

*My config is attached to the bottom*

now we have to compile our kernel, we can do this and make an installable/uninstallable .deb! by using

make-kpkg -initrd kernel_image

this appears in the /usr/src folder

dpkg -i kernel-image-2.6.17-etc to install this kernel

ok so we're all compiled and installed

you need to add this line to the kernel options in /boot/grub/menu.lst -> resume2=swap:/dev/sda3


kernel /vmlinuz-2.6.17 root=/dev/sda4 ro quiet splash vga=0x324 resume2=swap:/dev/sda3

edit as applicable (see fdisk /dev/sda or /dev/hda and type p to display partition info to find your swap partition or check your /etc/fstab)

please download and install the hibernate program to use suspend2

You can now reboot, but your system won't be bootable from a reiser4 partition yet, you won't have fglrx/madwifi/rt61 drivers for this kernel either as these have to be recompiled



For reiser4 you will need get the reiser4 packages from the apt universe repository (uncomment all the repositories in /etc/apt/sources.list)

you will also need to get and compile grub with reiser4 support and install it,

I suggest first backing up /boot/grub to /boot/grub.bak,

grab grub from here

tar xvf LATEST_GRUB to extract,

enter the grub-0.97 folder



make install

grub-install /dev/sda (or /dev/hda) this will replace files in your /boot/grub folder

make sure that menu.lst is still there or copy from the backup folder


make a reiser4 partition by

umount(ing) the partition

then use mkfs.reiser4 /dev/sda8 etc and mount :)

to make a root reiser4 you need a spare partition, I copied my systems files over by backing up the root partition then restoring to the reiser4

tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys --exclude=/dev --exclude=cdrom --exclude=/media/cdrom --exclude=/media/cdrom0 --exclude=/root/.Trash --exclude=/home/z3r0/.Trash --exclude=/var/cache/apt/archives /

to restore

tar xvpfz backup.tgz -C /reiser4

Do this otherwise you won't be able to boot

cd reiser4

mkdir /sys

mkdir /mnt

mkdir /proc

mkdir /lost+found

mkdir /dev

cd dev

mknod null c 1 3

mknod console c 5 1

cd /reiser4/fstab and change the mount point of the root partition

my /boot is on a seperate partition so it was just a matter of changing menu.lst to root=/dev/hda8 and all works fine, if you don't have /boot on a seperate partition it may be necessary for you to rexec the grub-install command once you boot into the reiser4 partition

I should also mention that it can get confusing when you install the kernel, it also installs libraries to your current boot partition, if you reboot into an ext3/reiserfs kernel with reiser4 support you can install the kernel to the reiser4 partition with dpkg -i --root=/dev/hda5 kernel-etc



We need to get the fglrx drivers from (8.25.18)

once downloaded type X_VERSION=x690 sh ./

select the second option - generate distribution specific driver packages

then, if you can see the options :) select ubuntu/dapper and go! it will place .debs in the current directory for your system

you then need to install the fglrx-kernel-sources

go to /usr/src and extract the fglrx.tar.bz2 using tar,

now we can go back to our kernel source folder and

make-kpkg modules_image

this will compile the kernel module and make a .deb,

install with dpkg -i fglrx-kernel-module.deb,

if you have rebooted already to the new kernel you can modprobe fglrx and then press ctrl + alt + backspace to close the xserver and restart it with acceleration enabled, or you can reboot,

you may need to use --force-all command to ignore the dependency error, or just install xorg package generated by the ati installer to satisfy the dependency (not necessary imho)



extract the package and make, make install, modprobe ath_pci, there is a problem with this driver, setting ad-hoc mode with iwconfig ath0 mode ad-hoc doesn't work but you can do this, rmmod ath_pci to unload and then modprobe ath_pci autocreate=adhoc

To set this up on each bootup you can read the readme :p or add the modprobe command to /etc/rc.local



extract the package, make, mkdir /etc/Wireless/RT61STA, copy *.bin /etc/Wireless/RT61STA, the same for*.dat <configuration file,edit if bored :p, insmod rt61.ko and it's loaded, you may need to add the insmod command with full path to rc.local, the only problem I found is that you have to specify the channel for the device to start working, weird but true, iwconfig ra0 channel 1 or 2 then 1 whilst pinging from the other machine to check it is working

gl hf



Something Something Something


Edited by Z3r0
Link to post
Share on other sites

I was looking for something like this. Thanks :)

Link to post
Share on other sites

Doesn't kernel 2.6.16.x officially need a much more recent version of udev than the one included with ubuntu dapper?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.