source: clfs-embedded/BOOK/final-system/common/creatingdirs.xml@ 73c0570

Last change on this file since 73c0570 was 2ac5147, checked in by Andrew Bradford <andrew@…>, 11 years ago

creatingdirs: Reduce number of dirs made to minimum

Not fully FHS compliant but no one really cares about FHS any more
anyway.

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[a9e389d]1<?xml version="1.0" encoding="ISO-8859-1"?>
[bd48e48]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[ed5e88d]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
[a9e389d]5 %general-entities;
6]>
7
[ed5e88d]8<sect1 id="ch-final-system-creatingdirs">
[a9e389d]9 <?dbhtml filename="creatingdirs.html"?>
10
11 <title>Creating Directories</title>
12
[08c1cb1]13 <para>It is time to create some structure in the target CLFS file system.
14 Create a standard directory tree by issuing the following commands:</para>
[a9e389d]15
[2ac5147]16<screen><userinput>mkdir -pv ${CLFS}/targetfs/{bin,boot,dev,etc,home,lib/{firmware,modules}}
17mkdir -pv ${CLFS}/targetfs/{mnt,opt,proc,sbin,srv,sys}
18mkdir -pv ${CLFS}/targetfs/var/{cache,lib,local,lock,log,opt,run,spool}
[08c1cb1]19install -dv -m 0750 ${CLFS}/targetfs/root
[2ac5147]20install -dv -m 1777 ${CLFS}/targetfs/tmp
21mkdir -pv ${CLFS}/targetfs/usr/{,local/}{bin,include,lib,sbin,share,src}</userinput></screen>
[a9e389d]22
23 <para>Directories are, by default, created with permission mode 755, but
24 this is not desirable for all directories. In the commands above, two
25 changes are made&mdash;one to the home directory of user <systemitem
26 class="username">root</systemitem>, and another to the directories for
27 temporary files.</para>
28
29 <para>The first mode change ensures that not just anybody can enter
30 the <filename class="directory">/root</filename> directory&mdash;the
31 same as a normal user would do with his or her home directory. The
32 second mode change makes sure that any user can write to the
33 <filename class="directory">/tmp</filename> and <filename
34 class="directory">/var/tmp</filename> directories, but cannot remove
35 another user's files from them. The latter is prohibited by the so-called
36 <quote>sticky bit,</quote> the highest bit (1) in the 1777 bit mask.</para>
37
38 <sect2>
39 <title>FHS Compliance Note</title>
40
41 <para>The directory tree is based on the Filesystem Hierarchy Standard (FHS)
[2ac5147]42 (available at <ulink url="http://www.pathname.com/fhs/"/>).</para>
[a9e389d]43
44 </sect2>
45
46</sect1>
Note: See TracBrowser for help on using the repository browser.