[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
| 6 | <sect1 id="ch-system-creatingdirs">
|
---|
[69993f4] | 7 | <title>Creating Directories</title>
|
---|
[673b0d8] | 8 | <?dbhtml filename="creatingdirs.html"?>
|
---|
| 9 |
|
---|
[ef13657] | 10 | <para>It is time to create some structure in the LFS file system.
|
---|
| 11 | Create a directory tree. Issuing the following commands will create a
|
---|
[673b0d8] | 12 | standard tree:</para>
|
---|
| 13 |
|
---|
[d8277ea] | 14 | <screen><userinput>install -d /{bin,boot,dev,etc/opt,home,lib,mnt}
|
---|
| 15 | install -d /{sbin,srv,usr/local,var,opt}
|
---|
| 16 | install -d /root -m 0750
|
---|
| 17 | install -d /tmp /var/tmp -m 1777
|
---|
| 18 | install -d /media/{floppy,cdrom}
|
---|
| 19 | install -d /usr/{bin,include,lib,sbin,share,src}
|
---|
[673b0d8] | 20 | ln -s share/{man,doc,info} /usr
|
---|
[d8277ea] | 21 | install -d /usr/share/{doc,info,locale,man}
|
---|
| 22 | install -d /usr/share/{misc,terminfo,zoneinfo}
|
---|
| 23 | install -d /usr/share/man/man{1,2,3,4,5,6,7,8}
|
---|
| 24 | install -d /usr/local/{bin,etc,include,lib,sbin,share,src}
|
---|
[673b0d8] | 25 | ln -s share/{man,doc,info} /usr/local
|
---|
[d8277ea] | 26 | install -d /usr/local/share/{doc,info,locale,man}
|
---|
| 27 | install -d /usr/local/share/{misc,terminfo,zoneinfo}
|
---|
| 28 | install -d /usr/local/share/man/man{1,2,3,4,5,6,7,8}
|
---|
| 29 | install -d /var/{lock,log,mail,run,spool}
|
---|
[d5833fe] | 30 | install -d /var/{opt,cache,lib/{misc,locate},local}
|
---|
[d8277ea] | 31 | install -d /opt/{bin,doc,include,info}
|
---|
| 32 | install -d /opt/{lib,man/man{1,2,3,4,5,6,7,8}}</userinput></screen>
|
---|
[673b0d8] | 33 |
|
---|
[ef13657] | 34 | <para>Directories are, by default, created with permission mode 755,
|
---|
| 35 | but this is not desirable for all directories. In the commands above,
|
---|
[69993f4] | 36 | two changes are made—one to the home directory of user
|
---|
[ef13657] | 37 | <emphasis>root</emphasis>, and another to the directories for
|
---|
| 38 | temporary files.</para>
|
---|
[673b0d8] | 39 |
|
---|
[ef13657] | 40 | <para>The first mode change ensures that not just anybody can enter
|
---|
[69993f4] | 41 | the <filename class="directory">/root</filename> directory—the same
|
---|
[ef13657] | 42 | as a normal user would do with his or her home directory. The second
|
---|
| 43 | mode change makes sure that any user can write to the <filename
|
---|
| 44 | class="directory">/tmp</filename> and <filename
|
---|
| 45 | class="directory">/var/tmp</filename> directories, but cannot remove
|
---|
| 46 | other users' files from them. The latter is prohibited by the
|
---|
| 47 | so-called <quote>sticky bit,</quote> the highest bit (1) in the 1777
|
---|
| 48 | bit mask.</para>
|
---|
[673b0d8] | 49 |
|
---|
[38bb44a] | 50 | <beginpage/>
|
---|
[673b0d8] | 51 | <sect2>
|
---|
[69993f4] | 52 | <title>FHS Compliance Note</title>
|
---|
[673b0d8] | 53 |
|
---|
[ef13657] | 54 | <para>The directory tree is based on the Filesystem Hierarchy Standard
|
---|
| 55 | (FHS) standard (available at <ulink
|
---|
| 56 | url="http://www.pathname.com/fhs/"/>). Besides the tree created above,
|
---|
| 57 | this standard stipulates the existence of <filename
|
---|
| 58 | class="directory">/usr/local/games</filename> and <filename
|
---|
| 59 | class="directory">/usr/share/games</filename>. We do not recommend
|
---|
| 60 | these for a base system, however, feel free to make the system
|
---|
| 61 | FHS-compliant. The FHS is not precise as to the structure of the
|
---|
| 62 | <filename class="directory">/usr/local/share</filename> subdirectory,
|
---|
[69993f4] | 63 | so we created only the directories that are needed.</para>
|
---|
[673b0d8] | 64 |
|
---|
| 65 | </sect2>
|
---|
| 66 |
|
---|
| 67 | </sect1>
|
---|
[ef13657] | 68 |
|
---|