LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 961|回复: 3

我在debian 下编译内核的结果

[复制链接]
发表于 2006-11-4 23:08:50 | 显示全部楼层 |阅读模式
我按照http://xcaptain.bokee.com/175305 ... 编译我的内核
我现在的是2.4,编译的是2.6.18

来自上面连接的步骤:

首先到http://www.kernel.org 下载最新的2.6.10内核,解压到/usr/src目录下;
tar -jxvf linux-2.6.10.tar.bz2 -C /usr/src
cd /usr/src
ln -s linux-2.6.10 linux
接下来安装编译2.6内核所需的软件:
apt-get install kernel-package ncurses-dev fakeroot module-init-tools
在/usr/src/linux目录下运行以下命令配置和编译新内核:
make menuconfig
make-kpkg clean
fakeroot make-kpkg --revision=mykernel.1.0 kernel_image
如果编译失败,可用make clean和make menuconfig重新配置和编译。
配置信息默认会保存在/usr/src/linux/.config文件中。

内核编译完成后在/usr/src目录下就会生成一个kernel-image-2.6.10_mykernel.1.0_i386.deb软件包,用以下命令安装:
dpkg -i kernel-image-2.6.10_mykernel.1.0_i386.deb

重新启动后:
<0>kernel panic - not syncing: Attempted to kill the idle task!
发表于 2006-11-5 07:49:49 | 显示全部楼层
既然能制作出 kernel 的 deb 包说明编译过程是没有错误发生,我想在这里提出两点:

1. 你看的文章要麽就是过时,要麽就是方法不正确,误导用户:beat

引自 LFS 手册第 8 章编译内核的部份
http://www.linuxfromscratch.org/ ... apter08/kernel.html
Warning

Some kernel documentation recommends creating a symlink from /usr/src/linux pointing to the kernel source directory. This is specific to kernels prior to the 2.6 series and must not be created on an LFS system as it can cause problems for packages you may wish to build once your base LFS system is complete.

Also, the headers in the system's include directory should always be the ones against which Glibc was compiled, that is, the ones from the Linux-Libc-Headers package, and therefore, should never be replaced by the kernel headers.

以下是引自 CLFS x86_64 multilib 手册编译内核的部份,分别在 header 文件,Debian 仍采用 Linux-Libc-Headers,但 Linux-Libc-Headers project 其实已寿终正寝了!
http://cross-lfs.org/view/svn/x86_64/bootable/kernel.html
Warning

Some kernel documentation recommends creating a symlink from /usr/src/linux pointing to the kernel source directory. This is specific to kernels prior to the 2.6 series and must not be created on a CLFS system as it can cause problems for packages you may wish to build once your base CLFS system is complete.

Also, the headers in the system's include directory should always be the ones against which Glibc was compiled (from the Linux-Headers package) and should never be replaced by the kernel headers.

2. 造成 kernel panic 的原因有很多,多数都是还项不对或配置不正确引起的,你先行搜索一下吧。
回复 支持 反对

使用道具 举报

发表于 2006-11-15 16:37:06 | 显示全部楼层
有没有生成initrd.img
cd /boot
mkinitrd -0 initrd.img-2.6.18
再修改menu.lst,加入相关内容
回复 支持 反对

使用道具 举报

发表于 2006-11-16 04:50:04 | 显示全部楼层
makekpkg 本身有选项生成 initrd 的, 好像是 --initrd
没有用 initrd的话, 用到的硬盘驱动, fs 驱动一定不能编译成模块形式.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表