source: chapter07/creatingdirs.xml@ d7a9421

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 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 d7a9421 was d7a9421, checked in by Douglas R. Reno <renodr@…>, 3 years ago

Merge Xi's changes into trunk
Update to meson-0.58.0
Update to systemd-248
Update to gcc-11.1.0
Update to linux-5.12.1
Update to iproute2-5.12.0
Update to Python-3.9.5
Make /bin, /sbin, and /lib symlinks to their counterparts in /usr.
Thanks again for a significant portion of this work goes to Xi, I only
really merged it and made a couple of modifications for my updates. To
LFS 11.x we go!

  • Property mode set to 100644
File size: 2.9 KB
RevLine 
[fcc02767]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
[17ca548]13 <para>It is time to create the full structure in the LFS file system.</para>
[fcc02767]14
[17ca548]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
[ba82c18]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
[17ca548]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}
[d7a9421]30mkdir -pv /usr/{,local/}{include,src}
31mkdir -pv /usr/local/{bin,lib,sbin}
[fcc02767]32mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
[387a32af]33mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo}
[fcc02767]34mkdir -pv /usr/{,local/}share/man/man{1..8}
[17ca548]35mkdir -pv /var/{cache,local,log,mail,opt,spool}
36mkdir -pv /var/lib/{color,misc,locate}
[fcc02767]37
[ba82c18]38ln -sfv /run /var/run
39ln -sfv /run/lock /var/lock
[17ca548]40
41install -dv -m 0750 /root
42install -dv -m 1777 /tmp /var/tmp</userinput></screen>
[fcc02767]43
44 <para>Directories are, by default, created with permission mode 755, but
45 this is not desirable for all directories. In the commands above, two
46 changes are made&mdash;one to the home directory of user <systemitem
47 class="username">root</systemitem>, and another to the directories for
48 temporary files.</para>
49
50 <para>The first mode change ensures that not just anybody can enter
51 the <filename class="directory">/root</filename> directory&mdash;the
52 same as a normal user would do with his or her home directory. The
53 second mode change makes sure that any user can write to the
54 <filename class="directory">/tmp</filename> and <filename
55 class="directory">/var/tmp</filename> directories, but cannot remove
56 another user's files from them. The latter is prohibited by the so-called
57 <quote>sticky bit,</quote> the highest bit (1) in the 1777 bit mask.</para>
58
59 <sect2>
60 <title>FHS Compliance Note</title>
61
62 <para>The directory tree is based on the Filesystem Hierarchy Standard
63 (FHS) (available at <ulink
64 url="https://refspecs.linuxfoundation.org/fhs.shtml"/>). The FHS also specifies
65 the optional existence of some directories such as <filename
66 class="directory">/usr/local/games</filename> and <filename
67 class="directory">/usr/share/games</filename>. We create only the
68 directories that are needed. However, feel free to create these
69 directories. </para>
70
71 </sect2>
72
73</sect1>
Note: See TracBrowser for help on using the repository browser.