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