diff options
author | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2020-06-11 03:13:43 +0000 |
---|---|---|
committer | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2020-06-11 03:13:43 +0000 |
commit | 387a32af4bff50363c15788cf25f10ed26cfabd3 (patch) | |
tree | 7874a54d1f87fdbb340547777019c59ce20c6f4a /chapter07 | |
parent | bc8cca581fed74c60e201a89acb38cb2344c9b1b (diff) |
Update initial Chapter 7 pages for cross2 branch
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11918 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter07')
-rw-r--r-- | chapter07/changingowner.xml | 5 | ||||
-rw-r--r-- | chapter07/chroot.xml | 19 | ||||
-rw-r--r-- | chapter07/createfiles.xml | 24 | ||||
-rw-r--r-- | chapter07/creatingdirs.xml | 6 | ||||
-rw-r--r-- | chapter07/introduction.xml | 20 | ||||
-rw-r--r-- | chapter07/kernfs.xml | 11 |
6 files changed, 40 insertions, 45 deletions
diff --git a/chapter07/changingowner.xml b/chapter07/changingowner.xml index 43a902821..e376f9f6b 100644 --- a/chapter07/changingowner.xml +++ b/chapter07/changingowner.xml @@ -28,10 +28,7 @@ the files under <filename class="directory">$LFS</filename>, thus exposing these files to possible malicious manipulation.</para> - <para>To avoid this issue, you could add the <systemitem - class="username">lfs</systemitem> user to the new LFS system later when - creating the <filename>/etc/passwd</filename> file, taking care to assign it - the same user and group IDs as on the host system. Better yet, change the + <para>To address this issue, change the ownership of the <filename class="directory">$LFS/*</filename> directories to user <systemitem class="username">root</systemitem> by running the following command:</para> diff --git a/chapter07/chroot.xml b/chapter07/chroot.xml index 5b6310af7..c0cd4fc96 100644 --- a/chapter07/chroot.xml +++ b/chapter07/chroot.xml @@ -10,14 +10,15 @@ <title>Entering the Chroot Environment</title> - <para>Now that all the packages which depend on themselves for being built - are on the system, it is time to enter the chroot environment to finish - installing the remaining temporary tools. This environment will be in use - also for installing the final system. As user <systemitem + <para>Now that all the packages which are required to build the rest of the + needed tools are on the system, it is time to enter the chroot environment to + finish installing the remaining temporary tools. This environment will be in + use also for installing the final system. As user <systemitem class="username">root</systemitem>, run the following command to enter the - realm that is, at the moment, populated with only the temporary tools:</para> + environment that is, at the moment, populated with only the temporary + tools:</para> -<screen role="nodump"><userinput>chroot "$LFS" /usr/bin/env -i \ +<screen role="nodump"><userinput>chroot "$LFS" /usr/bin/env -i \ HOME=/root \ TERM="$TERM" \ PS1='(lfs chroot) \u:\w\$ ' \ @@ -31,18 +32,18 @@ <parameter>TERM=$TERM</parameter> construct will set the <envar>TERM</envar> variable inside chroot to the same value as outside chroot. This variable is needed for programs like <command>vim</command> and <command>less</command> - to operate properly. If other variables are needed, such as + to operate properly. If other variables are desired, such as <envar>CFLAGS</envar> or <envar>CXXFLAGS</envar>, this is a good place to set them again.</para> <para>From this point on, there is no need to use the - <envar>LFS</envar> variable anymore, because all work will be restricted + <envar>LFS</envar> variable anymore because all work will be restricted to the LFS file system. This is because the Bash shell is told that <filename class="directory">$LFS</filename> is now the root (<filename class="directory">/</filename>) directory.</para> <para>Notice that <filename class="directory">/tools/bin</filename> is not - anymore in the <envar>PATH</envar>. This means that a temporary tool will no longer be + in the <envar>PATH</envar>. This means that a temporary tool will no longer be used once its final version is installed. This occurs when the shell does not <quote>remember</quote> the locations of executed binaries—for this reason, hashing is switched off by passing the <parameter>+h</parameter> option diff --git a/chapter07/createfiles.xml b/chapter07/createfiles.xml index aed8d79da..3f5698438 100644 --- a/chapter07/createfiles.xml +++ b/chapter07/createfiles.xml @@ -76,7 +76,7 @@ nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal> EOF</userinput></screen> <para>The actual password for <systemitem class="username">root</systemitem> - (the <quote>x</quote> used here is just a placeholder) will be set later.</para> + will be set later.</para> <para>Create the <filename>/etc/group</filename> file by running the following command:</para> @@ -145,16 +145,16 @@ users:x:999:</literal> EOF</userinput></screen> <para>The created groups are not part of any standard—they are groups - decided on in part by the requirements of the Udev configuration in the next - chapter, and in part by common convention employed by a number of existing - Linux distributions. In addition, some test suites rely on specific users - or groups. The Linux Standard Base (LSB, available at <ulink - url="http://www.linuxbase.org"/>) recommends only that, besides the group - <systemitem class="groupname">root</systemitem> with a Group ID (GID) of 0, - a group <systemitem class="groupname">bin</systemitem> with a GID of 1 be - present. All other group names and GIDs can be chosen freely by the system - administrator since well-written programs do not depend on GID numbers, but - rather use the group's name.</para> + decided on in part by the requirements of the Udev configuration in Chapter + 9, and in part by common convention employed by a number of existing Linux + distributions. In addition, some test suites rely on specific users or + groups. The Linux Standard Base (LSB, available at <ulink + url="http://refspecs.linuxfoundation.org/lsb.shtml"/>) only recommends that, + besides the group <systemitem class="groupname">root</systemitem> with a + Group ID (GID) of 0, a group <systemitem class="groupname">bin</systemitem> + with a GID of 1 be present. All other group names and GIDs can be chosen + freely by the system administrator since well-written programs do not depend + on GID numbers, but rather use the group's name.</para> <para>Some tests in <xref linkend="chapter-building-system"/> need a regular user. We add this user here and delete this account at the end of that @@ -177,7 +177,7 @@ install -o tester -d /home/tester</userinput></screen> directive, <command>bash</command> would remember the paths to binaries it has executed. To ensure the use of the newly compiled binaries as soon as they are installed, the <parameter>+h</parameter> directive will be used for the duration - of this chapter.</para> + of this and the next chapter.</para> <para>The <command>login</command>, <command>agetty</command>, and <command>init</command> programs (and others) use a number of log diff --git a/chapter07/creatingdirs.xml b/chapter07/creatingdirs.xml index 359717ff7..91b43a3a0 100644 --- a/chapter07/creatingdirs.xml +++ b/chapter07/creatingdirs.xml @@ -15,12 +15,12 @@ <screen><userinput>mkdir -pv /{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt} mkdir -pv /{media/{floppy,cdrom},srv,var} -install -dv -m 0750 /root -install -dv -m 1777 /tmp /var/tmp mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src} mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man} -mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo} +mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo} mkdir -pv /usr/{,local/}share/man/man{1..8} +install -dv -m 1777 /tmp /var/tmp +install -dv -m 0750 /root mkdir -v /var/{log,mail,spool} ln -sv /run /var/run diff --git a/chapter07/introduction.xml b/chapter07/introduction.xml index 0445878d5..1d53f6987 100644 --- a/chapter07/introduction.xml +++ b/chapter07/introduction.xml @@ -10,28 +10,24 @@ <title>Introduction</title> - <para>This chapter shows how to build the last missing bits of the - temporary system: first, the tools needed by the build machinery of - various packages, then three packages needed to run tests. - Now that all circular dependencies have been resolved, - we can use a <quote>chroot</quote> environment, completely isolated - from the computer used for the build, except for the running kernel.</para> + <para>This chapter shows how to build the last missing bits of the temporary + system: first, the tools needed by the build machinery of various packages, + then three packages needed to run tests. Now that all circular dependencies + have been resolved, we can use a <quote>chroot</quote> environment, + completely isolated the host operating system used for the build, except + for the running kernel.</para> <para>For proper operation of the isolated environment, some communication with the running kernel must be established. This is done through the so-called <emphasis>Virtual Kernel File Systems</emphasis>, which must be mounted when entering the chroot environment. You may want to check - that they are mounted by issuing <command>ls $LFS/dev</command>, - <command>ls $LFS/proc</command>, or <command>ls $LFS/sys</command>. - Note that mounting the virtual kernel file systems must be done - <emphasis>each time you want to enter the chroot - environment</emphasis>.</para> + that they are mounted by issuing <command>findmnt</command>.</para> <para>Until <xref linkend="ch-tools-chroot"/>, the commands must be run as <systemitem class="username">root</systemitem>, with the <envar>LFS</envar> variable set. After entering chroot, all commands are run as root, fortunately without access to the OS of the computer - you build LFS on. Be careful anyway, as it is easy to destroy the whole + you built LFS on. Be careful anyway, as it is easy to destroy the whole LFS system with badly formed commands.</para> </sect1> diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml index dd6b8991c..6173e63a1 100644 --- a/chapter07/kernfs.xml +++ b/chapter07/kernfs.xml @@ -30,9 +30,10 @@ <para>When the kernel boots the system, it requires the presence of a few device nodes, in particular the <filename class="devicefile">console</filename> and <filename - class="devicefile">null</filename> devices. The device nodes must be created - on the hard disk so that they are available before <command>udevd</command> - has been started, and additionally when Linux is started with + class="devicefile">null</filename> devices. The device nodes must be + created on the hard disk so that they are available before the kernel + populates <systemitem class="filesystem">/dev</systemitem>), and + additionally when Linux is started with <parameter>init=/bin/bash</parameter>. Create the devices by running the following commands:</para> @@ -72,7 +73,7 @@ mknod -m 666 $LFS/dev/null c 1 3</userinput></screen> mount -vt proc proc $LFS/proc mount -vt sysfs sysfs $LFS/sys mount -vt tmpfs tmpfs $LFS/run</userinput></screen> - +<!-- <variablelist> <title>The meaning of the mount options for devpts:</title> @@ -100,7 +101,7 @@ mount -vt tmpfs tmpfs $LFS/run</userinput></screen> </varlistentry> </variablelist> - +--> <para>In some host systems, <filename>/dev/shm</filename> is a symbolic link to <filename class="directory">/run/shm</filename>. The /run tmpfs was mounted above so in this case only a |