source: chapter06/creatingdirs.xml@ b5b61fd

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 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 b5b61fd was 9dfc02f, checked in by Zack Winkles <winkie@…>, 20 years ago

Current BE-LFS (but w/ GCC 3.3.3) merged -> 6.0 branch

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