Chinaunix首页 | 论坛 | 博客
  • 博客访问: 382088
  • 博文数量: 89
  • 博客积分: 3176
  • 博客等级: 中校
  • 技术积分: 1205
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-15 10:08
文章分类

全部博文(89)

文章存档

2011年(17)

2010年(19)

2009年(35)

2008年(18)

分类: LINUX

2008-11-27 14:01:54

##########################################
#                            
#      debian5.0 下编译2.6.x 内核  
#
#    OS: debian5.0 lenny
#    kernel: linux-2.6.32.tar.bz2
#    linux-2.6.26-2-686 ==> linux-2.6.32
#                             
##########################################


########################
#                   
#      标准安装方法 
#                  
########################

aptitude install gcc
aptitude install make
aptitude install bzip2
aptitude install libncurses5-dev  # make menuconfig 需要

# 校准时间,否则报错
aptitude install ntpdate
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ntpdate 210.72.145.44

cd /usr/src/
wget ftp://61.135.158.199/pub/linux-2.6.32.tar.bz2
tar jxvf linux-2.6.32.tar.bz2
ln -s linux-2.6.32 linux
cd linux
make mrproper
cp /boot/config-2.6.26-2-686 .config
make menuconfig
make                            # 编译内核
make install                        # 安装 自动拷贝bzImage System.map到/boot目录
                            # 1. cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.32
                            # 2. cp /usr/src/linux/System.map /boot/System.map-2.6.32               
make modules_install                    # 编译模块 并拷贝到相应目录 /lib/modules
mkinitramfs -o /boot/initrd.img-2.6.32 2.6.32    # 创建initrd文件



#####################
#
#     修改grub
#
#####################

vim /boot/grub/menu.lst
-------------------------------------------------------------------------

title           Debian GNU/Linux, kernel 2.6.32
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32 root=/dev/sda1 ro quiet
initrd          /boot/initrd.img-2.6.32

title           Debian GNU/Linux, kernel 2.6.32 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32 root=/dev/sda1 ro single
initrd          /boot/initrd.img-2.6.32

title           Debian GNU/Linux, kernel 2.6.26-2-686
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-686 root=/dev/sda1 ro quiet
initrd          /boot/initrd.img-2.6.26-2-686

title           Debian GNU/Linux, kernel 2.6.26-2-686 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-686 root=/dev/sda1 ro single
initrd          /boot/initrd.img-2.6.26-2-686

-------------------------------------------------------------------------
 
阅读(884) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~