source: chapter06/creatingdirs.xml@ 8321123

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 8321123 was 81fd230, checked in by Gerard Beekmans <gerard@…>, 19 years ago

Trunk is now identical to Testing

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