- Timestamp:
- 03/17/2022 02:30:05 PM (2 years ago)
- Branches:
- multilib
- Children:
- 85acfcb0
- Parents:
- d9bec1e (diff), 43149b9 (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. - Location:
- chapter07
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/createfiles.xml
rd9bec1e r02c702c 37 37 <para>Historically, Linux maintains a list of the mounted file systems in the 38 38 file <filename>/etc/mtab</filename>. Modern kernels maintain this list 39 internally and expose sit to the user via the <filename39 internally and expose it to the user via the <filename 40 40 class="directory">/proc</filename> filesystem. To satisfy utilities that 41 41 expect the presence of <filename>/etc/mtab</filename>, create the following -
chapter07/kernfs.xml
rd9bec1e r02c702c 25 25 <screen><userinput>mkdir -pv $LFS/{dev,proc,sys,run}</userinput></screen> 26 26 27 <sect2>28 <title>Creating Initial Device Nodes</title>29 30 <para>When the kernel boots the system, it requires the presence of a few31 device nodes, in particular the <filename32 class="devicefile">console</filename> and <filename33 class="devicefile">null</filename> devices. The device nodes must be34 created on the hard disk so that they are available before the kernel35 populates <systemitem class="filesystem">/dev</systemitem>), and36 additionally when Linux is started with37 <parameter>init=/bin/bash</parameter>. Create the devices by running the38 following commands:</para>39 40 <screen><userinput>mknod -m 600 $LFS/dev/console c 5 141 mknod -m 666 $LFS/dev/null c 1 3</userinput></screen>42 43 </sect2>44 45 27 <sect2 id="ch-tools-bindmount"> 46 28 <title>Mounting and Populating /dev</title> 47 29 48 <para> The recommended method of populating the <filename49 class="directory">/dev</filename> directory with devices is to mount a50 virtual filesystem (such as <systemitem51 class="filesystem">tmpfs</systemitem>) on the <filename52 class="directory">/dev</filename> directory, and allow the devices to be53 created dynamically on that virtual filesystem as they are detected or54 accessed. Device creation is generally done during the boot process55 by Udev. Since this new system does not yet have Udev and has not yet56 been booted, it is necessary to mount and populate <filename57 class="directory">/dev</filename> manually. This is accomplished by bind58 mounting the host system's <filename class="directory">/dev</filename>59 directory. A bind mount is a special type of mount that allows you to60 create a mirror of a directory or mount point to some other location. Use61 the followingcommand to achieve this:</para>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 40 <filename class="directory">/dev</filename> directory. A bind mount is 41 a special type of mount that allows you to create a mirror of a 42 directory or mount point to some other location. Use the following 43 command to achieve this:</para> 62 44 63 45 <screen><userinput>mount -v --bind /dev $LFS/dev</userinput></screen>
Note:
See TracChangeset
for help on using the changeset viewer.