source: chapter03/creatingdirs.xml@ b08f409

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 v3_0 v3_1 v3_2 v3_3 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 b08f409 was b08f409, checked in by Gerard Beekmans <gerard@…>, 23 years ago

Initial XML commit

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

  • Property mode set to 100644
File size: 2.7 KB
Line 
1<sect1 id="ch04-creatingdirs">
2<title>Creating directories</title>
3
4<para>
5Let's create the directory tree on the LFS partition according to the FHS
6standard which can be found at <ulink
7url="http://www.pathname.com/fhs/">http://www.pathname.com/fhs/</ulink>.
8Issuing the following commands will create the necessary directories:
9</para>
10
11<blockquote><literallayout>
12
13 <userinput>cd $LFS</userinput>
14 <userinput>mkdir -p bin boot dev/pts etc home lib mnt proc root sbin
15 tmp var</userinput>
16 <userinput>for dirname in $LFS/usr $LFS/usr/local</userinput>
17 <userinput><literal>&nbsp;&nbsp;&nbsp;do</literal></userinput>
18 <userinput>&nbsp;&nbsp;&nbsp;mkdir $dirname</userinput>
19 <userinput>&nbsp;&nbsp;&nbsp;cd $dirname</userinput>
20 <userinput>&nbsp;&nbsp;&nbsp;mkdir bin etc include lib sbin share
21 src tmp var</userinput>
22 <userinput>&nbsp;&nbsp;&nbsp;ln -s share/man man</userinput>
23 <userinput>&nbsp;&nbsp;&nbsp;ln -s share/doc doc</userinput>
24 <userinput>&nbsp;&nbsp;&nbsp;ln -s share/info info</userinput>
25 <userinput>&nbsp;&nbsp;&nbsp;cd $dirname/share</userinput>
26 <userinput>&nbsp;&nbsp;&nbsp;mkdir dict doc info locale man nls misc
27 terminfo zoneinfo</userinput>
28 <userinput>&nbsp;&nbsp;&nbsp;cd $dirname/share/man</userinput>
29 <userinput>&nbsp;&nbsp;&nbsp;mkdir man1 man2 man3 man4 man5 man6 man7
30 man8</userinput>
31 <userinput>done</userinput>
32 <userinput>cd $LFS/var</userinput>
33 <userinput>mkdir lock log mail run spool tmp</userinput>
34
35</literallayout></blockquote>
36
37<para>
38Normally directories are created with permission mode 755, which isn't
39desired for all directories. I haven't checked the FHS if they suggest
40default modes for certain directories, so I'll just change the modes for
41a few directories that make sense to change. The first change is a mode
420750 for the $LFS/root directory. This is to make sure that not just
43everybody can enter the /root directory (the same you would do with
44/home/username directories). The second change is a mode 1777 for the tmp
45directories. This way every user can write stuff to the /tmp directory if
46they need to. The sticky (1) bit makes sure users can't delete other
47user's file which they normally can do because the directory is set in
48such a way that every body (owner, group, world) can write to that directory.
49</para>
50
51<blockquote><literallayout>
52
53 <userinput>cd $LFS &amp;&amp;</userinput>
54 <userinput>chmod 0750 root &amp;&amp;</userinput>
55 <userinput>chmod 1777 tmp usr/tmp var/tmp</userinput>
56
57</literallayout></blockquote>
58
59<para>
60Now that the directories are created, copy the source files you have
61downloaded in chapter 3 to some subdirectory under $LFS/usr/src (you will
62need to create this subdirectory yourself).
63</para>
64
65</sect1>
66
Note: See TracBrowser for help on using the repository browser.