LFS 学习日记(第六章安装基本系统软件之简介、准备虚拟内核文件系统 )

2010年07月07日 星期三
http://www.linuxfromscratch.org/lfs/view/6.6/chapter06/introduction.html
6.1. Introduction

1、学习LFS的关键是知道每个包是做什么用的和为什么需要这个包。

2、不推荐使用优化编译参数。

3、严格按照书中编译包的顺序进行编译。

4、不要并行编译,即不使用 MAKEFLAGS=‘-j N'(N大于或等于2)的并行编译参数。( question: 但这与 http://www.linuxfromscratch.org/lfs/view/6.6/chapter04/aboutsbus.html 介绍的并行编译时的态度不同,第四章并没有提及不要使用并行编译,只说使用并行编译对SBU 的影响和对调试的负面影响,这是不是说,第五章可以但是第六章不能使用并行编译?)
答:这是误解了文中的意思,第六章的“compile packages in parallel”是“同时编译多个软件包”的意思,即“不要同时编译多个软件包”,而不是第四章讲的"parallel make"(并行编译)。但是英语的这种说法确实可能误导人,个人觉得有必要完善一下措辞。如下:
bug: The order that packages are installed in this chapter needs to be strictly followed to ensure that no program accidentally acquires a path referring to /tools hard-wired into it. A program containing a hard-wired path to /tools will cause the program to stop working when that directory is removed. So, you must start compile a package after its previous package has been built over in order.
另,在lfs-support@linuxfromscratch.org 上发邮件请教了这个问题:
need an accurate answer: can we build LFS with parallel compiling?
http://linuxfromscratch.org/pipermail/lfs-support/2010-July/039200.html

2004年写的一个关于并行编译 LFS 的提示:
How to build LFS using multiple compiler instances.
http://www.linuxfromscratch.org/hints/downloads/files/parallelcompiling.txt

question: 但是,问题是,到底应不应该在LFS中使用并行编译?
答:可以使用并行编译。可以显著缩短编译时间。

question: 为什么不按顺序编译软件包或同时编译多个软件包有可能造成程序包含 /tools 硬连接路径?

翻译:For the same reason, do not compile packages in parallel. Compiling in parallel may save time (especially on dual-CPU machines),(同样的原因,不要同时编译多个软件包。多个软件包同时编译可能节约时间(尤其是在双CPU机器上),)注:因为与“4.5. About SBUs”中的“parallel make"有可能混淆,所以加了“多个软件包”几个字,以示区别。

http://www.linuxfromscratch.org/lfs/view/6.6/chapter06/kernfs.html
6.2. Preparing Virtual Kernel File Systems

http://www.linuxfromscratch.org/lfs/view/6.6/chapter05/changingowner.html 说必须在root的环境变量里设好LFS=/mnt/lfs,Ubuntu 里是sudo -s 改成 root 的,我发现在具有 sudo 权限的普通用户的 .bashrc 中加入 export LFS=/mnt/lfs 可以让sudo -s 成为root后保持$LFS 的环境变量。

todo: sudo 相关的环境变量的问题

mknod 中 设备号 MAJOR MINOR 的确定: http://www.linuxfromscratch.org/pipermail/lfs-support/2005-December/029268.html mknod major and minor numbers
在 kernel 源码的如: linux-2.6.32.15/Documentation/devices.txt 中。

tar 只解压指定文件用法:( http://blog.chinaunix.net/u2/60832/showart_617325.html )
 tar -xvf linux*.bz2 linux-2.6.32.15/Documentation/devices.txt

question: 怎么确定设备文件的读写权限?如本节的 mknod -m 600 $LFS/dev/console c 5 1 和 mknod -m 666 $LFS/dev/null c 1 3 分别把权限设为 600 和 666 的依据是什么?

question: 如 "mount -vt devpts devpts $LFS/dev/pts" 中的被挂载的设备 devpts 是从哪里来的?如磁盘设备为 /dev/sda1 这个挂载点可在 /dev/目录下。

One thought on “LFS 学习日记(第六章安装基本系统软件之简介、准备虚拟内核文件系统 )”

  1. 您好, 不好意思打扰了, 我找到5.32的资讯了, 所以应该是以root进行第六章之后的building, 谢谢您~

Comments are closed.