📄 creatingdirs.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content= "application/xhtml+xml; charset=iso-8859-1" /> <title> 7.3. Creating Directories </title> <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /> <link rel="stylesheet" href="../stylesheets/lfs-print.css" type= "text/css" media="print" /> </head> <body id="lfs" class="CLFS-SVN-20060417-MIPS"> <div class="navheader"> <div class="headertitles"> <h4> Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS </h4> <h3> Chapter 7. If You Are Going to Boot </h3> </div> <ul class="headerlinks"> <li class="prev"> <a accesskey="p" href="bootloaders.html" title= "Bootloaders">Prev</a> <p> Bootloaders </p> </li> <li class="next"> <a accesskey="n" href="createfiles.html" title= "Creating Essential Symlinks">Next</a> <p> Creating Essential Symlinks </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 7. If You Are Going to Boot">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS"> Home</a> </li> </ul> </div> <div class="sect1" lang="en" xml:lang="en"> <div class="titlepage"> <h1 class="sect1"> 7.3. Creating Directories </h1> </div> <p> It is time to create some structure in the LFS file system. Create a standard directory tree by issuing the following commands: </p> <pre class="userinput"><kbd class="command">install -d ${LFS}/{bin,boot,dev,etc/opt,home,lib,mnt}install -d ${LFS}/{sbin,srv,usr/local,var,opt,proc,sys}install -d ${LFS}/root -m 0750install -d ${LFS}/tmp ${LFS}/var/tmp -m 1777install -d ${LFS}/media/{floppy,cdrom}install -d ${LFS}/usr/{bin,include,lib,sbin,share,src}ln -s share/{man,doc,info} ${LFS}/usrinstall -d ${LFS}/usr/share/{doc,info,locale,man}install -d ${LFS}/usr/share/{misc,terminfo,zoneinfo}install -d ${LFS}/usr/share/man/man{1,2,3,4,5,6,7,8}install -d ${LFS}/usr/local/{bin,etc,include,lib,sbin,share,src}ln -s share/{man,doc,info} ${LFS}/usr/localinstall -d ${LFS}/usr/local/share/{doc,info,locale,man}install -d ${LFS}/usr/local/share/{misc,terminfo,zoneinfo}install -d ${LFS}/usr/local/share/man/man{1,2,3,4,5,6,7,8}install -d ${LFS}/var/{lock,log,mail,run,spool}install -d ${LFS}/var/{opt,cache,lib/{misc,locate},local}install -d ${LFS}/opt/{bin,doc,include,info}install -d ${LFS}/opt/{lib,man/man{1,2,3,4,5,6,7,8}}</kbd></pre> <p> These entries are needed for the RaQ2 bootloader. Only use these if you are utilizing the Colo bootloader: </p> <pre class="userinput"><kbd class="command">cd /${LFS}/boot ln -sf . boot</kbd></pre> <p> Directories are, by default, created with permission mode 755, but this is not desirable for all directories. In the commands above, two changes are made—one to the home directory of user <tt class= "systemitem">root</tt>, and another to the directories for temporary files. </p> <p> The first mode change ensures that not just anybody can enter the <tt class="filename">${LFS}/root</tt> directory—the same as a normal user would do with his or her home directory. The second mode change makes sure that any user can write to the <tt class= "filename">${LFS}/tmp</tt> and <tt class= "filename">${LFS}/var/tmp</tt> directories, but cannot remove another user's files from them. The latter is prohibited by the so-called “<span class="quote">sticky bit,</span>” the highest bit (1) in the 1777 bit mask. </p> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <h2 class="sect2"> 7.3.1. FHS Compliance Note </h2> </div> <p> The directory tree is based on the Filesystem Hierarchy Standard (FHS) (available at <a href= "http://www.pathname.com/fhs/"><i>http://www.pathname.com/fhs/</i></a>). In addition to the tree created above, this standard stipulates the existence of <tt class="filename">/usr/local/games</tt> and <tt class="filename">/usr/share/games</tt>. The FHS is not precise as to the structure of the <tt class= "filename">/usr/local/share</tt> subdirectory, so we create only the directories that are needed. However, feel free to create these directories if you prefer to conform more strictly to the FHS. </p> </div> </div> <div class="navfooter"> <ul> <li class="prev"> <a accesskey="p" href="bootloaders.html" title= "Bootloaders">Prev</a> <p> Bootloaders </p> </li> <li class="next"> <a accesskey="n" href="createfiles.html" title= "Creating Essential Symlinks">Next</a> <p> Creating Essential Symlinks </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 7. If You Are Going to Boot">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS"> Home</a>. </li> </ul> </div> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -