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

📄 lilo.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.22.&nbsp;Making the LFS System Bootable    </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-x86_64-Pure64">    <div class="navheader">      <div class="headertitles">        <h4>          Cross-Compiled Linux From Scratch - Version          CLFS-SVN-20060417-x86_64-Pure64        </h4>        <h3>          Chapter&nbsp;7.&nbsp;If You Are Going to Boot        </h3>      </div>      <ul class="headerlinks">        <li class="prev">          <a accesskey="p" href="changingowner.html" title=          "Changing Ownership">Prev</a>          <p>            Changing Ownership          </p>        </li>        <li class="next">          <a accesskey="n" href="whatnext.html" title=          "What to do next">Next</a>          <p>            What to do next          </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-x86_64-Pure64">          Home</a>        </li>      </ul>    </div>    <div class="sect1" lang="en" xml:lang="en">      <div class="titlepage">        <h1 class="sect1">          7.22. Making the LFS System Bootable        </h1>      </div>      <p>        You are nearly ready to boot to the new temporary system. One of the        last things to do is to ensure that the system can be booted. The        instructions below apply only to x86_64 machines on which lilo is        going to be installed. Information on using a pre-installed Grub on        machines currently running as x86 or x86_64 multilib should be        available in the usual resource-specific locations for those        architectures. If you have installed an x86 version of lilo, these        instructions should be modified to refer to the <span><strong class=        "command">lilo</strong></span> and <span><strong class=        "command">keytab-lilo.pl</strong></span> commands you installed on        the host system.      </p>      <p>        Boot loading can be a complex area, so a few cautionary words are in        order. Be familiar with the current boot loader and any other        operating systems present on the hard drive(s) that need to be        bootable. Make sure that an emergency boot disk is ready to        &ldquo;<span class="quote">rescue</span>&rdquo; the computer if the        computer becomes unusable (un-bootable).      </p>      <p>        If you have multiple systems on your machine using a different        bootloader such as grub, you may prefer to use that instead - consult        the appropriate documentation. The rest of this section assumes you        are going to use lilo.      </p>      <p>        Earlier, we compiled and installed the Lilo boot loader software in        preparation for this step. The procedure involves writing a boot        image to a specific location on the hard drive. If you have a floppy        disk drive, or if you have installed a cd recording program, we        highly recommend using mkrescue to create a Lilo boot floppy, or CD        (using e.g. dvdrecord from dvdrtools) as a test and as a backup.      </p>      <p>        Normally, you interact with lilo by using the cursor and enter keys        to select from the available option(s), but sometimes it is necessary        to add other boot options, such as e.g. 'init=/bin/bash' to debug        boot failures. The more your keyboard layout differs from the US        qwerty layout, the harder it will be to type boot options unless lilo        knows about your keyboard layout. So, we will create a key table for        Lilo (.ktl) file - at one point in the documentation these are        referred to as .klt files, which may be a typo, but has been followed        by some distros. The name, and location, are not important but it is        conventional to put these in /boot with the name representing the key        layout. For a British keyboard layout, the following command will        achieve this:      </p>      <pre class="userinput"><kbd class="command">keytab-lilo.pl uk &gt;i${LFS}/boot/uk.ktl</kbd></pre>      <p>        The argument to the command is the name of the keymap, or if        necessary you can specify the full path to the keymap. Use whatever        is appropriate for your keyboard.      </p>      <p>        The next step is to create /etc/lilo.conf      </p>      <pre class="userinput"><kbd class="command">cat &gt; ${LFS}/etc/lilo.conf &lt;&lt; "EOF"<tt class="literal"># Begin /etc/lilo.conf# lilo.conf## global optionsboot=/dev/&lt;bootdisk&gt;keytable=/boot/&lt;keytable&gt;lba32map=/boot/mapprompt# set the name of the default image to bootdefault=lfs# define an imageimage=/boot/lfskernel    label=lfs    root=/dev/&lt;partition&gt;    read-only# optionally add parameters to pass, e.g.#   append="video=radeonfb:1024x768-16@70"# if you had an existing system, you could# add its details here.EOF</tt></kbd></pre>      <p>        Replace &lt;bootdisk&gt; with the name of the disk (or partition) on        which the boot sector is to be written, e.g. sda. Replace        &lt;keytable&gt; with the name of the keytable file you created, and        &lt;partition&gt; with the name of the root partition for the new        system.      </p>      <div class="warning">        <div class="admonhead">          <img alt="[Warning]" src="../images/warning.png" />          <h3 class="admontitle">            Warning          </h3>        </div>        <div class="admonbody">          <p>            The following command will overwrite any current boot loader. Do            not run the command if this is not desired. If you have            cross-compiled on a different machine from the target, you must            install the bootloader on the target machine, the installed boot            block is not a file which can be copied with <span><strong class=            "command">tar</strong></span>.          </p>        </div>      </div>      <p>        Run Lilo:      </p>      <pre class="userinput"><kbd class="command">/tools/bin/lilo-static -v</kbd></pre>      <div class="note">        <div class="admonhead">          <img alt="[Note]" src="../images/note.png" />          <h3 class="admontitle">            Note          </h3>        </div>        <div class="admonbody">          <p>            People who have been used to GRUB need to be aware that lilo            works differently - in particular, you cannot edit the available            choices as you can in the grub shell, and lilo records the block            addresses of the kernels into the boot blocks each time            /sbin/lilo is run. This means that when you compile a new kernel,            you have to add it to /etc/lilo.conf and rerun /sbin/lilo. It            also means that if you recompile an existing kernel and save it            to the same name you still have to rerun /sbin/lilo in case it            now occupies different blocks on the filesystem.          </p>        </div>      </div>    </div>    <div class="navfooter">      <ul>        <li class="prev">          <a accesskey="p" href="changingowner.html" title=          "Changing Ownership">Prev</a>          <p>            Changing Ownership          </p>        </li>        <li class="next">          <a accesskey="n" href="whatnext.html" title=          "What to do next">Next</a>          <p>            What to do next          </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-x86_64-Pure64">          Home</a>.        </li>      </ul>    </div>  </body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -