⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kernel.html

📁 CLFS(Cross-Compiled Linux From Scratch)的文档 Version CLFS-SVN-20060417
💻 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.12.&nbsp;Linux-2.6.16.5    </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&nbsp;7.&nbsp;If You Are Going to Boot        </h3>      </div>      <ul class="headerlinks">        <li class="prev">          <a accesskey="p" href="pwdgroup.html" title=          "Creating the passwd, group, and log Files">Prev</a>          <p>            Creating the passwd, group, and log Files          </p>        </li>        <li class="next">          <a accesskey="n" href="colo-build.html" title="Colo-1.21">Next</a>          <p>            Colo-1.21          </p>        </li>        <li class="up">          <a accesskey="u" href="chapter.html" title=          "Chapter&nbsp;7.&nbsp;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="wrap" lang="en" xml:lang="en">      <div class="titlepage">        <h1 class="sect1">          7.12. Linux-2.6.16.5        </h1>      </div>      <div class="package" lang="en" xml:lang="en">        <p>          The Linux package contains the Linux kernel.        </p>        <div class="segmentedlist">          <div class="seglistitem">            <div class="seg">              <strong><span class="segtitle">Installation depends              on:</span></strong> <span class="seg">Bash, Binutils,              Coreutils, Findutils, GCC, Glibc, Grep, Gzip, Kbd, Make,              Module-Init-Tools, Perl, and Sed</span>            </div>          </div>        </div>      </div>      <div class="installation" lang="en" xml:lang="en">        <div class="titlepage">          <h2 class="sect2">            7.12.1. Installation of the kernel          </h2>        </div>        <div class="warning">          <div class="admonhead">            <img alt="[Warning]" src="../images/warning.png" />            <h3 class="admontitle">              Warning            </h3>          </div>          <div class="admonbody">            <p>              Here a temporary cross-compiled kernel will be built. When              configuring it, select the minimal amount of options required              to boot the target machine and build the final system. I.e., no              support for sound, printers, etc. will be needed.            </p>            <p>              Also, try to avoid the use of modules if possible, and don't              use the resulting kernel image for production systems.            </p>          </div>        </div>        <p>          The following patch merges changes from Linux-MIPS.org into the          kernel:        </p>        <pre class="userinput"><kbd class="command">patch -Np1 -i ../linux-2.6.16.5-mips-1.patch</kbd></pre>        <p>          Building the kernel involves a few steps&mdash;configuration,          compilation, and installation. Read the <tt class=          "filename">README</tt> file in the kernel source tree for          alternative methods to the way this book configures the kernel.        </p>        <p>          Prepare for compilation by running the following command:        </p>        <pre class="userinput"><kbd class="command">make mrproper</kbd></pre>        <p>          This ensures that the kernel tree is absolutely clean. The kernel          team recommends that this command be issued prior to each kernel          compilation. Do not rely on the source tree being clean after          un-tarring.        </p>        <p>          If your keyboard isn't an US one, you may want to build the proper          keymap for your keyboard layout inside the kernel. Do it by running          the following command:        </p>        <pre class="userinput"><kbd class="command">loadkeys -m /usr/share/kbd/keymaps/<em class="replaceable"><tt>[path to  keymap]</tt></em> &gt; \    drivers/char/defkeymap.c</kbd></pre>        <p>          For example, if using a Dutch keyboard, use <tt class=          "filename">/usr/share/kbd/keymaps/i386/qwerty/nl.map.gz</tt>.        </p>        <p>          Configure the kernel via a menu-driven interface:        </p>        <pre class="userinput"><kbd class="command">make ARCH=mips CROSS_COMPILE=${LFS_TARGET}- menuconfig</kbd></pre>        <p>          Compile the kernel image and modules:        </p>        <pre class="userinput"><kbd class="command">make ARCH=mips CROSS_COMPILE=${LFS_TARGET}-</kbd></pre>        <p>          If the use of kernel modules can't be avoided, an <tt class=          "filename">${LFS}/etc/modprobe.conf</tt> file may be needed.          Information pertaining to modules and kernel configuration is          located in the kernel documentation in the <tt class=          "filename">Documentation</tt> directory of the kernel sources tree.          The <tt class="filename">modprobe.conf</tt> man page may also be of          interest.        </p>        <p>          Be very careful when reading other documentation relating to kernel          modules because it usually applies to 2.4.x kernels only. As far as          we know, kernel configuration issues specific to Hotplug and Udev          are not documented. The problem is that Udev will create a device          node only if Hotplug or a user-written script inserts the          corresponding module into the kernel, and not all modules are          detectable by Hotplug. Note that statements like the one below in          the <tt class="filename">/etc/modprobe.conf</tt> file do not work          with Udev:        </p>        <pre class="screen"><tt class="literal">alias char-major-XXX some-module</tt></pre>        <p>          Install the modules, if the kernel configuration uses them:        </p>        <pre class="userinput"><kbd class="command">make ARCH=mips CROSS_COMPILE=${LFS_TARGET)- \   INSTALL_MOD_PATH=${LFS} modules_install</kbd></pre>        <p>          After kernel compilation is complete, additional steps are required          to complete the installation. Some files need to be copied to the          <tt class="filename">${LFS}/boot</tt> directory.        </p>        <p>          Issue the following command to install the kernel:        </p>        <pre class="userinput"><kbd class="command">cp -v vmlinux ${LFS}/boot/vmlinux-2.6.16.5gzip -9 ${LFS}/boot/vmlinux-2.6.16.5</kbd></pre>        <p>          <tt class="filename">System.map</tt> is a symbol file for the          kernel. It maps the function entry points of every function in the          kernel API, as well as the addresses of the kernel data structures          for the running kernel. Issue the following command to install the          map file:        </p>        <pre class="userinput"><kbd class="command">cp -v System.map ${LFS}/boot/System.map-2.6.16.5</kbd></pre>        <p>          The kernel configuration file <tt class="filename">.config</tt>          produced by the <span><strong class="command">make          menuconfig</strong></span> step above contains all the          configuration selections for the kernel that was just compiled. It          is a good idea to keep this file for future reference:        </p>        <pre class="userinput"><kbd class="command">cp -v .config ${LFS}/boot/config-2.6.16.5</kbd></pre>      </div>      <div class="content" lang="en" xml:lang="en">        <p>          Details on this package are located in <a href=          "../bootable/kernel.html#contents-kernel" title=          "12.3.2.&nbsp;Contents of Linux">Section&nbsp;12.3.2,          &ldquo;Contents of Linux.&rdquo;</a>        </p>      </div>    </div>    <div class="navfooter">      <ul>        <li class="prev">          <a accesskey="p" href="pwdgroup.html" title=          "Creating the passwd, group, and log Files">Prev</a>          <p>            Creating the passwd, group, and log Files          </p>        </li>        <li class="next">          <a accesskey="n" href="colo-build.html" title="Colo-1.21">Next</a>          <p>            Colo-1.21          </p>        </li>        <li class="up">          <a accesskey="u" href="chapter.html" title=          "Chapter&nbsp;7.&nbsp;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 + -