Commit Graph

18 Commits

Author SHA1 Message Date
Pierre Labastie
7152faa5fa Change all xml files to utf-8 encoding 2024-01-18 20:53:23 +01:00
Xi Ruoyao
01247ac90a
kernfs: Revise command creating the link target in case /dev/shm is a symlink
When /dev/shm is a symlink we need to create its target or some tests
will fail and Python 3 will be misconfigured.  We wrote it as:

    mkdir -pv $LFS/$(readlink $LFS/dev/shm)

But if $LFS/dev/shm is a relative symlink (say ../run/shm), we end up:

    mkdir -pv /mnt/lfs/../run/shm

This command will create /mnt/run/shm, not $LFS/mnt/shm as we expected.
Twist it a little to make it work for both absolute symlinks and
relative symlinks.
2023-11-20 07:23:36 +08:00
Pierre Labastie
e0a942748e Make /dev/shm mount and umount verbose
Almost all commands in lfs are verbose. Don't know why these ones
were not.
2023-09-12 19:02:18 +02:00
David Bryant
7ae2811988 Standardize spelling of "userspace". 2022-12-24 10:00:23 -06:00
Xi Ruoyao
940769457b
kernfs: reword the description of bind mount
"Duplicated copy" is wrong IMO.  If you copy A to B, B won't be changed
when you modify A.  But if you bind mount A to B, B will reflect any
change made to A.

Again copy something from mount(2):

    A bind mount makes a file or a directory subtree visible at another
    point within the single directory hierarchy.
2022-11-18 13:13:37 +08:00
Xi Ruoyao
2f9498afa4
kernfs: remove a false note
Things are a little tricky:

1. If the host is "modern" (any desktop distro after 2013), the kernel
   supports devtmpfs and the host udev will do adjustments to the
   devtmpfs.  All instances of devtmpfs shares the same content so we'll
   see the work of both the kernel and the host udev in chroot.
2. If the host is old but the kernel supports devtmpfs (i. e. the host
   is not using devtmpfs for its /dev), when we mount devtmpfs on
   $LFS/dev we'll see the work of the kernel in chroot, but not the work
   of udev.  **Building LFS does not need any work of udev.**
3. If the host is very old and the kernel does not support devtmpfs at
   all, we can't mount devtmpfs.

Mounting a devtmpfs will work for 1 and 2, while bind mounting will work
for 1, 2, and 3.  So we use bind mounting here.

I don't want to squash all these details into the book, so just remove
the false statement here.
2022-11-18 12:52:09 +08:00
David Bryant
ebecd08c05 Corrected grammar, spelling, and idiom in chapter 7. 2022-11-16 13:16:35 -06:00
Xi Ruoyao
2bf32ffa3a
kernfs: "device nodes" are in /dev, not "devices"
You cannot throw a NVIDIA GTX 690 into /dev :).
2022-10-01 15:27:19 +08:00
Xi Ruoyao
00588180ee
kernfs: modernize the explanation for bind mounting /dev
If you are using a "modern" distro (with devtmpfs and a modern udev
implementation), a bind mounting is actually not needed because you can
mount devtmpfs anyway.  The only reason for bind mounting is to be
compatible with old host distros where /dev is a directory containing
many static device nodes, or is a tmpfs (not same as devtmpfs) popluated
by bootscript or an old udev (modern udev implementations, including
eudev and systemd-udev used by LFS, strictly requires a devtmpfs on
/dev).

So update the explanation to match the status quo.
2022-10-01 15:14:22 +08:00
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
David Bryant
29526d35ef Made grammatical corrections and stylistic changes to chapter 7.3.
Added clarification; the virtual file systems expose certain information
to programs in user space; chroot won't work without them.
2022-09-30 12:27:55 -05:00
Bruce Dubbs
16cd09633e Adjust instructions for /dev/shm when creating virtual filesystems.
Some host create /dev/shm as a tmpfs.  Some have is as
a symlink to a location in another directory.  This
change handles both cases.

The change to the sysV bootscripts now creates /dev/shm
as a separate tmpfs from /run.  This makes LFS sysV and
systemd versions treat /dev/shm the same.
2022-09-20 12:20:58 -05:00
Xi Ruoyao
ac47b252fe
kernfs: "Udev" -> "the kernel and Udev"
devtmpfs already contains many device nodes created by the kernel once
it's mounted, and Udev creates or renames nodes based on kernel work.
2022-03-08 15:10:04 +08:00
Xi Ruoyao
940c8495ae
kernfs: remove static node creation, and update the text
This is to match the "new" way of device handling with devtmpfs (already
widely used in recent ten years).

In a normal booting process, the kernel mounts devtmpfs at very early
stage.  So the static nodes won't be used at all.  The only situation
where the kernel can't mount devtmpfs is "/dev is missing", but it means
those two static nodes can't exist anyway, and a normal LFS system
(without initramfs) won't boot in such a bad situation.

Removing static /dev/console and /dev/null may cause trouble for those
people or scripts chroot into LFS tree without mounting devtmpfs.  But
entering a chroot with only console and null in /dev is already
problematic.  For a reference, If a systemd service is started with
PrivateDevices=true, systemd will create 18 nodes and symlinks to form a
"minimal" /dev.
2022-03-08 01:25:06 +08:00
Pierre Labastie
2c8fdfc165 Remove spaces at end o lines - chapter07 2021-09-07 22:35:55 +02:00
Pierre Labastie
bfab1b2d25 remove last ch-system-xxx id's in chapter 7
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11980 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
2020-06-22 20:51:45 +00:00
Bruce Dubbs
387a32af4b Update initial Chapter 7 pages for cross2 branch
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11918 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
2020-06-11 03:13:43 +00:00
Bruce Dubbs
fcc027677d Initial commit of alternative cross LFS
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11897 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
2020-06-07 20:16:00 +00:00