User Tools

Site Tools


Linux kernel

Compiling kernel

Clone the git-repository

$ git clone git:// linux-2.6


$ git pull

Use existing kernel-configuration:

  • Either use /boot/config-* and copy it to .config. Make sure to run make oldconfig afterwards.
  • Or use make localmodconfig in order to configure only currently loaded modules
  • Or create a default-config with make defconfig


$ make oldconfig   # when compiling a newer kernel
$ make menuconfig


$ make -j4  # make uses 4 parallel compile proccess

Install the kernel and the kernel-modules (need to be root; make sure that /boot is mounted if one exists)

# make install && make modules_install

Update/create the initramfs (if used) [Debian/Ubuntu]

# update-initramfs -c -k 2.6.xx-rc1    # when initially creating
# update-initramfs -u -k 2.6.xx-rc1    # when initramfs for that kernel-version already exists

Update boot-loader (e.g. grub2) and verify configuration [Debian/Ubuntu]

# update-grub

Reboot and have fun.

You might need to rerun several scripts in order to recompile external kernel-modules (e.g. VirtualBox) Example:

# /etc/init.d/vboxdrv setup

See also DKMS and scripts in /etc/kernel/postinst.d/

linux_kernel.txt · Last modified: 2012-04-20 19:17 CEST by dominik