Debian-kernel

From Bashlinux
Revision as of 03:47, 17 October 2010 by Manpaz (talk)
Jump to: navigation, search

Real-Time Vanilla Kernel

Get sources and setup environment

  1. Create `vanilla` folder in `/usr/src` and change directory to such location
 mkdir -p /usr/src/vanilla
 cd !$
 
  1. Download the latest rt patch
http://www.kernel.org/pub/linux/kernel/projects/rt/
  1. Download the matched kernel for the proper patch downloaded in previous step
http://www.kernel.org/pub/linux/kernel/v2.6/
  1. Decompress both, the linux kernel sources and the patch
 tar jxvf *.bz2
 
  1. Patch the kernel
 cd linux-2.6.AA.BB
 patch -p1 <../patch-2.6.AA.BB-rtNN
 
  1. Create a link `linux` which points to the linux kernel sources
 ln -s /usr/src/vanilla/linux-2.6.AA.BB /usr/src/linux
 


Build Kernel

  1. Go to the linux source folder
  2. Configure the kernel, if necessary `make menuconfig`
    • Backup the old config file
   cd /usr/src/linux
   cp .config config.yy-mm-dd
   
  • When finish save your changes
  • Build the bzImage
 cd /usr/src/linux
 make
 
  • If only modules are needed, then use `make modules`
  • Install the modules
 make modules_install
 
  1. Install the kernel, usually locate on `arch/MY_ARCH/boot` in kernel sources
 cp arch/MY_ARCH/boot/bzImage /boot/vmlinuz-2.6.AA.BB-rtNN
 
  1. Create initial root filesystem
 cd /usr/src/linux
 update-inintramfs -c -k 2.6.AA-BB-rtNN
 
  1. Add the proper entry to grub in `/boot/grub/menu.lst`
 title		RT kernel 2.6.AA.BB-rtNN
 root		(hd0,0)
 kernel		/boot/vmlinuz-2.6.AA.BB-rtNN root=/dev/hda1 ro
 initrd		/boot/initrd.img-2.6.AA.BB-rtNN
 
  • TIP: if `default` parameter is set to `0` at the beginning of the `menu.lst` file, then try to put this entry at the top of the entries list.