VM:
Linux: Ubuntu11.10
LFS version 6.8(2011-10-10)
1. 5.7. Glibc-2.14
when i execute 'make' will output this : ...make[1]: *** No rule to make target `/mnt/lfs/sources/glibc-build/Versions.all', needed by `/mnt/lfs/sources/glibc-build/abi-versions.h'. Stop.
Anyc:ubuntu11.10's /usr/bin/awk use /usr/bin/gawk by default, otherise use /usr/bin/mawk, and mawk can't understand any characters which is '/' cause that
"/\/[^/]+$/"
Resolve:exit user lfs(because lfs have no permission install), sudo apt-get install gawk and re-configure and re-compile
Note:
It is a known issue that
mawk
does not understand unescaped '/' in character classes at least up to version 1.3.3-15 (the one supplied on Ubuntu 11.04 (Natty)).mawk
will think the/
inside the bracket terminates the regex, and interpret as\/[^
, which is surely a syntax error due to unmatched]
.The fix for glibc is trivial: just add a
\
before the/
. But this may also be a dedicate "check"to ensuregawk
is used. At least this is still not changed on glibc-2.14…
2. 5.16. Bash-4.2
when I execute "make" will appear 'make: yacc: Command not found
make: *** [y.tab.c] Error 127"'
Resolve: sudo apt-get install bison.
8.3. Linux-2.6.37
Problem:
md: If you don't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: Scanned 0 and added 0 devices.
md: autorun ...
Root-NFS: no NFS server address
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "sdb1" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions"
0b00 1048575 sr0 driver:sr
Kernel panic - not syncing: VFS: Unable to mount root fs on unknow-block(2,0)
Pid: 1, comm: swapper Not tainted 2.6.37 #1
Call Trace:
[*]? printk+0xf/0x11
[*]panic+0x50/0x146
[*]mount_block_root+0x15b/0x16a
[*]?sys_mknod+0x13/0x15
Any: not build rootfs in partition to linux kernel
这是由于没有把rootfs所在的磁盘驱动编译进内核的原因,我的平台是 VMware6.5,对应的磁盘是SCSI类型设备中的LSI Logic设备,在配置内核时需要将如下内容选中,注意这里不能编译为模块:
Linux Kernel Configuration--->
Device Drivers --->
<*> SCSI device support
Device Drivers --->
[*] Fusion MPT device support --->
Fusion这个箭头里面的选项有5项,具体哪个需要哪个不需要我也不太清楚,除了logging那项我都勾上了。
对于不同平台,可以通过lspci查看pci设备的名称从而选择不同驱动。
LFS备份的方法
LFS book中没有讲到备份方法,我曾经试图以简单的tar和cp来备份,都不太对,tar中途会提示出错,而cp会提示没有权限,总的原因是/dev下设备节点和/proc及/sys文件系统不能简单的拷贝和打包。LFS网站上有一个比较完备的备份方法http://www.linuxfromscratch.org/hints/downloads/files/backing-up-lfs.txt,我这里是搜索lfs-supportmailing list(在LFS主页右上角搜索即可)得到的一个简单方法:
tar -C $LFS --one-file-system -cjvpf lfs-backup.tar.bz2 .
其中,
-C指切换目录至¥LFS,这样创建出来的压缩包根目录是 . ,而不是/mnt/lfs
--one-file-sysem 忽略不在本文件系统上的目录,这样/proc,/sys,/dev中的文件不会被拷贝,以后恢复得时候需要重复LFS book chap6.2来新建设备节点
You have successfully registered!
ID: 22920
Name: jinwei
First LFS Version: 6.8