vi /etc/make.conf
#Pentium 4 (Intel)
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
下载内核,解压到/usr/src/,对新建立的目录建立
cd /usr/src/
ln -s linux-2.6.21.5 linux
下面是内核所带的README
If you install the full sources, put the kernel tarball in a directory where you have permissions (eg. your home directory) and unpack it:
gzip -cd linux-2.6.XX.tar.gz | tar xvf -
or
bzip2 -dc linux-2.6.XX.tar.bz2 | tar xvf -
Replace "XX" with the version number of the latest kernel.
Do NOT use the /usr/src/linux area! This area has a (usually incomplete) set of kernel headers that are used by the library header files. They should match the library, and not get messed up by whatever the kernel-du-jour happens to be.
按他说的做最好,不管它也行,出了错的话就要按他的做了。
make proper
make menuconfig
make
make modules_install
make install
在执行make mrproper这个命令以后,可以到/boot目录下,将config-xxx改名为.config复制到/usr/src/linux目录中。接着执行make menuconfig命令,直接从Load an Alternate Configuration File这个选项中调用刚刚复制到里面的./config文件进行内核配置。而这个配置文件就是机器上原来的默认配置选项。这样就方便了许多,毕竟内核选项繁多复杂,除非你对每个选项都熟悉,否则还是建议调用机器原来的配置进行调整。