source: chapter06/creatingdirs.xml@ 6a0e6f3

Last change on this file since 6a0e6f3 was 6a0e6f3, checked in by Matthew Burgess <matthew@…>, 19 years ago
  • Remove the spurious <info> tags that I thought were necessary but evidently aren't

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/LFS-RNG/BOOK@4387 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE section [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<section xmlns="http://docbook.org/docbook-ng"
7 xmlns:xlink="http://www.w3.org/1999/xlink"
8 xml:id="ch-system-creatingdirs">
9<title>Creating directories</title>
10<?dbhtml filename="creatingdirs.html"?>
11
12<para>Let's now create some structure in our LFS file system. Let's create
13a directory tree. Issuing the following commands will create a more or less
14standard tree:</para>
15
16<screen><userinput>install -d /{bin,boot,dev,etc/opt,home,lib,mnt}
17install -d /{sbin,srv,usr/local,var,opt}
18install -d /root -m 0750
19install -d /tmp /var/tmp -m 1777
20install -d /media/{floppy,cdrom}
21install -d /usr/{bin,include,lib,sbin,share,src}
22ln -s share/{man,doc,info} /usr
23install -d /usr/share/{doc,info,locale,man}
24install -d /usr/share/{misc,terminfo,zoneinfo}
25install -d /usr/share/man/man{1,2,3,4,5,6,7,8}
26install -d /usr/local/{bin,etc,include,lib,sbin,share,src}
27ln -s share/{man,doc,info} /usr/local
28install -d /usr/local/share/{doc,info,locale,man}
29install -d /usr/local/share/{misc,terminfo,zoneinfo}
30install -d /usr/local/share/man/man{1,2,3,4,5,6,7,8}
31install -d /var/{lock,log,mail,run,spool}
32install -d /var/{opt,cache,lib/{misc,locate},local}
33install -d /opt/{bin,doc,include,info}
34install -d /opt/{lib,man/man{1,2,3,4,5,6,7,8}}</userinput></screen>
35
36<para>Directories are, by default, created with permission mode 755, but this
37isn't desirable for all directories. In the commands above, we make two changes:
38one to the home directory of <emphasis>root</emphasis>, and another to the
39directories for temporary files.</para>
40
41<para>The first mode change ensures that not just anybody can enter the
42<filename class="directory">/root</filename> directory -- the same
43as a normal user would do with his or her home directory.
44The second mode change makes sure that any user can write to the
45<filename class="directory">/tmp</filename> and
46<filename class="directory">/var/tmp</filename> directories, but
47cannot remove other users' files from them. The latter is prohibited
48by the so-called <quote>sticky bit</quote> -- the highest bit in the 1777 bit
49mask.</para>
50
51<section>
52<title>FHS compliance note</title>
53
54<para>We have based our directory tree on the FHS standard (available at
55<uri xlink:href="http://www.pathname.com/fhs/"/>). Besides the above created
56tree this standard stipulates the existence of
57<filename class="directory">/usr/local/games</filename> and
58<filename class="directory">/usr/share/games</filename>, but we don't
59much like these for a base system. However, feel free to make your system
60FHS-compliant. As to the structure of the
61<filename class="directory">/usr/local/share</filename> subdirectory, the FHS
62isn't precise, so we created here the directories that we think are needed.</para>
63
64</section>
65
66</section>
Note: See TracBrowser for help on using the repository browser.