QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4606|回复: 16

内核特别版是如何制作的?

[复制链接]
发表于 2003-5-3 10:05:45 | 显示全部楼层 |阅读模式
我下了公社的制作的rh8的内核特别版,感觉很好,想知道它是如何做出来的??
发表于 2003-5-3 10:31:17 | 显示全部楼层
sorry, it is not made by me, anybody can answer this?
回复

使用道具 举报

发表于 2003-5-3 12:11:19 | 显示全部楼层
是我做的,其实简单得不得了
1.先在redhat那里下载最新内核的src.rpm
2.rpm -ivh kernelxxx.src.rpm,这将会将kernelxxx.spec安装在/usr/src/redhat/SPEC目录下,将内核源码补丁还有config都安装到/usr/src/redhat/SOURCE目录下
3.进入/usr/src/redhat/SOURCE,修改相应体系的config文件(基本的有i386,i586,athlon,i686),加入或修改某些选项,譬如,加入ntfs支持就是确认config文件里有:
CONFIG_NTFS_FS=m
CONFIG_NTFS_RW=y
加入默认cp936编码支持就是:
CONFIG_NLS_DEFAULT="cp936"
4.修改一下/usr/src/redhat/SOURCE下内核源码中,PS手柄驱动里的PSX_delay宏定义,保存(可以跳过这步)
5.进入/usr/src/redhat/SPEC,修改kernel-xxx.spec
将开头改成类似下面:
%define buildup 1
%define buildsmp 0
%define buildBOOT 0
%define buildbigmem 0
%define buildjensen 0
这样就表示只rebuild单CPU版本,其他什么bigmem支持,smp支持版本都通通不做(这些版本一般没有用上),这样会缩短编译时间
6./usr/src/redhat/SPEC下,
rpmbuild -bb kernel-xxx.spec --target=i386(生成i386体系内核)
rpmbuild -bb kernel-xxx.spec --target=i586(生成i586体系内核)
rpmbuild -bb kernel-xxx.spec --target=athlon(生成athlon体系内核)
rpmbuild -ba kernel-xxx.spec --target=i686(生成i686体系内核)
7.生成的内核可以在/usr/src/redhat/RPMS目录下的各个分目录里得到
回复

使用道具 举报

发表于 2003-5-4 01:19:11 | 显示全部楼层
ic. so it is a rh hacked kernel with some specific support for starters. i will think how to improve it. for example, a special one for laptop users, for game users... any good suggestion?
回复

使用道具 举报

发表于 2003-5-6 12:22:42 | 显示全部楼层
如果用原装的内核来rebuild rpm,比较麻烦,因为rh的内核是一个个patch打上的,要用原装的话,估计要自己写一个spec了
修改内核配置可以直接修改那些config文件,将特殊的要求设置好就可以
for laptop的话,APM或ACPI部分要注意一下,for game user的话,字符设备那里,agpgart要选上,DRI也要选上,RTC支持选上,cpu配置那里的mtrr也要选上
回复

使用道具 举报

发表于 2003-5-6 12:48:06 | 显示全部楼层
[quote:e957635d85="llc"]
6./usr/src/redhat/SPEC下,
rpmbuild -bb kernel-xxx.spec --target=i386(生成i386体系内核)
rpmbuild -bb kernel-xxx.spec --target=i586(生成i586体系内核)
rpmbuild -bb kernel-xxx.spec --target=athlon(生成athlon体系内核)
rpmbuild -ba kernel-xxx.spec --target=i686(生成i686体系内核)
[/quote]

config的CPU配置中的CPU类型不用改吗?
回复

使用道具 举报

发表于 2003-5-6 21:53:11 | 显示全部楼层
the target decides which config file it use, so for each config file the right cpu type is already  in the config file.
回复

使用道具 举报

发表于 2003-5-6 23:54:46 | 显示全部楼层
[quote:9e41503650="cheungming"]the target decides which config file it use, so for each config file the right cpu type is already  in the config file.[/quote]

多谢!我觉得应该自己下载一个亲自试试,您认为呢  :-)
回复

使用道具 举报

发表于 2003-5-7 01:17:42 | 显示全部楼层
sure, of course. tell me the result, hehe.
btw, where to download?
回复

使用道具 举报

发表于 2003-5-7 12:30:20 | 显示全部楼层
[quote:22c85895e7="cheungming"]sure, of course. tell me the result, hehe.
btw, where to download?[/quote]

呵呵,我以为您知道呢.
去redhat找了一下没找到,呵呵.只好用up2date试试了  
回复

使用道具 举报

发表于 2003-5-7 21:19:49 | 显示全部楼层
i am downlading the kernel 2.4.20-9 and kernel source 2.4.20-9 from one of redhat mirror. u need find these update from its mirrow sites.

i mean the kernel built by llc.
回复

使用道具 举报

发表于 2003-5-7 22:19:36 | 显示全部楼层
多谢,我试试  
回复

使用道具 举报

发表于 2003-5-10 00:17:45 | 显示全部楼层
up2date有一个参数,忘记是什么了,大概是--src,用这个参数升级包时,会自动将升级包的src.rpm也下载下来,放在/var/spool的一个目录下,当然,下载的东西多了,升级时间也比较长
用up2data --help看看
回复

使用道具 举报

发表于 2003-5-10 20:56:22 | 显示全部楼层
我用 up2date-config 改的,但是下载的时候提示什么PGP错误  
回复

使用道具 举报

发表于 2003-5-15 17:44:45 | 显示全部楼层
大家可以到:apt.freshrpms.net 下载rh的升级源包
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-10-4 17:16 , Processed in 0.057013 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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