QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14955|回复: 66

内核编译简法[转]

[复制链接]
发表于 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目录
发表于 2003-3-19 17:44:13 | 显示全部楼层
2.5.x 是不是不需要make dep ?
depmod -a 是什么意思?什么作用?
initrd文件是做什么用的?为什么要生成它?不生成行不行?
回复

使用道具 举报

发表于 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 use  man 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?
回复

使用道具 举报

发表于 2003-3-20 18:37:46 | 显示全部楼层
谢谢!
不过购费劲的,有几个单词都不认识
能不能说中文呀?
回复

使用道具 举报

发表于 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.
回复

使用道具 举报

发表于 2003-4-9 09:34:33 | 显示全部楼层
如果没有中文输入,中国文化会消失
回复

使用道具 举报

发表于 2003-4-9 09:37:25 | 显示全部楼层
nod, nod. so i am poor.
回复

使用道具 举报

发表于 2003-4-9 23:15:31 | 显示全部楼层
http://www.iciba.net/
online xdict
回复

使用道具 举报

发表于 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.
回复

使用道具 举报

 楼主| 发表于 2003-4-10 10:13:39 | 显示全部楼层
[quote:a6c953297c="maso"]http://www.iciba.net/
online xdict
[/quote]
如果用在线翻译的话,建议到这里:http://www.netat.net,我也是经常去这里。
回复

使用道具 举报

发表于 2003-4-10 12:59:10 | 显示全部楼层
可以直接用make install 安装编译好的内核与模块
回复

使用道具 举报

发表于 2003-5-5 19:13:32 | 显示全部楼层
到哪下载内核????
回复

使用道具 举报

发表于 2003-5-5 19:19:18 | 显示全部楼层
[quote:6819e9adc0="linjiang_82"]到哪下载内核????[/quote]
http://www.kernel.org/
回复

使用道具 举报

发表于 2003-5-6 12:33:32 | 显示全部楼层
非常感谢
回复

使用道具 举报

发表于 2003-5-6 12:35:43 | 显示全部楼层
我出现了这个问题,不知道是什么意思
[root@Lin linux-2.4.20]# make xconfig
rm -f include/asm
( cd include ; ln -sf asm-i386 asm)
make -C scripts kconfig.tk
make[1]: 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[1]: Leaving directory `/usr/src/linux-2.4.20/scripts'
wish -f scripts/kconfig.tk
make: wish: Command not found
make: *** [xconfig] Error 127
该怎么解决
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-5-21 03:43 , Processed in 0.321662 second(s), 17 queries .

© 2021 Powered by Discuz! X3.5.

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