Changeset c093e6b for chapter07/kernfs.xml
- Timestamp:
- 10/01/2022 10:30:12 PM (2 years ago)
- Branches:
- multilib, xry111/multilib
- Children:
- f3b2f16
- Parents:
- f29824e (diff), 4349661 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/kernfs.xml
rf29824e rc093e6b 15 15 </indexterm> 16 16 17 <para>Various file systems exported by the kernel are used to communicate to 18 and from the kernel itself. These file systems are virtual in that no disk 17 <para>Applications running in user space utilize various file 18 systems exported by the kernel to communicate 19 with the kernel itself. These file systems are virtual: no disk 19 20 space is used for them. The content of the file systems resides in 20 memory.</para> 21 memory. These file systems must be mounted in the $LFS directory tree 22 so the applications can find them in the chroot environment.</para> 21 23 22 <para>Begin by creating directories on towhich the file systems will be24 <para>Begin by creating directories on which the file systems will be 23 25 mounted:</para> 24 26 … … 28 30 <title>Mounting and Populating /dev</title> 29 31 30 <para>During a normal boot, the kernel automatically mounts the 31 <systemitem class="filesystem">devtmpfs</systemitem> filesystem on the 32 <filename class="directory">/dev</filename> directory, and allow the 33 devices to be created dynamically on that virtual filesystem as they 34 are detected or accessed. Device creation is generally done during the 35 boot process by the kernel and Udev. 36 Since this new system does not yet have Udev and 37 has not yet been booted, it is necessary to mount and populate 38 <filename class="directory">/dev</filename> manually. This is 39 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 nodes 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 40 53 <filename class="directory">/dev</filename> directory. A bind mount is 41 54 a special type of mount that allows you to create a mirror of a 42 directory or mount point tosome other location. Use the following43 command to achievethis:</para>55 directory or mount point at some other location. Use the following 56 command to do this:</para> 44 57 45 58 <screen><userinput>mount -v --bind /dev $LFS/dev</userinput></screen> … … 90 103 directory needs to be created.</para> 91 104 105 <para>In other host systems <filename>/dev/shm</filename> is a mount point 106 for a tmpfs. In that case the mount of /dev above will only create 107 /dev/shm as a directory in the chroot environment. In this situation 108 we must explicitly mount a tmpfs:</para> 109 92 110 <screen><userinput>if [ -h $LFS/dev/shm ]; then 93 111 mkdir -pv $LFS/$(readlink $LFS/dev/shm) 112 else 113 mount -t tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm 94 114 fi</userinput></screen> 95 115
Note:
See TracChangeset
for help on using the changeset viewer.