source: chapter06/creatingdirs.xml@ 148c207

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.0 6.1 6.1.1 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 v5_0 v5_1 v5_1_1 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 148c207 was da849d1, checked in by Timothy Bauscher <timothy@…>, 21 years ago

Grammatic changes to chapter 6.

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

  • Property mode set to 100644
File size: 2.6 KB
Line 
1<sect1 id="ch06-creatingdirs">
2<title>Creating directories</title>
3<?dbhtml filename="creatingdirs.html" dir="chapter06"?>
4
5<para>Let's now create some structure in our LFS file system. Let's create
6a directory tree. Issuing the following commands will create a more or less
7standard tree:</para>
8
9<para><screen><userinput>mkdir -p /{bin,boot,dev/pts,etc/opt,home,lib,mnt,proc} &amp;&amp;
10mkdir -p /{root,sbin,tmp,usr/local,var,opt} &amp;&amp;
11for dirname in /usr /usr/local
12&nbsp;&nbsp;&nbsp;&nbsp;do
13&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/{bin,etc,include,lib,sbin,share,src}
14&nbsp;&nbsp;&nbsp;&nbsp;ln -s share/{man,doc,info} $dirname
15&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/share/{dict,doc,info,locale,man}
16&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/share/{nls,misc,terminfo,zoneinfo}
17&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/share/man/man{1,2,3,4,5,6,7,8}
18done &amp;&amp;
19mkdir /usr/lib/locale &amp;&amp;
20mkdir /var/{lock,log,mail,run,spool} &amp;&amp;
21mkdir -p /var/{tmp,opt,cache,lib/misc,local} &amp;&amp;
22mkdir /opt/{bin,doc,include,info} &amp;&amp;
23mkdir -p /opt/{lib,man/man{1,2,3,4,5,6,7,8}} &amp;&amp;
24ln -s ../var/tmp /usr</userinput></screen></para>
25
26<para>Directories are, by default, created with permission mode 755, but this
27isn't desirable for all directories. We will make two changes: one to the home
28directory of root, and another to the directories for temporary files.</para>
29
30<para><screen><userinput>chmod 0750 /root &amp;&amp;
31chmod 1777 /tmp /var/tmp</userinput></screen></para>
32
33<para>The first mode change ensures that not just anybody can enter the
34<filename class="directory">/root</filename> directory -- the same
35as a normal user would do with his or her home directory.
36The second mode change makes sure that any user can write to the
37<filename class="directory">/tmp</filename> and
38<filename class="directory">/var/tmp</filename> directories, but
39cannot remove other users' files from them. The latter is prohibited
40by the so-called "sticky bit" -- the highest bit in the 1777 bit mask.</para>
41
42<sect2>
43<title>FHS compliance note</title>
44
45<para>We have based our directory tree on the FHS standard (available at
46<ulink url="http://www.pathname.com/fhs/"/>). Besides the above created
47tree this standard stipulates the existence of
48<filename class="directory">/usr/local/games</filename> and
49<filename class="directory">/usr/share/games</filename>, but we don't
50much like these for a base system. However, feel free to make your system
51FHS-compliant. As to the structure of the
52<filename class="directory">/usr/local/share</filename> subdirectory, the FHS
53isn't precise, so we created here the directories that we think are needed.</para>
54
55</sect2>
56
57</sect1>
58
Note: See TracBrowser for help on using the repository browser.