aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/creatingdirs.xml
diff options
context:
space:
mode:
authorGerard Beekmans <gerard@linuxfromscratch.org>2002-05-25 00:21:12 +0000
committerGerard Beekmans <gerard@linuxfromscratch.org>2002-05-25 00:21:12 +0000
commit1987d724ce4059e12b51962be50c59d30a4a148d (patch)
tree1c165b6c8cf19ed18668659078a71692e228b59e /chapter06/creatingdirs.xml
parent5e2cb652195321c7f63b5d22077e583b75118178 (diff)
second set of commits for keep-chap5-chap6-seperate
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@1897 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06/creatingdirs.xml')
-rw-r--r--chapter06/creatingdirs.xml60
1 files changed, 60 insertions, 0 deletions
diff --git a/chapter06/creatingdirs.xml b/chapter06/creatingdirs.xml
new file mode 100644
index 000000000..c0d8b1270
--- /dev/null
+++ b/chapter06/creatingdirs.xml
@@ -0,0 +1,60 @@
+<sect1 id="ch06-creatingdirs">
+<title>Creating directories</title>
+<?dbhtml filename="creatingdirs.html" dir="chapter06"?>
+
+<para>Let's now create the directory tree on the LFS partition based on
+the FHS standard, which can be found at
+<ulink url="http://www.pathname.com/fhs/"/>.
+Issuing the following commands will create a default directory layout:</para>
+
+<para><screen><userinput>mkdir -p /{bin,boot,dev/pts,etc/opt,home,lib,mnt,proc} &amp;&amp;
+mkdir -p /{root,sbin,tmp,usr,usr/local,var,opt} &amp;&amp;
+for dirname in /usr /usr/local
+&nbsp;&nbsp;&nbsp;&nbsp;do
+&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/{bin,etc,include,lib,sbin,share,src}
+&nbsp;&nbsp;&nbsp;&nbsp;ln -s share/{man,doc,info} $dirname
+&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/share/{dict,doc,info,locale,man}
+&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/share/{nls,misc,terminfo,zoneinfo}
+&nbsp;&nbsp;&nbsp;&nbsp;mkdir $dirname/share/man/man{1,2,3,4,5,6,7,8}
+done &amp;&amp;
+mkdir /var/{lock,log,mail,run,spool} &amp;&amp;
+mkdir -p /var/{tmp,opt,cache,lib/misc,local} &amp;&amp;
+mkdir /opt/{bin,doc,include,info} &amp;&amp;
+mkdir -p /opt/{lib,man/man{1,2,3,4,5,6,7,8}} &amp;&amp;
+ln -s ../var/tmp /usr</userinput></screen></para>
+
+<para>Normally, directories are created with permission mode 755, which isn't
+desired for all directories. The first change is a mode 0750 for the
+$LFS/root directory. This is to make sure that not just everybody can
+enter the /root directory (the same a user would do with /home/username
+directories). The second change is a mode 1777 for the tmp
+directories. This way, any user can write data to the /tmp or /var/tmp
+directory but cannot remove another user's files (the latter is caused
+by the so-called "sticky bit" - bit 1 of the 1777 bit mask).</para>
+
+<para><screen><userinput>cd $LFS &amp;&amp;
+chmod 0750 root &amp;&amp;
+chmod 1777 tmp var/tmp</userinput></screen></para>
+
+<para>Now that the directories are created, copy the source files that were
+downloaded in chapter 3 to some subdirectory under $LFS/usr/src (you
+will need to create the desired directory yourself).</para>
+
+<sect2>
+<title>FHS compliance notes</title>
+
+<para>The FHS stipulates that the /usr/local directory should contain the
+bin, games, include, lib, man, sbin, and share subdirectories. You can
+alter your /usr/local directory yourself if you want your system to be
+FHS-compliant.</para>
+
+<para>Also, the standard says that there should exist a /usr/share/games
+directory, which we don't much like for a base system. But feel free to
+make your system FHS-compliant if you wish. The FHS isn't precise as
+to the structure of the /usr/local/share subdirectories, so we took the
+liberty of creating the directories that we felt were needed.</para>
+
+</sect2>
+
+</sect1>
+