lfs/chapter07/introduction.xml
Xi Ruoyao a8f3814a7b
kernfs: technically, they are not needed for chroot
Chroot command itself does not require kernel VFS mounted. You can mount
/proc, /sys, and /run after entering chroot with
"mount -v -t proc proc /proc" etc.  For /dev, if the host kernel
supports devtmpfs, you can also mount /dev in chroot with
"mount -v -t devtmpfs devtmpfs /dev".  Even if the host does not support
devtmpfs, it's still possible to mount /proc in chroot, then use
"mount --bind /proc/1/dev /dev".

It's just LFS editors decide to mount them before chroot.  So reword
some untrue assertions.
2022-10-01 13:35:59 +08:00

33 lines
1.5 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-introduction-chroot">
<?dbhtml filename="introduction.html"?>
<title>Introduction</title>
<para>This chapter shows how to build the last missing bits of the temporary
system: the tools needed to build the various packages. Now
that all circular dependencies have been resolved, a <quote>chroot</quote>
environment, completely isolated from the host operating system (except for
the running kernel), can be used for the build.</para>
<para>For proper operation of the isolated environment, some communication
with the running kernel must be established. This is done via the
so-called <emphasis>Virtual Kernel File Systems</emphasis>, which will be
mounted before entering the chroot environment. You may want to verify
that they are mounted by issuing the <command>findmnt</command> 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 built LFS on. Be careful anyway, as it is easy to destroy the whole
LFS system with bad commands.</para>
</sect1>