安装成功时间:
2008-6-27 23:50
心得体会
此次安装比上次熟练多了,而且也仔细多了,所以问题也少了;
但是有一点就是在最后编译内核的时候心太急了,急于将系统搞好,然后就可以正式玩了。
在menuconfig步骤忽略了一个重要的内容,就是没有将虚拟机的buslogic编译进去,导致
最后启动的时候出现kernel panic的错误。
只要重新返回到宿主系统,重新编译内核,将buslogic部分也编译进去。
在重新编译内核的时候也遇到了不少的问题,先总结如下:
由于第一次编译内核没有将buslogic编译进内核,导致lfs
在启动的时候不能启动,错误信息如下:
VFS:Cannot open root device “sda1″ or unknow-block(0,0)
Please append a correct “root=” boot option
kernel panic-not syncing: VFS:Unable to mount root fs on unknow-block(0,0)
于是再次进入liveCD,想重新编译内核,将buslogic编译进去
在make mrproper
make menuconfig后
再make时出现如下错误:
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `set -e; echo ' CHK include/linux/version.h';
mkdir -p include/linux/; if [ `echo -n "2.6.16.27 .file null .ident GCC:(GNU)4.0.3 .
section .note.GNU-stack,,@progbitsy" | wc -c ` -gt 64 ]; then echo '"2.6.16.27 .
file null .ident GCC:(GNU)4.0.3 .section .note.GNU-stack,,@progbitsy" exceeds
64 characters' >&2; exit 1; fi; (echo \#define UTS_RELEASE \"2.6.16.27 .file null .
ident GCC:(GNU)4.0.3 .section .note.GNU-stack,,@progbitsy\"; echo \#define
LINUX_VERSION_CODE `expr 2 \\* 65536 + 6 \\* 256 + 16`; echo '#define
KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; ) <
/sources/linux-2.6.16.27/Makefile > include/linux/version.h.tmp;
if [ -r include/linux/version.h ] && cmp -s include/linux/version.h
include/linux/version.h.tmp; then rm -f include/linux/version.h.tmp;
else echo ' UPD include/linux/version.h'; mv -f include/linux/version.h.tmp include/linux/version.h; fi'
make: *** [include/linux/version.h] Error 2
这个错误在我上次编译内核的时候就出现了,是在搞不懂为什么会出现这样的问题
google了下,说是其实version.h是在make menuconfig后生成的,但是我也执行了
menuconfig了啊,怎么就不能生成呢?
google找了好半天,所有中文网站都是只有提问题的,而没有解决问题的。
最后还是找英文网站,最后总算让我找到一线曙光,有人对于这个错误有如下解释:
You are hit be an outstanding issue with -rc1 + rc2.
When you build as root you will alter /dev/null and in your case it
became a regular file.
Recreate /dev/null and build as normal user for now.
You can apply patch below to fix it - will be in next -rc.
大意是当第一次build内核的时候,会将/dev/null文件修改为普通的问题(原来是设备文件)
用ls -lrt /dev/null查看一下,可以看到正常的/dev/null的文件类型:
crw-rw-rw- 1 root root 1, 3 2008-06-28 01:00 /dev/null
在内核编译后,会变成:
-rw-rw-rw- 1 root root 1, 3 2008-06-28 01:00 /dev/null
注意上述两行的第一个字符,由原来的c字符变成-字符,也就是有设备文件变成了普通文件
只要重新建一下这个节点即可:
mknod -m 666 /dev/null c 1 3
然后再:
make
make modules_install
cp -v arch/i386/boot/bzImage /boot/lfskernel-2.6.11.12
cp -v System.map /boot/System.map-2.6.11.12
cp -v .config /boot/config-2.6.11.12
需要加载临时文件系统到/dev目录下,并建立目标系统所必须的设备文件
代码:
mount -nvt tmpfs none /dev
mknod -m 622 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3
mknod -m 666 /dev/zero c 1 5
mknod -m 666 /dev/ptmx c 5 2
mknod -m 666 /dev/tty c 5 0
mknod -m 444 /dev/random c 1 8
mknod -m 444 /dev/urandom c 1 9
chown -v root:tty /dev/{console,ptmx,tty}
最后有一点不完美的地方就是直接用该虚拟机起不来,我新建了个虚拟机,新建虚拟机的硬盘类型
我选为buslogic了。然后通过挂载原虚拟机的虚拟磁盘来实现磁盘类型的转换,启动,OK,进入登入界面。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12932950/viewspace-366171/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/12932950/viewspace-366171/