LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: 老李飞刀

看来我要放弃了。

[复制链接]
发表于 2008-11-20 17:59:04 | 显示全部楼层
都到内核了,还准备放弃啊? LZ在其他发行版上编译内核运行成功过没?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-11-20 18:55:12 | 显示全部楼层
Post by wsw;1911191
都到内核了,还准备放弃啊? LZ在其他发行版上编译内核运行成功过没?


我用DEBIAN成功的,我就把DEBIAN的.CONFIG拿来用也搞不行,不过各位都这么热心,我死也要死到底了。昨天只是在出差的途中在网吧发的贴,想不到今天回来,看到这么多热心人,好感动,哈哈。坚持。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-11-20 19:03:00 | 显示全部楼层
Post by ti8er;1910940
楼主广州的?我也在广州:)

内核要一项项慢慢读懂才可以真正开始编译。

http://ti8er.blog.ubuntu.org.cn/files/2008/10/main1.pdf

这是内核配置菜单,请仔细阅读第9章设备驱动。搞清楚SATA硬盘应该怎么驱动。

第3章块设备也涉及到硬盘启动。

配置内核急不得。


是在广州,呵呵。做在车陂目前。早段时间住体育西,太贵了,不敢住了。还好就是工作常常出差,不用挤车那么累。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-11-20 19:03:49 | 显示全部楼层
Post by whitelilis;1910964
楼主加油,你离成功只有一步之遥了,坚持。


谢谢,一定坚持到底。不成功就不结婚了~~~~~
回复 支持 反对

使用道具 举报

发表于 2008-11-20 19:25:26 | 显示全部楼层
Post by 老李飞刀;1911217
我用DEBIAN成功的,我就把DEBIAN的.CONFIG拿来用也搞不行,不过各位都这么热心,我死也要死到底了。昨天只是在出差的途中在网吧发的贴,想不到今天回来,看到这么多热心人,好感动,哈哈。坚持。

看来没有看 Debian 区编译内核的置顶帖,难怪不行。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-11-20 20:17:24 | 显示全部楼层
Post by d00m3d;1911228
看来没有看 Debian 区编译内核的置顶帖,难怪不行。


好,马上去看。有时候我还不一定能看得懂,我一个学生物工程,做化工原材料的人,呵呵!
回复 支持 反对

使用道具 举报

发表于 2008-11-20 20:45:23 | 显示全部楼层

最简内核配置,可参考

http://linuxman.blog.ccidnet.com ... -itemid-293122.html

三、适合CLFS临时系统的最简内核配置
我的host系统是32位的,无法使用chroot方式构建CLFS系统,只能先交叉编译出一个最小的临时系统,然后以BOOT方式完成CLFS系统的构建。在CLFS BOOK中,对临时系统的内核的配置有下面的警告:
Warning
Here a temporary cross-compiled kernel will be built. When configuring it, select the minimal amount of options required to boot the target machine and build the final system. I.e., no support for sound, printers, etc. will be needed.
Also, try to avoid the use of modules if possible, and don't use the resulting kernel image for production systems.

那么,怎样得到一个适合CLFS临时系统的最简内核配置呢?

(1)首先,用内核的 allnoconfig 配置目标,得到一个最最基本的内核配置。即,执行下面的命令:
make ARCH=x86_64 CROSS_COMPILE=${CLFS_TARGET}- allnoconfig
内核的 allnoconfig 配置目标会把所有的内核选项都设置为no,也就是把它们既不编译进内核,也不编译成模块。有了这个最基本的配置,我们再添加CLFS临时系统所必须的配置项:再执行
make ARCH=x86_64 CROSS_COMPILE=${CLFS_TARGET}- menuconfig
命令,按下面的步骤添加其他的配置——

(2)按CLFS BOOK的建议,把 Executable file formats 下的ELF 和 emulations for 32bit ELF 选项编译进内核。

(3)在 Processor type and features 下面,选择合适的CPU类型。例如,我的CPU类型是Intel EM64T

(4)选择PCI/PCI-Express支持,位于Bus options (PCI, PCMCIA, EISA, MCA, ISA) 配置目录下。

(5)加入对根文件系统所在磁盘控制器的驱动,详细方法可参考:http://linuxman.blog.ccidnet.com/blog-htm-do-showone-uid-60710-type-blog-itemid-280649.html。例如,我的机器的配置是:
Device Driver
|---->SCSI device support
|---->SCSI disk support
|----->SCSI low-level drivers
  |---->Serial ATA (SATA) support
  |---->intel PIIX/ICH SATA support

(6)加入Ext2文件系统的支持:在 File systems 配置目录下,选择 Second extended fs support。如果根文件系统是Ext3,则选择 Ext3 journalling file system support。

(7)为了是 Udev 正常工作,需要内核支持 Unix domain sockets。此配置选项位于 Networking 配置目录中的 Networking support ---> Networking options 下。

(8)使内核支持 /proc 虚拟文件系统和 tmpfs 文件系统: File systems ---> Pseudo filesystems ---> /proc file system support / Virtual memory file system support (former shm fs)

(9)支持 swap 分区: General setup ---> Support for paging of anonymous memory (swap)

(10)支持 RTC 设备: Device Drivers ---> Character devices ---> Enhanced Real Time Clock Support

