mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-01-19 13:37:39 +00:00
6370fa6cff
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@14 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
67 lines
2.7 KiB
Plaintext
67 lines
2.7 KiB
Plaintext
<sect1 id="ch04-creatingdirs">
|
|
<title>Creating directories</title>
|
|
|
|
<para>
|
|
Let's create the directory tree on the LFS partition according to the FHS
|
|
standard which can be found at <ulink
|
|
url="http://www.pathname.com/fhs/">http://www.pathname.com/fhs/</ulink>.
|
|
Issuing the following commands will create the necessary directories:
|
|
</para>
|
|
|
|
<blockquote><literallayout>
|
|
|
|
<userinput>cd $LFS</userinput>
|
|
<userinput>mkdir bin boot dev dev/pts etc home lib mnt proc root sbin tmp
|
|
var</userinput>
|
|
<userinput>for dirname in $LFS/usr $LFS/usr/local</userinput>
|
|
<userinput><literal> do</literal></userinput>
|
|
<userinput> mkdir $dirname</userinput>
|
|
<userinput> cd $dirname</userinput>
|
|
<userinput> mkdir bin etc include lib sbin share
|
|
src tmp var</userinput>
|
|
<userinput> ln -s share/man man</userinput>
|
|
<userinput> ln -s share/doc doc</userinput>
|
|
<userinput> ln -s share/info info</userinput>
|
|
<userinput> cd $dirname/share</userinput>
|
|
<userinput> mkdir dict doc info locale man nls misc
|
|
terminfo zoneinfo</userinput>
|
|
<userinput> cd $dirname/share/man</userinput>
|
|
<userinput> mkdir man1 man2 man3 man4 man5 man6 man7
|
|
man8</userinput>
|
|
<userinput>done</userinput>
|
|
<userinput>cd $LFS/var</userinput>
|
|
<userinput>mkdir lock log mail run spool tmp</userinput>
|
|
|
|
</literallayout></blockquote>
|
|
|
|
<para>
|
|
Normally directories are created with permission mode 755, which isn't
|
|
desired for all directories. I haven't checked the FHS if they suggest
|
|
default modes for certain directories, so I'll just change the modes for
|
|
a few directories that make sense to change. 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 you would do with
|
|
/home/username directories). The second change is a mode 1777 for the tmp
|
|
directories. This way every user can write stuff to the /tmp directory if
|
|
they need to. The sticky (1) bit makes sure users can't delete other
|
|
user's file which they normally can do because the directory is set in
|
|
such a way that every body (owner, group, world) can write to that directory.
|
|
</para>
|
|
|
|
<blockquote><literallayout>
|
|
|
|
<userinput>cd $LFS &&</userinput>
|
|
<userinput>chmod 0750 root &&</userinput>
|
|
<userinput>chmod 1777 tmp usr/tmp var/tmp</userinput>
|
|
|
|
</literallayout></blockquote>
|
|
|
|
<para>
|
|
Now that the directories are created, copy the source files you have
|
|
downloaded in chapter 3 to some subdirectory under $LFS/usr/src (you will
|
|
need to create this subdirectory yourself).
|
|
</para>
|
|
|
|
</sect1>
|
|
|