2004-05-03 11:59:46 +01:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2007-03-21 18:42:58 +00:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
2004-05-03 11:59:46 +01:00
|
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
2006-02-02 21:03:09 +00:00
|
|
|
|
2020-06-29 08:55:01 +01:00
|
|
|
<sect1 id="ch-tools-creatingdirs">
|
2006-02-02 21:03:09 +00:00
|
|
|
<?dbhtml filename="creatingdirs.html"?>
|
|
|
|
|
|
|
|
<title>Creating Directories</title>
|
|
|
|
|
2022-09-30 21:49:41 +01:00
|
|
|
<para>It is time to create the full directory structure in the LFS file system.</para>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2022-09-30 21:49:41 +01:00
|
|
|
<note><para>Some of the directories mentioned in this section may have
|
|
|
|
already been created earlier with explicit instructions, or when installing some
|
2022-05-30 11:30:50 +01:00
|
|
|
packages. They are repeated below for completeness.</para></note>
|
|
|
|
|
2020-08-07 08:06:58 +01:00
|
|
|
<para>Create some root-level directories that are not in the limited set
|
|
|
|
required in the previous chapters by issuing the following command:</para>
|
|
|
|
|
|
|
|
<screen><userinput>mkdir -pv /{boot,home,mnt,opt,srv}</userinput></screen>
|
|
|
|
|
|
|
|
<para>Create the required set of subdirectories below the root-level by
|
|
|
|
issuing the following commands:</para>
|
|
|
|
|
|
|
|
<screen><userinput>mkdir -pv /etc/{opt,sysconfig}
|
|
|
|
mkdir -pv /lib/firmware
|
|
|
|
mkdir -pv /media/{floppy,cdrom}
|
2021-05-12 05:24:11 +01:00
|
|
|
mkdir -pv /usr/{,local/}{include,src}
|
|
|
|
mkdir -pv /usr/local/{bin,lib,sbin}
|
Update to man-pages-3.5.9.
Incorporate beta FHS.
Add /usr/share/ppd, /usr/libexec, /usr/share/color,
/usr/local/share/color, /var/lib/color, and /usr/share/dict.
Remove overrides for /usr/libexec: coreutils, findutils, gawk,
gcc, glibc, inetutils, man-db, and tar.
Move grub sbin executables from /usr/sbin to /sbin.
Document two new glibc errors in the regression tests.
Move man-db after util-linux to satisfy a test dependency
in /tools and to speed the test up.
Restore building the flex static library.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10469 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
2014-02-16 20:49:53 +00:00
|
|
|
mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
|
2020-06-29 08:55:01 +01:00
|
|
|
mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo}
|
2006-05-08 07:52:28 +01:00
|
|
|
mkdir -pv /usr/{,local/}share/man/man{1..8}
|
2020-08-07 08:06:58 +01:00
|
|
|
mkdir -pv /var/{cache,local,log,mail,opt,spool}
|
|
|
|
mkdir -pv /var/lib/{color,misc,locate}
|
|
|
|
|
|
|
|
ln -sfv /run /var/run
|
|
|
|
ln -sfv /run/lock /var/lock
|
2014-02-18 07:16:55 +00:00
|
|
|
|
2020-08-07 08:06:58 +01:00
|
|
|
install -dv -m 0750 /root
|
|
|
|
install -dv -m 1777 /tmp /var/tmp</userinput></screen>
|
2020-06-29 08:55:01 +01:00
|
|
|
|
|
|
|
<para arch="ml_32,ml_x32,ml_all">Required directories for multilib
|
|
|
|
support has already been created while previous installation steps.</para>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2006-02-02 21:03:09 +00:00
|
|
|
<para>Directories are, by default, created with permission mode 755, but
|
2022-09-30 21:49:41 +01:00
|
|
|
this is not desirable everywhere. In the commands above, two
|
2006-02-02 21:03:09 +00:00
|
|
|
changes are made—one to the home directory of user <systemitem
|
|
|
|
class="username">root</systemitem>, and another to the directories for
|
|
|
|
temporary files.</para>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2006-02-02 21:03:09 +00:00
|
|
|
<para>The first mode change ensures that not just anybody can enter
|
2022-09-30 21:49:41 +01:00
|
|
|
the <filename class="directory">/root</filename> directory—just
|
|
|
|
like a normal user would do with his or her own home directory. The
|
2006-02-02 21:03:09 +00:00
|
|
|
second mode change makes sure that any user can write to the
|
|
|
|
<filename class="directory">/tmp</filename> and <filename
|
|
|
|
class="directory">/var/tmp</filename> directories, but cannot remove
|
|
|
|
another user's files from them. The latter is prohibited by the so-called
|
|
|
|
<quote>sticky bit,</quote> the highest bit (1) in the 1777 bit mask.</para>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2006-02-02 21:03:09 +00:00
|
|
|
<sect2>
|
|
|
|
<title>FHS Compliance Note</title>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2022-09-30 21:49:41 +01:00
|
|
|
<para>This directory tree is based on the Filesystem Hierarchy Standard
|
2015-12-19 20:51:24 +00:00
|
|
|
(FHS) (available at <ulink
|
2019-09-01 19:37:36 +01:00
|
|
|
url="https://refspecs.linuxfoundation.org/fhs.shtml"/>). The FHS also specifies
|
2022-09-30 21:49:41 +01:00
|
|
|
the optional existence of additional directories such as <filename
|
2006-05-08 07:52:28 +01:00
|
|
|
class="directory">/usr/local/games</filename> and <filename
|
2022-09-30 21:49:41 +01:00
|
|
|
class="directory">/usr/share/games</filename>. In LFS, we create only the
|
|
|
|
directories that are really necessary. However, feel free to create more
|
|
|
|
directories, if you wish. </para>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2022-11-26 08:27:58 +00:00
|
|
|
<warning>
|
|
|
|
<para>
|
2022-11-26 18:26:21 +00:00
|
|
|
The FHS does not mandate the existence of the directory
|
2022-11-26 08:27:58 +00:00
|
|
|
<filename class="directory">/usr/lib64</filename>, and the LFS editors
|
2022-11-26 18:26:21 +00:00
|
|
|
have decided not to use it. For the instructions in LFS and BLFS to work correctly,
|
|
|
|
it is imperative that this directory be non-existent. From time to time you should
|
|
|
|
verify that it does not exist, because it is easy to create it
|
|
|
|
inadvertently, and this will probably break your system.
|
2022-11-26 08:27:58 +00:00
|
|
|
</para>
|
|
|
|
</warning>
|
|
|
|
|
2006-02-02 21:03:09 +00:00
|
|
|
</sect2>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
</sect1>
|