(11)为了充分发挥我的双核CPU的能力,我又加入了对SMP的支持: Processor type and features ---> Symmetric multi-processing support。这一特性,对CLFS系统来说,并不是必须的。

这样一个最简的内核配置,编译出来的内核映像文件的大小只有744KB,但却能完全满足CLFS系统后续的构建工作需要。
回复 支持 反对

使用道具 举报

发表于 2008-11-20 20:47:42 | 显示全部楼层

硬盘驱动的内核配置,可参考

http://linuxman.blog.ccidnet.com ... -itemid-280649.html

常常听到一些初次玩LFS的朋友讲:经历了千辛万苦,终于编译完了全部LFS系统,怀着激动的心情重启机器,期待着自己亲手构建的LFS顺利运行时,经常会遇到Kernel panic ——内核打出类似下面的一段话,然后死机:
VFS: Cannot open root device "sda8" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

这个问题应该怎么解决?

以我的经验,造成这个问题的原因十有八九是没有把root文件系统所在的硬盘控制器的驱动程序编译到内核中。解决的也很直接:找到硬盘控制器的型号,然后把相应的驱动程序编译到内核中。更详细的解决步骤是:
1、在构建LFS的host系统上,运行lspci命令,列出机器的硬件信息。
2、在硬件信息中,查找 IDE interface 或 SATA Controller 或 SAS Controller 等关键字,得到到硬盘控制器的型号
3、在内核配置中,把对应的驱动程序编译到内核(不能编译成模块)。对 IDE硬盘,驱动程序在Device Drivers-->ATA/ATAPI/MFM/RLL配置项下找;对于 SATA硬盘,驱动程序在Device Driver-->SCSI device support-->SCSI low-level drivers配置项下找。
4、重启机器,在LFS的新内核下,问题解决。

例子1:
我的DELL Inspiron6400 的SATA硬盘控制器问题(http://linuxman.blog.ccidnet.com/blog-htm-do-showone-uid-60710-type-blog-itemid-226147.html

1)用lspci命令列出硬件信息:
wyk-debian:/home/wyk# lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GTT Express Memory Controller Hub (rev 03)
00:01.0 PCI bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express PCI Express Root Port (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Aud io Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (r ev 01)
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (r ev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controll er #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controll er #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controll er #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controll er #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Control ler (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (re v 01)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Con troller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X1400
03:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)
03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapte r (rev 19)
03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 01)
03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (re v 0a)
03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)
0b:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Conne ction (rev 02)

2)查找关键字,得到硬盘控制器的型号:
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Con troller (rev 01)

3)配置内核,把对应的驱动程序编译进内核:
Device Driver
|---->SCSI device support
|---->SCSI disk support
|----->verbose SCSI error reporting (不是必须的,但可方便问题定位)
|----->SCSI low-level drivers
    |---->Serial ATA (SATA) support
    |---->intel PIIX/ICH SATA support

4)重启机器,在LFS新内核下,问题解决。

例子2:
linuxsir 论坛上yantao123yt网友的VMware虚拟机的硬盘控制器问题(http://www.linuxsir.cn/bbs/thread326405.html

1)用lspci命令列出硬件信息:
lfslivecd:root | sat apr 5 11:17:07 2008 | /
#lspci

00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)
00:07.2 USB controller: Intel Corporation 82371AB/EB/MB PIIX4 USB
00:07.3 Bidge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:0f.0 VGA Compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter
00:10.0 SICI storage controller: LSI Login / symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra 320 SCSI (rev 01)
00:11.0 Ethernet controller : Advanced Micro Devices [AMD] 79C970 [PCnet32 LANCE] (rev 10)
00:12.0 Multimedia audio controller :Ensoniq ES1371 [AudioPCI-97] (rev 02)

2)查找关键字,得到硬盘控制器的型号:
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)

3)配置内核,把对应的驱动程序编译进内核:
Device Driver
|---->DriverATA/ATAPI/MFM/RLL
|---->Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
  |----->generic/default IDE chipset support
  |----->CI IDE chipset support
    |---->Generic PCI IDE Chipset Support

4)重启机器,在LFS新内核下,问题解决。
回复 支持 反对

使用道具 举报

发表于 2008-11-21 05:43:21 | 显示全部楼层
Post by 老李飞刀;1911256
好,马上去看。有时候我还不一定能看得懂,我一个学生物工程,做化工原材料的人,呵呵!
我可不是叫你按 Debian 的方式来编译啊,只是我在帖子里解释过为什麽 Debian 系统用的内核非不要 initrd 不行

http://www.linuxsir.cn/bbs/thread284609-2.html

楼上兄弟也解释了同样的问题的解决方法
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-11-21 21:00:44 | 显示全部楼层
Post by d00m3d;1911392
我可不是叫你按 Debian 的方式来编译啊,只是我在帖子里解释过为什麽 Debian 系统用的内核非不要 initrd 不行

http://www.linuxsir.cn/bbs/thread284609-2.html

楼上兄弟也解释了同样的问题的解决方法


呵呵,收到,继续学习,刚从顺德回来,再试,我就不相信了。
回复 支持 反对

使用道具 举报

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

本版积分规则

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