📄 yaboot.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> 12.4. 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-PowerPC"> <div class="navheader"> <div class="headertitles"> <h4> Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-PowerPC </h4> <h3> Chapter 12. Making the LFS System Bootable </h3> </div> <ul class="headerlinks"> <li class="prev"> <a accesskey="p" href="kernel.html" title="Linux-2.6.16.5">Prev</a> <p> Linux-2.6.16.5 </p> </li> <li class="next"> <a accesskey="n" href="../the-end/chapter.html" title= "The End">Next</a> <p> The End </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 12. Making the LFS System Bootable">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-PowerPC"> Home</a> </li> </ul> </div> <div class="sect1" lang="en" xml:lang="en"> <div class="titlepage"> <h1 class="sect1"> 12.4. Making the LFS System Bootable </h1> </div> <p> Your shiny new LFS system is almost complete. One of the last things to do is to ensure that the system can be properly booted. The instructions below apply only to NewWorld Macintoshes and (probably) PegasosPPC. </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 CD is ready to “<span class="quote">rescue</span>” the computer if it becomes un-bootable. </p> <p> Earlier, we compiled and installed the yaboot boot loader software in preparation for this step. The procedure involves writing the bootloader to a bootstrap partition and blessing it so that OpenFirmware will boot from it. This is all handled by <span><strong class="command">ybin</strong></span> the yaboot installer. </p> <p> Ybin assembles all the information it needs by reading yaboot.conf, then writes the bootstrap. When booted, the bootstrap provides an initial menu to choose between linux, boot from CD, and e.g. osx (depending on what was in yaboot.conf). If you boot to 'linux', yaboot kicks in and lets you select which kernel to use. </p> <p> Images (kernels) are specified, together with any necessary path, in yaboot.conf - the details are incorporated into the bootloader, but no attempt is made to access or validate the paths until they are selected. There are many possible options that can be specified in yaboot.conf, see the man page for the details. Most people will be able to specify device=hd: (for a single hard disk), but if you have multiple disks, or if you wish to be pedantic, you can specify the full OF path to the device, obtained by running <span><strong class= "command">ofpath</strong></span>. </p> <p> Note that the man page mentions which filesystems yaboot can navigate to find the images - the only linux filesystem type mentioned is ext2. You can use ext3 because that can be read like ext2, but if you wish to use reiserfs or any other filesystem you may need to create a separate boot partition formatted as ext2. </p> <p> Using the above information, determine the appropriate designators for the bootstrap partition and the root partition. For the following example, it is assumed that the bootstrap partition is <tt class= "filename">hda2</tt> and the root partition is <tt class= "filename">hda7</tt> . We will also assume that you wish to be able to boot an OSX installation on <tt class="filename">hda4</tt>. Change these items as necessary for your machine. </p> <p> Create a “<span class="quote">yaboot.conf</span>” file defining yaboot's boot menu: </p> <pre class="userinput"><kbd class="command">cat > /etc/yaboot.conf << "EOF"<tt class="literal"># Begin /etc/yaboot.conf# By default, yaboot will boot the first menu entry.# Allow 10 seconds before booting the default.# this will also apply to the first-stage os selectortimeout=100# These variables are global# first, where to put the bootstrap partitionboot=/dev/hda2# Which disk to usedevice=hd:# Default partition for the kernel imagespartition=7# default root partitionroot=/dev/hda7# where ybin is to find yaboot and ofboot install=/usr/lib/yaboot/yabootmagicboot=/usr/lib/yaboot/ofboot# allow the initial menu to offer CD as an optionenablecdboot# allow the initial menu to boot from mac osxmacosx=/dev/hda4# The first entry is for LFS.# For all images, the pathname is relative to the filesystem# on which they are mounted.image=/boot/lfskernel-2.6.16.5 label=CLFS-SVN-20060417 read-only</tt>EOF</kbd></pre> <p> Add an entry for the host distribution, if you have one. It might look something like this if the kernel and initrd are in the host's '/' directory on <tt class="filename">hda6</tt>: </p> <pre class="userinput"><kbd class="command">cat >> /etc/yaboot.conf << "EOF"<tt class="literal">title Debianimage=/pci@f4000000/ata-6d/disk@0:6,/vmlinux label=Debian initrd=/pci@f4000000/ata-6d/disk@0:6,/initrd.gz initrd-size=10000 append="root=/dev/hda7" read-only</tt>EOF</kbd></pre> <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 the current boot loader. Do not run the command if this is not desired. </p> </div> </div> <pre class="userinput"><kbd class="command">ybin</kbd></pre> <p> Alternatively, if the bootstrap partition has not already been initialized, perhaps because you are using a Live CD, you will need to use a different command to install the bootloader for the first time: </p> <pre class="userinput"><kbd class="command">mkofboot</kbd></pre> </div> <div class="navfooter"> <ul> <li class="prev"> <a accesskey="p" href="kernel.html" title="Linux-2.6.16.5">Prev</a> <p> Linux-2.6.16.5 </p> </li> <li class="next"> <a accesskey="n" href="../the-end/chapter.html" title= "The End">Next</a> <p> The End </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 12. Making the LFS System Bootable">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-PowerPC"> Home</a>. </li> </ul> </div> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -