[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[673b0d8] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[8ef8304] | 7 |
|
---|
[6dfcfecc] | 8 | <sect1 id="ch-tools-creatingdirs">
|
---|
[8ef8304] | 9 | <?dbhtml filename="creatingdirs.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Creating Directories</title>
|
---|
| 12 |
|
---|
[032dc4e8] | 13 | <para>It is time to create the full structure in the LFS file system.</para>
|
---|
[673b0d8] | 14 |
|
---|
[9b73f94] | 15 | <note><para>Some of the directories mentioned in this section may be
|
---|
| 16 | already created earlier with explicit instructions or when installing some
|
---|
| 17 | packages. They are repeated below for completeness.</para></note>
|
---|
| 18 |
|
---|
[032dc4e8] | 19 | <para>Create some root-level directories that are not in the limited set
|
---|
| 20 | required in the previous chapters by issuing the following command:</para>
|
---|
| 21 |
|
---|
| 22 | <screen><userinput>mkdir -pv /{boot,home,mnt,opt,srv}</userinput></screen>
|
---|
| 23 |
|
---|
| 24 | <para>Create the required set of subdirectories below the root-level by
|
---|
| 25 | issuing the following commands:</para>
|
---|
| 26 |
|
---|
| 27 | <screen><userinput>mkdir -pv /etc/{opt,sysconfig}
|
---|
| 28 | mkdir -pv /lib/firmware
|
---|
| 29 | mkdir -pv /media/{floppy,cdrom}
|
---|
[d7a9421] | 30 | mkdir -pv /usr/{,local/}{include,src}
|
---|
| 31 | mkdir -pv /usr/local/{bin,lib,sbin}
|
---|
[d02c56d] | 32 | mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
|
---|
[6dfcfecc] | 33 | mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo}
|
---|
[83b720b] | 34 | mkdir -pv /usr/{,local/}share/man/man{1..8}
|
---|
[032dc4e8] | 35 | mkdir -pv /var/{cache,local,log,mail,opt,spool}
|
---|
| 36 | mkdir -pv /var/lib/{color,misc,locate}
|
---|
| 37 |
|
---|
| 38 | ln -sfv /run /var/run
|
---|
| 39 | ln -sfv /run/lock /var/lock
|
---|
[3dc9543] | 40 |
|
---|
[032dc4e8] | 41 | install -dv -m 0750 /root
|
---|
| 42 | install -dv -m 1777 /tmp /var/tmp</userinput></screen>
|
---|
[6dfcfecc] | 43 |
|
---|
| 44 | <para arch="ml_32,ml_x32,ml_all">Required directories for multilib
|
---|
| 45 | support has already been created while previous installation steps.</para>
|
---|
[673b0d8] | 46 |
|
---|
[8ef8304] | 47 | <para>Directories are, by default, created with permission mode 755, but
|
---|
| 48 | this is not desirable for all directories. In the commands above, two
|
---|
| 49 | changes are made—one to the home directory of user <systemitem
|
---|
| 50 | class="username">root</systemitem>, and another to the directories for
|
---|
| 51 | temporary files.</para>
|
---|
[81fd230] | 52 |
|
---|
[8ef8304] | 53 | <para>The first mode change ensures that not just anybody can enter
|
---|
| 54 | the <filename class="directory">/root</filename> directory—the
|
---|
| 55 | same as a normal user would do with his or her home directory. The
|
---|
| 56 | second mode change makes sure that any user can write to the
|
---|
| 57 | <filename class="directory">/tmp</filename> and <filename
|
---|
| 58 | class="directory">/var/tmp</filename> directories, but cannot remove
|
---|
| 59 | another user's files from them. The latter is prohibited by the so-called
|
---|
| 60 | <quote>sticky bit,</quote> the highest bit (1) in the 1777 bit mask.</para>
|
---|
[81fd230] | 61 |
|
---|
[8ef8304] | 62 | <sect2>
|
---|
| 63 | <title>FHS Compliance Note</title>
|
---|
[81fd230] | 64 |
|
---|
[6bf3f58] | 65 | <para>The directory tree is based on the Filesystem Hierarchy Standard
|
---|
| 66 | (FHS) (available at <ulink
|
---|
[1daca67] | 67 | url="https://refspecs.linuxfoundation.org/fhs.shtml"/>). The FHS also specifies
|
---|
[8caabdd] | 68 | the optional existence of some directories such as <filename
|
---|
[83b720b] | 69 | class="directory">/usr/local/games</filename> and <filename
|
---|
[6bf3f58] | 70 | class="directory">/usr/share/games</filename>. We create only the
|
---|
| 71 | directories that are needed. However, feel free to create these
|
---|
| 72 | directories. </para>
|
---|
[81fd230] | 73 |
|
---|
[8ef8304] | 74 | </sect2>
|
---|
[81fd230] | 75 |
|
---|
[673b0d8] | 76 | </sect1>
|
---|