For some mysterious reasons, I decided to rebuild kernel 2.6.24 for my needs. I failed several times, eventually, I’m using the brand new kernel right now.
For the first time, my box hung at Waiting for root file system. I googled and found out it is because the kernel recognized IDE hard disk as sd. Actually I saw a lot of sd?? when booting up the computer and then it hung. Google results indicates
ATA/ATAPI/MFM/RLL support
Include IDE/ATA-2 DISK support
should be Y(not M) if the root file system is in an IDE disk. So I chose Y and rebuilt and it hung at Waiting for root file system again. I compared the config with 2.6.22’s and found that there’s one option called generic/default IDE chipset support, says If unsure, say N, but in 2.6.22 it says If unsure, say Y. Weird! And somehow I chose Y and rebuilt and the kernel recognize IDE disk as hd normally.
When I logged in, I found my eth0 disappeared. I check the kernel options again and found my VT6102 [Rhine-II] Ethernet controller was not chosen. After 7 or 8 times I finally got the kernel worked.
BTW, I’ll write down the standard procedure of making kernel package under Debian.
Step 0: $ make xconfig/gconfig/menuconfig to config the kernel. You may want to copy the old config file to the source dir as .config.
The config file can be found in /boot, the name is config-kernel_version.
Step 1: $ make-kpkg clean
Whatever you’re compiling a new kernel or recompiling, this step is essential.
Step 2(the real fun): # make-kpkg --revision=mykernel --initrd kernel_image modules_image
or
$ fakeroot make-kpkg --revision=mykernel --initrd kernel_image modules_image
kernel_image is the exactly kernel package. modules_image is used to build a modules package from /usr/src/modules. You may want kernel_headers as well.
Step 3: Install the kernel, of course.
That’s it. Good luck!
这个 amd64 下的内核模块问题以前搞过,忘了。如今升级内核又要重新弄,又被我想起来了,于是决定写下来,以后忘了有地方查,顺便别的朋友也可以参考一下。
Debian amd64 的源里提供了 virtualbox-ose 以及 virtualbox-ose-guest-utils 二进制包,但并没有提供 virtualbox-ose-modules,也就是 VirtualBox OSE 内核模块。没有内核模块 VirtualBox 是无法运行起来的。虽然 Debian 并没有提供 amd64 版的内核模块,但是我们可以自己编译。
我们可以通过 virtualbox-ose-source 来编译内核模块。查看 /usr/share/doc/virtualbox-ose-source/README.Debian,里面说:
The Debian virtualbox-ose-source package can be used in several ways,
– Using module-assistant(1) commands provided by the module-assistant Debian
package:
# module-assistant prepare virtualbox-ose
# module-assistant auto-install virtualbox-ose
– Using the make-kpkg(1) command provided by the kernel-package Debian
package. See the “modules_image” section of the make-kpkg(1) man page.
– Unpacking /usr/src/virtualbox-*.tar.bz2 and installing the module on your own.
上面那一串 E 文是在说 virtualbox-ose-source 有三种使用方法。我们就使用第一种来编译内核模块,因为此种方法最简单。呵呵,方法就是上面那两个命令了,再单独列一下也无妨:
# module-assistant prepare virtualbox-ose
# module-assistant auto-install virtualbox-ose
当然,首先你得先装上 virtualbox-ose。这两条命令过后,会在内核源代码目录生成相应版本的内核模块 deb 包,名字叫 virtualbox-ose-modules-内核版本号_amd64.deb。应该是内核源代码目录,因为我用的是自己编译的内核,我生成的 deb 包在我专门用来存放内核源代码的目录下。如果你用的是源里的内核,到底 deb 包在什么位置我也不知道。不过没关系的,编译好直接就会安装的,所以无须知道 deb 包的具体位置。
要使用 VirtualBox OSE,首先加载内核模块:
,然后就能用了。
今天闲着无聊,于是将内核升级到了 2.6.24。无意中发现源里有个 debian-logo 的 kernel patch,用来把默认的 tux bootup logo 换成 debian 的 logo。试了一下,效果还不错。
其实原打算搞 bootsplash 的,虽然 bootsplash 已被 splashy 项目所取代,bootsplash 官方自 2.6.21 以后不再发布新的 patch,但还是能够下载到非官方的 patch,是 2.6.23 的,但是 2.6.24 也适用。于是我将 debian-logo 和 bootsplash 的patch 都打了。但我发现好多有关配置 bootsplash 的文章都说选了 bootsplash 内核选项就不要选 bootup logo,貌似两者不能共存的样子。反正我想 bootsplash 出不来也没事,正好试试 splashy,于是便将 bootup logo 选上了,并且选的是 debian 的 logo。
说也奇怪,不知是 kernel 加剧了还是我的系统变慢了,这次编译内核居然花了我三个多小时的时间,都将近四个小时了,而且 kernel 的个头也是有史以来最大个的。看了一下 /boot 目录下的东西,发现不管是 vmlinuz 还是 initrd.img 都是一个版本比一个版本的大。linux kernel 真是越长越肥了,呵呵。
漫长的编译完成了,重启,果然,bootup logo 和 bootsplash 不能共存的,说得准确一点,是不能同时起作用,因为两个都编译是没有问题的。debian 的 bootup logo 能看见,在左上角,但 bootsplash 就不行了。正好让我再试试 splashy。以前试过 splashy,问题多多,曾经导致 gdm 无法自动启动,这回看看它有没有什么改进。由于目前我用的是 kdm,貌似 splashy 没有导致 kdm 无法自动启动,但 splashy 这效果还真是不能和 bootsplash 比。哎,谁让这年头不流行 kernel space 的东西呢。干脆就不要了,那个 debian logo 看看就不错,启动时显示在左上角,一点也不刺眼,下面字符在滚动,给启动过程添点淡淡的色彩。