说下编译环境:VM+RHEL5.1 这个内核算是版本比较高的,把下载下来的内核压缩文件解压,解压后的文件夹linux 2.6.32.2复制到 /usr/src下 make mrproper #清除上次编译后遗留的文件,如果是第一次编译可以不用 make menuconfig #SATA SCSI filesystem ext2 ext3等都要编译进内核 在当前目录下生成了.config文件 make all #高版本的内核,这个命令相当于make dep(建立相依的属性关系),make clean(将旧的资料去除掉),make bzImage(开始编译核心),make modules(开始编译模块) make modules_install #安装模块。安装模块到/lib/modules/,以后程序运行时从这个目录加载模块。 make install #把make all 生成的vmlinuz和System.map复制到/boot目录下同时修改grub /boot/grub/menu.lst. 修改menu.lst是自动完成的哦!!文件复制、grub修改都不用手动。 很多人做完后,发现编译没有问题,新内核2.6.32.2启动不起来 错误如下图
1、驱动、文件系统没有编译进去 2、编辑内核源码包里面的.config文件. CONFIG_SYSFS_DEPRECATED_V2=y #默认该选项为not set,被注释掉的 3、arm linux 编译 #make menuconfig General setup ---> Loadable module support ---> Block layer ---> Processor type and features ---> Power management options (ACPI, APM) ---> Bus options (PCI, PCMCIA, EISA, MCA, ISA) ---> Executable file formats ---> Networking ---> Device Drivers ---> File systems ---> Instrumentation Support --->
而 #make ARCH=arm menuconfig Code maturity level options ---> General setup ---> Loadable module support ---> Block layer ---> System Type ---> Bus support ---> Kernel Features ---> Boot options ---> Floating point emulation ---> Userspace binary formats ---> Power management options ---> Networking ---> Device Drivers --->
我出现错误的解决的方法是第二种,网上现在很多资料解释这块,据说是个BUG,LINUX大牛们指点指点了 再转一个类似这样的的文章,仅供参考 环境介绍:Centos5.2+2.6.18-8.el5内核,编译器是GCC4.1.2。 hub 3-0:1.0: USB hub found 解决方法: The suspend signature on swap error, "Trying to resume from LABEL=SWAP-hdd3. No suspend signature on swap, not resuming", can be ignored. It gives this error because when the volumes are activated (look at the output previous to this error), it resumes the swap partition in that step. Therefore, it's trying to resume something that isn't suspended. The error that causes all the trouble is "mount: could not find filesystem '/dev/root'". Appartently, in the init script within initrd-2.6.15-1.2054_FC5.img, the command 'mount /sysroot' is trying to mount /dev/root to /sysroot. Fedora 5 does not use /dev/root like in the previous versions of Fedora. Instead, it uses '/dev/VolGroup00/LogVol00' or '/dev/hda1' (or whereever '/' is located) to mount to /sysroot. For some reason, when init calls 'mount /sysroot', it's trying to mount /dev/root to /sysroot, instead of /dev/VolGroup00/LogVol00 to /sysroot. This messes up everything after this step in the init process. When it does a switchroot at the end, it fails. After killing init, it causes the kernel panic. Here's the fix: 1) Boot with the rescue CD * Steps 4-6,12,13,15 were taken from another site, but I couldn't post the URL. I'll try in my next post. This should fix it. I'm glad I can finally run Fedora 5 on my box. MarkCole, I'm not sure if you were experiencing the exact same problems I was with mounting root. However, I hope this helps anyone else experiencing the same problems I had. Andy |
2.6.32.2新内核编译 mounting root filesystem. mount missing mount point error mounting /sys:
.6.32.2新内核编译
2010-01-21 12:17