Changeset 0058818


Ignore:
Timestamp:
10/01/2022 07:14:22 AM (19 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, bdubbs/gcc13, multilib, renodr/libudev-from-systemd, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
2bf32ff
Parents:
a8f3814a
Message:

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.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • chapter07/kernfs.xml

    ra8f3814a r0058818  
    3030    <title>Mounting and Populating /dev</title>
    3131
    32       <para>During a normal boot, the kernel automatically mounts the
    33       <systemitem class="filesystem">devtmpfs</systemitem> filesystem on the
    34       <filename class="directory">/dev</filename> directory; the
    35       devices are created dynamically on that virtual filesystem when they
    36       are first detected or accessed. Device creation is generally done during the
    37       boot process by the kernel and the udev program.
    38       Since the new system does not yet include udev and
    39       has not yet been booted, it is necessary to mount and populate
    40       the <filename class="directory">/dev</filename> directory manually. This is
    41       accomplished by bind mounting the host system's
     32      <para>During a normal boot of the LFS system, the kernel automatically
     33      mounts the <systemitem class="filesystem">devtmpfs</systemitem>
     34      filesystem on the
     35      <filename class="directory">/dev</filename> directory; the kernel
     36      creates device on that virtual filesystem during the boot process
     37      or when a device is first detected or accessed. The udev daemon may
     38      change the owner or permission of the device nodes created by the
     39      kernel, or create new device nodes or symlinks to ease the work of
     40      distro maintainers or system administrators.  (See
     41      <xref linkend='ch-config-udev-device-node-creation'/> for details.)
     42      If the host kernel supports &devtmpfs;, we can simply mount a
     43      &devtmpfs; at <filename class='directory'>$LFS/dev</filename> and rely
     44      on the kernel to populate it (the LFS building process does not need
     45      the additional work onto &devtmpfs; by udev daemon).</para>
     46
     47      <para>But, some host kernels may lack &devtmpfs; support and these
     48      host distros maintain the content of
     49      <filename class="directory">/dev</filename> with different methods.
     50      So the only host-agnostic way for populating
     51      <filename class="directory">$LFS/dev</filename> is
     52      bind mounting the host system's
    4253      <filename class="directory">/dev</filename> directory. A bind mount is
    4354      a special type of mount that allows you to create a mirror of a
  • chapter09/udev.xml

    ra8f3814a r0058818  
    9494    </sect3>
    9595
    96     <sect3>
     96    <sect3 id='ch-config-udev-device-node-creation'>
    9797      <title>Device Node Creation</title>
    9898
  • general.ent

    ra8f3814a r0058818  
    122122<!ENTITY root            "<systemitem class='username'>root</systemitem>">
    123123<!ENTITY lfs-user        "<systemitem class='username'>lfs</systemitem>">
     124<!ENTITY devtmpfs        "<systemitem class='filesystem'>devtmpfs</systemitem>">
    124125<!ENTITY fstab           "<filename>/etc/fstab</filename>">
    125126<!ENTITY boot-dir        "<filename class='directory'>/boot</filename>">
Note: See TracChangeset for help on using the changeset viewer.