bixuan 发表于 2002-12-27 10:14:52

内核编译简法[转]

具体如下:太多了,打了主要的部分。有些地方没有说明,看命令就明白了。
1、下载内核文件如:linux-2.4.18-3.tar.gz拷贝到/usr/src目录并解压缩。
# cd /usr/src
# tar zvxf linux-2.4.18-3.tar.gz
2、进入解压目录。(/usr/src/linux-2.4.18-3,视文件名而定)
# cd /usr/src/linux-2.4.18-3
# make mrproper
# make xconfig
3、进行选译,自己设定个性化的内核。完后点“save and exit”

4、进行编译。
# make dep
# make clean
# make bzImage (I要大写哟)
5、编译模块。
# make modules
# make modules_install
# depmod -a
6、编译完成,开始替换文件。
# cd /boot
# rm System.map
# rm vmlinuz
# mv /usr/src/linux-2.4.18-3/System.map System.map
# mv /usr/src/linux-2.4.18-3/arch/i386/boot/bzImage vmlinux
7.修改开机设定。
GRUB是 /boot/grub/grub.conf文件 lilo是/etc/lilo.conf文件
可以用命令
# mkinitrd /boot/initrd-2.4.18-3.img 2.4.18-3来生成initrd文件。
用GRUB来举例子说。(红色部分)
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,7)
# kernel /vmlinuz-version ro root=/dev/hda10
# initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=5
splashimage=(hd0,7)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-3)
root (hd0,7)
kernel /vmlinuz-2.4.18-3 ro root=/dev/hda10
initrd /initrd-2.4.18-3.img
title win xp
rootnoverify (hd0,0)
chainloader +1
重启计算机,完工。
附加说明:
内核编译好后在以下几个位置的。
1。bzImage文件 /usr/src/linux-2.4.18-3/arch/i386/boot目录
2。外挂模块 /usr/src/linux-2.4.18-3/arch/i386/lib目录
3。已安装的模块文件 /lib/modules/2.4.18-3目录

cnhnln 发表于 2003-3-19 17:44:13

2.5.x 是不是不需要make dep ?
depmod -a 是什么意思?什么作用?
initrd文件是做什么用的?为什么要生成它?不生成行不行?

Dragonfly 发表于 2003-3-19 22:49:16

2.5.x need not make dep. make zImage or bzImage directly.
depmod -a is to check if all u kernel module dependency is correct. u can useman to get more info.
initrd file base on my undertsnding, is only used in some situations. for example, u root on a scsi disk. i remeber kernel documentation have good intro. i read it before, but forget again. the memory in my brain is small, maybe 640k?

cnhnln 发表于 2003-3-20 18:37:46

谢谢!
不过购费劲的,有几个单词都不认识
能不能说中文呀?

Dragonfly 发表于 2003-3-20 23:01:42

hehe, i am sorry that i have no chinese input environment. u have xdict under windows and stardict under linux. so i think u can solve this problem, hehe.

xinlinux 发表于 2003-4-9 09:34:33

如果没有中文输入,中国文化会消失

Dragonfly 发表于 2003-4-9 09:37:25

nod, nod. so i am poor.

maso 发表于 2003-4-9 23:15:31

http://www.iciba.net/
online xdict
8)

Dragonfly 发表于 2003-4-9 23:21:43

my problem is that i can not input chinese. not i do not understand chinese. i have stardict on my linux box when i need.

bixuan 发表于 2003-4-10 10:13:39

http://www.iciba.net/
online xdict
8)
如果用在线翻译的话,建议到这里:http://www.netat.net,我也是经常去这里。

damm 发表于 2003-4-10 12:59:10

可以直接用make install 安装编译好的内核与模块

linjiang_82 发表于 2003-5-5 19:13:32

到哪下载内核????

cnhnln 发表于 2003-5-5 19:19:18

到哪下载内核????
http://www.kernel.org/

linjiang_82 发表于 2003-5-6 12:33:32

非常感谢

linjiang_82 发表于 2003-5-6 12:35:43

我出现了这个问题,不知道是什么意思
# make xconfig
rm -f include/asm
( cd include ; ln -sf asm-i386 asm)
make -C scripts kconfig.tk
make: Entering directory `/usr/src/linux-2.4.20/scripts'
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o tkparse.o tkparse.cgcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o tkcond.o tkcond.c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o tkgen.o tkgen.c
gcc -o tkparse tkparse.o tkcond.o tkgen.o
cat header.tk >> ./kconfig.tk
./tkparse < ../arch/i386/config.in >> kconfig.tk
echo "set defaults \"arch/i386/defconfig\"" >> kconfig.tk
echo "set ARCH \"i386\"" >> kconfig.tk
cat tail.tk >> kconfig.tk
chmod 755 kconfig.tk
make: Leaving directory `/usr/src/linux-2.4.20/scripts'
wish -f scripts/kconfig.tk
make: wish: Command not found
make: *** Error 127
该怎么解决
页: [1] 2 3 4 5
查看完整版本: 内核编译简法[转]