source: chapter06/creatingdirs.xml@ b864e06

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 v4_0 v4_1 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 b864e06 was b864e06, checked in by Mark Hymers <markh@…>, 22 years ago

change usr,usr/local to usr in ch06-createdirs as per Jesse's suggestion on lfs-dev

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

  • Property mode set to 100644
File size: 2.7 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 the directory tree on the LFS partition based on
6the FHS standard, which can be found at
7<ulink url="http://www.pathname.com/fhs/"/>.
8Issuing the following commands will create a default directory layout:</para>
9
10<para><screen><userinput>mkdir -p /{bin,boot,dev/pts,etc/opt,home,lib,mnt,proc} &amp;&amp;
11mkdir -p /{root,sbin,tmp,usr/local,var,opt} &amp;&amp;
12for dirname in /usr /usr/local
13&nbsp;&nbsp;&nbsp;&nbsp;do
14&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/{bin,etc,include,lib,sbin,share,src}
15&nbsp;&nbsp;&nbsp;&nbsp;ln -s share/{man,doc,info} $dirname
16&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/share/{dict,doc,info,locale,man}
17&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/share/{nls,misc,terminfo,zoneinfo}
18&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/share/man/man{1,2,3,4,5,6,7,8}
19done &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>Normally, directories are created with permission mode 755, which isn't
27desired for all directories. The first change is a mode 0750 for the
28/root directory. This is to make sure that not just everybody can
29enter the /root directory (the same a user would do with his /home/username
30directory). The second change is a mode 1777 for the tmp
31directories. In this way any user can write to the /tmp and /var/tmp
32directories, but cannot remove other users's files from them (the latter is prohibited
33by the so-called "sticky bit" -- bit 1 in the 1777 bit mask).</para>
34
35<para><screen><userinput>chmod 0750 /root &amp;&amp;
36chmod 1777 /tmp /var/tmp</userinput></screen></para>
37
38<para>Now that the directories are created, copy the source files that were
39downloaded in chapter 3 to some subdirectory under /usr/src (you
40will need to create the desired directory yourself).</para>
41
42<sect2>
43<title>FHS compliance notes</title>
44
45<para>The FHS stipulates that the /usr/local directory should contain the
46bin, games, include, lib, man, sbin, and share subdirectories. You can
47alter your /usr/local directory yourself if you want your system to be
48FHS-compliant.</para>
49
50<para>Also, the standard says that there should exist a /usr/share/games
51directory, which we don't much like for a base system. But feel free to
52make your system FHS-compliant if you wish. The FHS isn't precise as
53to the structure of the /usr/local/share subdirectories, so we took the
54liberty of creating the directories that we felt were needed.</para>
55
56</sect2>
57
58</sect1>
59
Note: See TracBrowser for help on using the repository browser.