aurora@aurora-VirtualBox:~$sudofdisk-l [sudo]password for aurora:
Disk /dev/sda:21.5GB,21474836480bytes 255heads,63sectors/track,2610cylinders,total41943040sectors Units=sectorsof1*512=512bytes Sectorsize(logical/physical):512bytes/512bytes I/Osize(minimum/optimal):512bytes/512bytes Disk identifier:0x000e7c1c
Disk /dev/sdb:21.5GB,21474836480bytes 255heads,63sectors/track,2610cylinders,total41943040sectors Units=sectorsof1*512=512bytes Sectorsize(logical/physical):512bytes/512bytes I/Osize(minimum/optimal):512bytes/512bytes Disk identifier:0x00000000
Disk /dev/sdb:21.5GB,21474836480bytes 255heads,63sectors/track,2610cylinders,total41943040sectors Units=sectorsof1*512=512bytes Sectorsize(logical/physical):512bytes/512bytes I/Osize(minimum/optimal):512bytes/512bytes Disk identifier:0x375750ff
aurora@aurora-VirtualBox:~$ sudo mkfs -v -t ext4 /dev/sdb1 mke2fs 1.42.9 (4-Feb-2014) fs_types for mke2fs.conf resolution: 'ext4' Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 1310720 inodes, 5242624 blocks 262131 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 160 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, 2654208, 4096000
Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done
Chapter 5 isn’t a complete OS. It’s a bootstrap system, so it’s not going to be built the same, nor pass tests normally. As long as the GCC and binutils sanity checks are okay, you’re fine. 忽略此处,一样可以完成编译。没有问题。 编译chapter 5完成后,若磁盘空间足够,则无需剔除相关程序中的调试信息。 备份本章编译工具。chapter 6执行后,可能会更改相关工具。若chapter相关工具编译失败,可重新进行编译。节约时间。
Running target unix FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_HugeMallocTest Ident((char*)malloc(size))[-1] = 0 output pattern test XPASS: g++.dg/tls/thread_local-order2.C -std=c++11 execution test XPASS: g++.dg/tls/thread_local-order2.C -std=c++1y execution test
=== g++ Summary ===
# of expected passes 88500 # of unexpected failures 1 # of unexpected successes 2 # of expected failures 443 # of unsupported tests 3058 /sources/gcc-build/gcc/testsuite/g++/../../xg++ version 4.9.2 (GCC)
=== gcc tests ===
Running target unix
=== gcc Summary ===
# of expected passes 106352 # of expected failures 252 # of unsupported tests 1422 /sources/gcc-build/gcc/xgcc version 4.9.2 (GCC)
=== libatomic tests ===
Running target unix
=== libatomic Summary ===
# of expected passes 54 === libgomp tests ===
Running target unix
=== libgomp Summary ===
# of expected passes 693 === libitm tests ===
Running target unix
=== libitm Summary ===
# of expected passes 26 # of expected failures 3 # of unsupported tests 1 === libstdc++ tests ===
Running target unix
=== libstdc++ Summary ===
# of expected passes 9925 # of expected failures 41 # of unsupported tests 233
lfs官方提示: Five tests are known to fail in the LFS build envronment due to a circular dependency, but all tests pass if rechecked after automake is installed.
If the virtual kernel file systems have been unmounted, either manually or through a reboot, ensure that the virtual kernel file systems are mounted when reentering the chroot. This process was explained in Section 6.2.2, “Mounting and Populating /dev” and Section 6.2.3, “Mounting Virtual Kernel File Systems”.
1 2 3 4 5 6 7 8 9 10 11
mount -v --bind /dev $LFS/dev mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620 mount -vt proc proc $LFS/proc mount -vt sysfs sysfs $LFS/sys mount -vt tmpfs tmpfs $LFS/run chroot "$LFS" /tools/bin/env -i \ HOME=/root \ TERM="$TERM" \ PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ /tools/bin/bash --login +h
进入chapter 7章,离开编译环境(重启,或退出终端),重新进入编译环境,执行以下命令
1 2 3 4 5 6 7 8 9
mount -v --bind /dev $LFS/dev mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620 mount -vt proc proc $LFS/proc mount -vt sysfs sysfs $LFS/sys mount -vt tmpfs tmpfs $LFS/run chroot "$LFS" /usr/bin/env -i \ HOME=/root TERM="$TERM"PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ /bin/bash --login