User Tools

Site Tools


linux_kernel

Linux kernel

Compiling kernel

Clone the git-repository

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6

Updating

$ 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

Configure

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

Build

$ 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