QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 992|回复: 9

菜鸟级内核编译过程~

[复制链接]
发表于 2004-1-29 17:40:12 | 显示全部楼层 |阅读模式

注:本人乃内核菜鸟一个,昨晚开始编译内核,经三次失败后终于成功。经验不敢独享,故发此帖。本文意在为广大内核菜鸟提供一个经验,可以成功编译出一个内核。望高手指正。



[code:1]
Kernel Making


本人采用2.6.0内核,Redhat Fedora Core 1(原为2.4.22)。
失败经历免谈~~主要是不会配置各种模块(这就是菜鸟的本质),运行make命令,不能通过。。


成功编译的步骤:
1.make mrproper && make defconfig

为什么要这步?由于我们是从2.4直接升级到2.6,变化很大,若直接make menuconfig的话,
make会读取系统中原来的config,这显然不是我们所想要的结果,所以先make defconfig,使
config先回复到default的状态。这样后来的工作就好做多啦。

2.make menuconfig(或gconfig,xconfig,这两个是GUI的,这里我们用menuconfig来讨论)

进入menuconfig,有很多的选项(头晕ING)。不过不用怕,由于我们刚才已经把config改回了
default状态,不会太乱的~~这里的原则是:有需要的就修改,没有需要的就不要动它~~怎么样,
是不是很省事啊?下面来具体讲一下(用x.x.x这样的标号方法来表示项目):

1.Code maturity level options
2.Gernel setup
3.Loadable module support
以上三项对于我们这等菜鸟来说是没有必要改的了(当然,你要改也可以)。

4.Processor type and features
这里主要改一下的是:
4.1 Subarchitecture Type---指定你的计算机类型(一般是PC-compatible,INTERx86结构的)
4.2 Processor family---处理器,自己看着办吧
4.5 Symmetric multi-processing support---多处理器支持,有就选,没有就不用啦。
4.6 [×]Preemptible Kernel---抢先式内核(咱用2.6不就是冲这个吗?)

另外的选项,可以自己看看帮助,一般按它默认的就行了。

5. Power management options---电源方面的设置
5.1 这个铁定要的啦~~
其他的自己看着办吧~~~(我是不要的了,,机子太老了:cry:)

6. Bus options---总线的设置
选项很多,,默认的已经改得差不多的了。有什么需要的自己改吧。(不要怪我懒得解释啊,,我的
英文水平真的不敢拿出来见人~~~~~~~~)

7. Excutable file formats---这里面的三项全选×,不用改了的。

8. Device drivers---设备驱动
这里主要改一下:
8.19 Graphics support---有关显示方面的
        是不是看到很多芯片类型啊?选一个合适的吧。另外,8.19.1,8.19.4,8.19.5这三个推荐选上(为
        什么?不为什么。。晕~~)
        最后面的两项无关痛痒,有兴趣的自己看看。

8.20 Sound---有关XX方面
        8.20.1这个一定要打×啦。。(不要告诉我你连这个英文都不会!!)
        8.20.2---这个还有下一层菜单
                主要说一下最后那几个还有下一层菜单的选项(汗~~~),前面的可以不用管的啦。
                8.20.2.10 推荐选上第一个,,好像它是用来控制PC speaker的(我没选,惨!!)               
                8.20.2.11 进去后又发现一大堆芯片。。还是选吧。。这个是ISA的。
                8.20.2.12 基本同上,不过这里是PCI的。
                8.20.2.13 用ALSA的FANS可要小心。。要想你的声卡发声的可要注意这里哦。

        8.20.3---open sound system进去看看吧。
                好像只有一个项哦~~不要急,打上M之后,又出来一堆芯片~~~还是选。不多说咯。

8.21 USB support---usb
        里面有很多项,也很具体,我就不费口舌了,耐下心来看一看吧~~~


9. File system---文件系统
        有了默认设置,一般也不用作太大改动了。有的地方注意一下。
        Reiserfs support 这个推荐选,选了这个之后,又会多出两个选项来的。
        Dos/fat/nt file system这一项,把ntfs file system support选上。
        network file system 这一项,记得把SMB file system support选上。
        Native language support这一项,可以把中文的codepage也选上。

10~14,我们这等菜鸟可以不用管啦,默认的就行。
然后SAVE。
之后
make bzImage
make modules
make
make install
make modules_install
假如能全部通过,那么恭喜你,你已经编译出一个内核了。
这个内核的体积可能有点偏大,没办法,谁叫咱们还是菜鸟呢。。
不过,也总算是成功了。

最后,可能还要改一下/etc/grub.conf。里面的启动项已经做好了。我们所要做的就是将
root=LABEL=/
这一处改为
root=“你的内核的实际路径”(/dev/hdax等)

然后,重启~~~~~
祝你好运~~~~~~


