Debian 64位内核升级步骤(编译内核deb包)

  1. apt-get install bzip2 libncurses5-dev kernel-package zlib1g-dev gcc make kernel-package wget module-init-tools procps libncurses5-dev
  2. cd /usr/src
  3. wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.35.9.tar.bz2
  1. tar -xvjf linux-2.6.35.9.tar.bz2
  2. cp /boot/config-`uname -r` /usr/src/linux-2.6.35.9/.config
  1. Then we must configure the new kernel:
  1. cd linux-2.6.35.9
  2. make menuconfig

我们在内核配置里面至少有两个地方要修改。如下所示:

  1. File systems -> Btrfs filesystem (EXPERIMENTAL) Unstable disk format

"Btrfs filesystem"之前标上<*>

  1. Processor type and features -> Processor Family -> "our processor"
  2. 删除Dell laptop supportToshiba Laptop support
  1. 裁减sound card support
  2. 裁减Bluetooth subsystem support
  3. 裁减Wireless
  1. 裁减Kernel hacking 
  1. 多次点击“ESC”退出,保存
  1. include/linux/version.h 中添加宏定义:

#define UTS_RELEASE 2.6.35.9

  1. make-kpkg linux-image linux-headers --initrd
  2. 编译成功后执行cd ..
  1. dpkg -i linux-image-2.6.29_2.6.35.9-10.00.Custom_i386.deb
  1. dpkg -i linux-headers-2.6.29_2.6.35.9-10.00.Custom_i386.deb
  2. 重启,用uname-a 查看内核版本


错误处理

编译完成后生成linux deb 包,先dpkg -i装image,再装headers 

安装完成以后再update-grub 进入/boot/grub/menu.lst 中选择启动的内核项 默认的第一项为0

ps:在编译完成内核后开机可能出现 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)的错误 在/boot/grub/menu.lst中可以发现新加的内核可能是没有 initrd   /initrd.img-2.6.37.6 未生成的原因不明 可以手动生成 

执行命令 

 mkinitramfs -o /boot/initrd.img-2.6.34.10 2.6.34.10(/boot/initrd.img-2.6.34.10是这个启动加载文件的生成路径 2.6.34.10是 /lib/modules/2.6.34.10)然后update-grub 再启动新内核就没有问题了

卸载一个已经安装的内核包

debian卸载旧内核要先看看有哪些旧的内核,用命令:

   dpkg --get-selections |grep linux

如果你的内核是以kernel开头的就把上面的linux改成kernel,之后再用

   dpkg --purge --force-remove-essential linux-image-XXX

转载于:https://my.oschina.net/zphj1987/blog/77897

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值