LFS(2)

参考 Linux From Scratch - 版本 6.1.1 文档 http://man.chinaunix.net/linux/lfs/LFS-6.1.1/index.html

2.3. 在分区上创建文件系统
如果直接用mke2fs -v /dev/sdb1格式化新建分区,则提示:
mke2fs 1.41.11 (14-Mar-2010)
fs_types for mke2fs.conf resolution: 'ext2', 'default'
Calling BLKDISCARD from 0 to 8587157504 failed.
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
524288 inodes, 2096474 blocks
104823 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

正在写入inode表: 完成                            
Writing superblocks and filesystem accounting information: 完成

This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

其中有个错误提示。
按照文档说明,执行debugfs -R feature /dev/sdb1,结果多出ext_attr属性,
下载e2fsprogs-1.37.tar.bz2,在执行make时提示:
CC ../../../lib/ext2fs/ismounted.c
../../../lib/ext2fs/ismounted.c: In function ‘is_swap_device’:
../../../lib/ext2fs/ismounted.c:254: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
In file included from /usr/include/fcntl.h:205,
                 from ../../../lib/ext2fs/ismounted.c:19:
In function ‘open’,
    inlined from ‘check_mntent_file’ at ../../../lib/ext2fs/ismounted.c:150:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument   needs 3 arguments
make[2]: *** [ismounted.o] 错误 1
make[2]:正在离开目录 `/tmp/e2fsprogs-1.37/build/lib/ext2fs'
make[1]: *** [all-libs-recursive] 错误 1
make[1]:正在离开目录 `/tmp/e2fsprogs-1.37/build'
make: *** [all] 错误 2

查看open函数,发现存在两种接口,一种2个参数,一种3个参数,在linux2.2内核版本后,需要第三个参数,来说明新创建的文件的所有者权限。编辑/ismounted.c文件150行,添加第三个参数S_IRWXU后重新make通过。执行./misc/mke2fs -v /dev/sdb1时提示:
mke2fs 1.37 (21-Mar-2005)
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
1048576 inodes, 2096474 blocks
104823 blocks (5.00%) reserved for the super user
第一个数据块=0
64 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

正在写入inode表: 完成                            
Writing superblocks and filesystem accounting information: 完成

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
无任何错误信息完成。

5.3. Binutils-2.15.94.0.2.2 - 第一遍
install-info: /tools/info/ld.info: empty file
make[2]: Leaving directory `/mnt/lfs/sources/binutils-build/ld'
make[1]: Leaving directory `/mnt/lfs/sources/binutils-build/ld'
make[1]: Entering directory `/mnt/lfs/sources/binutils-build/libiberty'
make[2]: Entering directory `/mnt/lfs/sources/binutils-build/libiberty/testsuite'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/mnt/lfs/sources/binutils-build/libiberty/testsuite'
/bin/sh ../../binutils-2.15.94.0.2.2/libiberty/../mkinstalldirs /tools/lib
/usr/bin/install -c -m 644 ./libiberty.a /tools/lib/./libiberty.an
( cd /tools/lib ;   ranlib ./libiberty.an  )
***   buffer overflow detected  ***: ranlib terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x50)[0x4011b2d0]
/lib/tls/i686/cmov/libc.so.6(+0xe120a)[0x4011a20a]
/lib/tls/i686/cmov/libc.so.6(+0xe0948)[0x40119948]
/lib/tls/i686/cmov/libc.so.6(_IO_default_xsputn+0x9e)[0x400a26ce]
/lib/tls/i686/cmov/libc.so.6(_IO_padn+0xd8)[0x400961c8]
/lib/tls/i686/cmov/libc.so.6(_IO_vfprintf+0x2b61)[0x40078771]
/lib/tls/i686/cmov/libc.so.6(__vsprintf_chk+0xad)[0x401199fd]
/lib/tls/i686/cmov/libc.so.6(__sprintf_chk+0x2d)[0x4011993d]
ranlib[0x8050dc5]
ranlib[0x804ef2e]
ranlib[0x8051838]
ranlib[0x80589d0]
ranlib[0x804a1a2]
ranlib[0x804a677]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x4004fbd6]
ranlib[0x8049671]
======= Memory map: ========
08048000-080b3000 r-xp 00000000 08:11 592327     /mnt/lfs/tools/bin/ranlib
080b3000-080b4000 r--p 0006a000 08:11 592327     /mnt/lfs/tools/bin/ranlib
080b4000-080b5000 rw-p 0006b000 08:11 592327     /mnt/lfs/tools/bin/ranlib
080b5000-080b9000 rw-p 00000000 00:00 0 
080c4000-08218000 rw-p 00000000 00:00 0          [heap]
40000000-4001b000 r-xp 00000000 08:01 791182     /lib/ld-2.11.1.so
4001b000-4001c000 r--p 0001a000 08:01 791182     /lib/ld-2.11.1.so
4001c000-4001d000 rw-p 0001b000 08:01 791182     /lib/ld-2.11.1.so
4001d000-4001e000 r-xp 00000000 00:00 0          [vdso]
4001e000-40022000 rw-p 00000000 00:00 0 
40035000-40037000 r-xp 00000000 08:01 791200     /lib/tls/i686/cmov/libdl-2.11.1.so
40037000-40038000 r--p 00001000 08:01 791200     /lib/tls/i686/cmov/libdl-2.11.1.so
40038000-40039000 rw-p 00002000 08:01 791200     /lib/tls/i686/cmov/libdl-2.11.1.so
40039000-4018c000 r-xp 00000000 08:01 791206     /lib/tls/i686/cmov/libc-2.11.1.so
4018c000-4018e000 r--p 00153000 08:01 791206     /lib/tls/i686/cmov/libc-2.11.1.so
4018e000-4018f000 rw-p 00155000 08:01 791206     /lib/tls/i686/cmov/libc-2.11.1.so
4018f000-40194000 rw-p 00000000 00:00 0 
401a9000-401c6000 r-xp 00000000 08:01 786609     /lib/libgcc_s.so.1
401c6000-401c7000 r--p 0001c000 08:01 786609     /lib/libgcc_s.so.1
401c7000-401c8000 rw-p 0001d000 08:01 786609     /lib/libgcc_s.so.1
bf92f000-bf944000 rw-p 00000000 00:00 0          [stack]
Aborted
make[1]: *** [install_to_libdir] Error 134
make[1]: Leaving directory `/mnt/lfs/sources/binutils-build/libiberty'
make: *** [install-libiberty] Error 2

SBU值:
real 3m13.078s
user 2m14.600s
sys 1m34.498s

安装时出错,后续执行make -C ld LIB_PATH=/tools/lib也出错,网上显示是LFS版本太旧,与宿主系统中的工具不兼容导致。我的是ubuntu10.04。
高人看到,请帮忙解答!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值