1 | <sect1 id="ch04-creatingdirs">
|
---|
2 | <title>Creating directories</title>
|
---|
3 |
|
---|
4 | <para>
|
---|
5 | Let's create the directory tree on the LFS partition according to the FHS
|
---|
6 | standard which can be found at <ulink
|
---|
7 | url="http://www.pathname.com/fhs/">http://www.pathname.com/fhs/</ulink>.
|
---|
8 | Issuing 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> do</literal></userinput>
|
---|
18 | <userinput> mkdir $dirname</userinput>
|
---|
19 | <userinput> cd $dirname</userinput>
|
---|
20 | <userinput> mkdir bin etc include lib sbin share
|
---|
21 | src tmp var</userinput>
|
---|
22 | <userinput> ln -s share/man man</userinput>
|
---|
23 | <userinput> ln -s share/doc doc</userinput>
|
---|
24 | <userinput> ln -s share/info info</userinput>
|
---|
25 | <userinput> cd $dirname/share</userinput>
|
---|
26 | <userinput> mkdir dict doc info locale man nls misc
|
---|
27 | terminfo zoneinfo</userinput>
|
---|
28 | <userinput> cd $dirname/share/man</userinput>
|
---|
29 | <userinput> 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>
|
---|
38 | Normally directories are created with permission mode 755, which isn't
|
---|
39 | desired for all directories. I haven't checked the FHS if they suggest
|
---|
40 | default modes for certain directories, so I'll just change the modes for
|
---|
41 | a few directories that make sense to change. The first change is a mode
|
---|
42 | 0750 for the $LFS/root directory. This is to make sure that not just
|
---|
43 | everybody 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
|
---|
45 | directories. This way every user can write stuff to the /tmp directory if
|
---|
46 | they need to. The sticky (1) bit makes sure users can't delete other
|
---|
47 | user's file which they normally can do because the directory is set in
|
---|
48 | such a way that every body (owner, group, world) can write to that directory.
|
---|
49 | </para>
|
---|
50 |
|
---|
51 | <blockquote><literallayout>
|
---|
52 |
|
---|
53 | <userinput>cd $LFS &&</userinput>
|
---|
54 | <userinput>chmod 0750 root &&</userinput>
|
---|
55 | <userinput>chmod 1777 tmp usr/tmp var/tmp</userinput>
|
---|
56 |
|
---|
57 | </literallayout></blockquote>
|
---|
58 |
|
---|
59 | <para>
|
---|
60 | Now that the directories are created, copy the source files you have
|
---|
61 | downloaded in chapter 3 to some subdirectory under $LFS/usr/src (you will
|
---|
62 | need to create this subdirectory yourself).
|
---|
63 | </para>
|
---|
64 |
|
---|
65 | </sect1>
|
---|
66 |
|
---|