source: chapter07/creatingdirs.xml@ ba82c18

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 ml-11.0 multilib trunk xry111/git-transition xry111/glibc-2.34 xry111/tester-nohack xry111/usr-move
Last change on this file since ba82c18 was ba82c18, checked in by Bruce Dubbs <bdubbs@…>, 16 months ago

Update to gettext-0.21.
Update to binutils-2.35.
Update to gcc-10.2.0.
Update to check-0.15.1.
Update to bison-3.7.1.
Update to util-linux 2.36.0.
Update to libcap-2.42.
Update to linux-5.7.12.

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

  • Property mode set to 100644
File size: 2.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-tools-creatingdirs">
9 <?dbhtml filename="creatingdirs.html"?>
10
11 <title>Creating Directories</title>
12
13 <para>It is time to create the full structure in the LFS file system.</para>
14
15 <para>Create some root-level directories that are not in the limited set
16 required in the previous chapters by issuing the following command:</para>
17
18 <note><para>Some of the directories below have already been created earlier
19 with explicit instructions or when installing some packages. They are
20 repeated below for completeness.</para></note>
21
22<screen><userinput>mkdir -pv /{boot,home,mnt,opt,srv}</userinput></screen>
23
24 <para>Create the required set of subdirectories below the root-level by
25 issuing the following commands:</para>
26
27<screen><userinput>mkdir -pv /etc/{opt,sysconfig}
28mkdir -pv /lib/firmware
29mkdir -pv /media/{floppy,cdrom}
30mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
31mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
32mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo}
33mkdir -pv /usr/{,local/}share/man/man{1..8}
34mkdir -pv /var/{cache,local,log,mail,opt,spool}
35mkdir -pv /var/lib/{color,misc,locate}
36
37ln -sfv /run /var/run
38ln -sfv /run/lock /var/lock
39
40install -dv -m 0750 /root
41install -dv -m 1777 /tmp /var/tmp</userinput></screen>
42
43 <para>Directories are, by default, created with permission mode 755, but
44 this is not desirable for all directories. In the commands above, two
45 changes are made&mdash;one to the home directory of user <systemitem
46 class="username">root</systemitem>, and another to the directories for
47 temporary files.</para>
48
49 <para>The first mode change ensures that not just anybody can enter
50 the <filename class="directory">/root</filename> directory&mdash;the
51 same as a normal user would do with his or her home directory. The
52 second mode change makes sure that any user can write to the
53 <filename class="directory">/tmp</filename> and <filename
54 class="directory">/var/tmp</filename> directories, but cannot remove
55 another user's files from them. The latter is prohibited by the so-called
56 <quote>sticky bit,</quote> the highest bit (1) in the 1777 bit mask.</para>
57
58 <sect2>
59 <title>FHS Compliance Note</title>
60
61 <para>The directory tree is based on the Filesystem Hierarchy Standard
62 (FHS) (available at <ulink
63 url="https://refspecs.linuxfoundation.org/fhs.shtml"/>). The FHS also specifies
64 the optional existence of some directories such as <filename
65 class="directory">/usr/local/games</filename> and <filename
66 class="directory">/usr/share/games</filename>. We create only the
67 directories that are needed. However, feel free to create these
68 directories. </para>
69
70 </sect2>
71
72</sect1>
Note: See TracBrowser for help on using the repository browser.