📄 lilo.html
字号:
<HTML><HEAD><TITLE>Making the LFS system bootable</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.63"><LINKREL="HOME"TITLE="Linux From Scratch"HREF="../index.html"><LINKREL="UP"TITLE="Making the LFS system bootable"HREF="../chapter08/chapter08.html"><LINKREL="PREVIOUS"TITLE="Installing a kernel"HREF="../chapter08/kernel.html"><LINKREL="NEXT"TITLE="The End"HREF="../chapter09/chapter09.html"></HEAD><BODYCLASS="sect1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Linux From Scratch: Version 3.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="../chapter08/kernel.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 8. Making the LFS system bootable</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="../chapter09/chapter09.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="ch08-lilo">8.4. Making the LFS system bootable</A></H1><P>In order to be able to boot the LFS system, we need to update ourbootloader. We're assuming that your host system is using Lilo (sincethat's the most commonly used boot loader at the moment).</P><P>We will not be running the lilo program inside chroot. Running liloinside chroot can have fatal side-effects which render your MBR uselessand you'd need a boot disk to be able to start any Linux system (eitherthe host system or the LFS system).</P><P>First we'll exit chroot and copy the lfskernel file to the host system:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>logout</B></TT><TTCLASS="userinput"><B>cp $LFS/boot/lfskernel /boot</B></TT></PRE></FONT></TD></TR></TABLE></P><P>The next step is adding an entry to /etc/lilo.conf so that we canchoose LFS when booting the computer:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cat >> /etc/lilo.conf << "EOF"</B></TT>image=/boot/lfskernel label=lfs root=<partition> read-only<TTCLASS="userinput"><B>EOF</B></TT></PRE></FONT></TD></TR></TABLE></P><P><partition> must be replaced with the LFS partition's designation.</P><P>Also note that if you are using reiserfs for your root partition,the line <TTCLASS="userinput"><B>read-only</B></TT> should be changed to<TTCLASS="userinput"><B>read-write</B></TT>.</P><P>Now, update the boot loader by running:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>/sbin/lilo</B></TT></PRE></FONT></TD></TR></TABLE></P><P>The last step is synchronizing the host system's liloconfiguration files with the LFS system's:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cp /etc/lilo.conf $LFS/etc &&</B></TT><TTCLASS="userinput"><B>cp <kernel images> $LFS/boot</B></TT></PRE></FONT></TD></TR></TABLE></P><P>To find out which kernel images files are being used, look at the/etc/lilo.conf file and look for the lines starting with<EM>image=</EM>. If your host system has kernel files inother places than the /boot directory, make sure you update the pathsin the $LFS/etc/lilo.conf file so that it does look for them in the/boot directory.</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="../chapter08/kernel.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="../chapter09/chapter09.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Installing a kernel</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../chapter08/chapter08.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">The End</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -