红联首页 凝聚Linux人的力量
菜鸟过关 | 精华文档 | 同城人(交友) | 我与Linux的故事 | Linux新闻 | Linux视频 | Linux人才 | 软件下载 | 大学校园 | English
发新话题
打印

Debian Lenny 0%-100%之Kernel

Debian Lenny 0%-100%之Kernel

Debian Lenny Compile kernel from source

Install Kernel
  安装好正常编译需要的东西以后安装这个
  # apt-get install build-essential
  # apt-get install libncurses5-de
  reference:
  http://www.cyberciti.biz/tips/compiling-linux-kernel-26.html
  (网上有的文章说什么debian标准安装内核的方式,我不喜欢,因为我常切换各个发行版编译安装内核,所以我喜欢下面这种我常用的方式)
  
1: Get Latest Linux kernel code
  # cd /tmp
  # wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2
  
  ###Note: Replace x.y.z with actual version number.
  
2: Extract tar (.tar.bz2) file
  # tar -xjvf linux-2.6.25.tar.bz2 -C /usr/src
  # cd /usr/src
  
3: Configure kernel
  # make menuconfig
  
4: Compile and Install kernel
  # make
  # make modules_install
  # make install
  
5: Create an initrd image
  查看自己的那个版本的信息,我这里编译的是兼容内核,显示如下:
  # ls /lib/modules/
  2.6.18-6-686  2.6.23-uk0.2.1  2.6.24-1-686
  
  # cd /boot
  # mkinitrd -o initrd.img-2.6.23-uk0.2.1 2.6.23-uk0.2.1
  
6: Modify Grub configuration file - /boot/grub/menu.lst
  Open file using vi:
  # vi /boot/grub/menu.lst

title           Debian GNU/Linux, kernel 2.6.23 uk0.2.1
root            (hd0,3)
kernel          /vmlinuz-2.6.23-uk0.2.1 root=/dev/sda3 ro  
initrd          /initrd.img-2.6.23-uk0.2.1
savedefault
boot

  # update-grub
  
  reboot your system,ok!

出自:http://hi.csdn.net/hongmy525

TOP

发新话题