2011年4月8日 星期五

Linux Kernel Compile


. Update to the latest package information
  #apt-get update
  #apt-get upgrade

. Install the related packages for kernel compile
  #apt-get install debhelper module-init-tools kernel-package 
   libncurses5-dev libncurses5 build-essential bin86 fakeroot
. Download the Kernel-Sources from the below site and put 
  them under the path /usr/src :
  http://security.ubuntu.com/ubuntu/pool/main/l/linux/
  (1) linux_2.6.35.orig.tar.gz
  (2) linux_2.6.35-22.33.diff.gz (Patch for kernel 2.6.35)

. Unzip the kernel file :
  # cd /usr/src; tar zxvf linux_2.6.35.orig.tar.gz
  # cd linux-2.6.35/

. Patch the latest patch file
  # zcat ../linux_2.6.35-22.33.diff.gz | patch -p1
. # cp -vi /boot/config-`uname -r` .config
. # make menuconfig












. Under kernel compile interface :
  Press<Y>includes<N>excludes<M>modularizes features
  Press<ESC><ESC>to exitLegend : [*]built-in [ ]excluded
  <M>module <> module capable
. Clean up the kernel
  # make-kpkg clean
. Start to compile the kernelthe more items selectedthe more
  time will be takenalso depends on the system speed
  # fakeroot make-kpkg --initrd --revision=xxxxx kernel_image
     kernel_headers
After compile is donethere are two files produced in /usr/src :
  linux-headers-2.6.35.4_xxxxx_i386.deb
  linux-image-2.6.35.4_xxxxx_i386.deb

. Install the just compiled kernel files :
# cd /usr/src
# dpkg -i linux-headers-2.6.35.4_xxxxx_i386.deb
# dpkg -i linux-image-2.6.35.4_xxxxx_i386.deb 

. Install the initial RAM Disk
  # mkinitramfs -v -o /boot/initrd-2.6.35.4 2.6.35.4

. Check the kernel file and initial Ram Disk file have been located
  in path /boot.
  # ls -al /boot/vmlinuz-2.6.35.4
  # ls -al /boot/initrd-2.6.35.4

. If you use this Ubuntu's grub as bootloader,the menu.lst should be
  updated automatically,change path to /boot/grub,check the
  content of menu.lst,if no problem,then can use the new kernel to
  boot
  # cd /boot/grub
  # vim ./menu.lst

. Before executing the below command :
  # apt-get purge linux-headers-2.6.32-25
  # apt-get purge linux-headers-2.6.32-25-generic
  # apt-get autoremove











. After executing the below command :
  # apt-get purge linux-headers-2.6.32-25
  # apt-get purge linux-headers-2.6.32-25-generic
  # apt-get autoremove












. Before executing the below command :
  # apt-get purge linux-image-2.6.32-25-generic
  # apt-get autoremove










. After executing the below command :
  # apt-get purge linux-image-2.6.32-25-generic
  # apt-get autoremove










. Before executing the below command :
  # apt-get purge linux-image-2.6.32-25-generic
  # apt-get autoremove











. After executing the below command :
  # apt-get purge linux-image-2.6.32-25-generic
  # apt-get autoremove











The related PowerPoint file will be downloaded from the below
address : 
Linux Kernel Compile  

沒有留言:

張貼留言