[a9e389d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[bd48e48] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[ed5e88d] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
[a9e389d] | 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[ed5e88d] | 8 | <sect1 id="ch-final-system-creatingdirs">
|
---|
[a9e389d] | 9 | <?dbhtml filename="creatingdirs.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Creating Directories</title>
|
---|
| 12 |
|
---|
[08c1cb1] | 13 | <para>It is time to create some structure in the target CLFS file system.
|
---|
| 14 | Create a standard directory tree by issuing the following commands:</para>
|
---|
[a9e389d] | 15 |
|
---|
[2ac5147] | 16 | <screen><userinput>mkdir -pv ${CLFS}/targetfs/{bin,boot,dev,etc,home,lib/{firmware,modules}}
|
---|
| 17 | mkdir -pv ${CLFS}/targetfs/{mnt,opt,proc,sbin,srv,sys}
|
---|
| 18 | mkdir -pv ${CLFS}/targetfs/var/{cache,lib,local,lock,log,opt,run,spool}
|
---|
[08c1cb1] | 19 | install -dv -m 0750 ${CLFS}/targetfs/root
|
---|
[c4d9f4b] | 20 | install -dv -m 1777 ${CLFS}/targetfs/{var/,}tmp
|
---|
[2ac5147] | 21 | mkdir -pv ${CLFS}/targetfs/usr/{,local/}{bin,include,lib,sbin,share,src}</userinput></screen>
|
---|
[a9e389d] | 22 |
|
---|
| 23 | <para>Directories are, by default, created with permission mode 755, but
|
---|
| 24 | this is not desirable for all directories. In the commands above, two
|
---|
| 25 | changes are made—one to the home directory of user <systemitem
|
---|
| 26 | class="username">root</systemitem>, and another to the directories for
|
---|
| 27 | temporary files.</para>
|
---|
| 28 |
|
---|
| 29 | <para>The first mode change ensures that not just anybody can enter
|
---|
| 30 | the <filename class="directory">/root</filename> directory—the
|
---|
| 31 | same as a normal user would do with his or her home directory. The
|
---|
| 32 | second mode change makes sure that any user can write to the
|
---|
| 33 | <filename class="directory">/tmp</filename> and <filename
|
---|
| 34 | class="directory">/var/tmp</filename> directories, but cannot remove
|
---|
| 35 | another user's files from them. The latter is prohibited by the so-called
|
---|
| 36 | <quote>sticky bit,</quote> the highest bit (1) in the 1777 bit mask.</para>
|
---|
| 37 |
|
---|
| 38 | <sect2>
|
---|
| 39 | <title>FHS Compliance Note</title>
|
---|
| 40 |
|
---|
| 41 | <para>The directory tree is based on the Filesystem Hierarchy Standard (FHS)
|
---|
[83a31c3] | 42 | (available at <ulink url="http://refspecs.linuxfoundation.org/fhs.shtml"/>).</para>
|
---|
[a9e389d] | 43 |
|
---|
| 44 | </sect2>
|
---|
| 45 |
|
---|
| 46 | </sect1>
|
---|