呼~~~,终于写完了。我知道写得很不好,大家不要拍砖啊。。有错可以指出。大家一起研究。
本文在2.6.0 fedora core 1 下写成

[/code:1]
发表于 2004-1-29 20:35:50 | 显示全部楼层
你发的正是时候也

我正想换内核。。。
3ks
回复

使用道具 举报

发表于 2004-1-30 00:09:07 | 显示全部楼层
i tested the 2.6.1 on my laptop yesterday. no problem at all. at least i am lazy to check if it has problem. now i can enter x, work on my stuff. listen to music and watch movie. surf web. then what else i need ?


for a new software, always read its README and INSTALL before u going further. u are not so strong as u assumed.  
回复

使用道具 举报

 楼主| 发表于 2004-1-30 00:40:11 | 显示全部楼层
Dragonfly,多谢你的指正。

请教一个问题,你在编译新内核的时候是否不用make defconfig,而直接读取原来内核的设置?这样真的没有问题吗?我的我的机子上试过,没有一次能编译成功的(三次以上)。可能是我的机子有点旧了。

另外,要让pc speaker发声应选那一项?还有就是我用原来的内核执行halt,最后会出现flushing hda hdd,这样的句子,并自动为硬盘断电,要有这个功能又应该选上哪项?还望多多指教!!  
回复

使用道具 举报

发表于 2004-1-31 01:17:53 | 显示全部楼层
HOWTO: Fedora Core 1 with kernel 2.6
http://fedoranews.org/jorge/howto/howto01.shtml
这里有篇文章教你如何从RPM安装2.6,很简单的,我一次成功了.
[ZT]
the entry for Fedora Core (2.6.0-1.1.103) and if nothing goes nasty during the hardware detection process, you'll be using your FC1 box with kernel 2.6 in no time.

Almost all of this was consulting the Freax.be wiki about Fedora (which now seems unavailable, if you know where they have gone to, send me an email) here, and I got the initrd tip from this thread.

Another change in 2.6 against 2.4 and earlier versions is that now ALSA is being used as default sound driver. You can download the drivers (alsa-driver, alsa-lib, alsa-lib-devel and alsa-utils) from the ALSA project, for configuring ALSA I recommend you using the alsaconf program provided by those packages.

All this process is being done "the sudo way" in order to keep the security risk at minimum, if you do not know about sudo, sudoers file or anything, you can always check the sudo man page or check this howto, and grasp a basic idea about sudo.

By now Arjanv has the 2.6.1 RPM kernel in this address, I haven't tested them yet, but I guess it will be pretty much the same process described here.

*UPDATE: As of 2004-01-14
Kernel 2.6 now uses the file /etc/modprobe.conf instead of /etc/modules.conf, if you activated the kudzu service and moved/deleted/renamed your /etc/sysconfig/hwconf it should've been created.
One issue that you might encounter is that the USB Human Interface module has changed in 2.6, it is called uhci-hcd instead of usb-uhci, so you may need to modify your /etc/modprobe.conf

alias usb-controller uhci-hcd
or add the hardcoded entry in your /etc/rc.sysinit for modprobing uhci-hcd (thanks to Frank Merenda for this).
Other modules that changed: "keybdev" into "usbkbd" and "mousedev" into "usbmouse".

*UPDATE: As of 2004-01-16
This process is reliable for joe-user machines, I mean, if you use LVM or other things that are a little uncommon, you can download the update packages from the same location you downloaded the kernel packages, but I cannot assure that they will function, as I haven't tested them (Thanks to David Brownlee for pointing this out).
回复

使用道具 举报

 楼主| 发表于 2004-1-31 17:46:03 | 显示全部楼层
rpm?
I think I will loss the happiness which comes from compiling the kernel myself.
回复

使用道具 举报

发表于 2004-2-1 00:41:59 | 显示全部楼层
hahaha,Just like people likes cooking, others like enjoy food.
回复

使用道具 举报

发表于 2004-2-1 11:15:40 | 显示全部楼层
i always use make menuocnfig and choose by myself.

u need enable all ACPI stuff for auto poweroff.
回复

使用道具 举报

 楼主| 发表于 2004-2-1 11:35:45 | 显示全部楼层
要让pc speaker发声应选那一项?
回复

使用道具 举报

发表于 2004-2-6 00:17:17 | 显示全部楼层
好像不用make defconfig吧?
呵呵,
我也是菜鸟,
懂得不多。
make menuconfig
make oldconfig
make xconfig
都试过,
感觉menuconfig最保险,
升级2.6内核可是我第一次哦,
总共编译了七八编,
最后选择在menuconfig下一项项选,
用到的就选,
没用的坚决去掉,
现在用了一个来月,
很正常。
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-9-18 15:44 , Processed in 0.041961 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

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