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

📄 buildmin-5.html

📁 讲述建立最小系统流程!!入门值得一看和一学
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML><HEAD> <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9"> <TITLE>How To Build a Minimal Linux System from Source Code: Lilo</TITLE> <LINK HREF="buildMin-6.html" REL=next> <LINK HREF="buildMin-4.html" REL=previous> <LINK HREF="buildMin.html#toc5" REL=contents></HEAD><BODY><A HREF="buildMin-6.html">Next</A><A HREF="buildMin-4.html">Previous</A><A HREF="buildMin.html#toc5">Contents</A><HR><H2><A NAME="s5">5. Lilo</A></H2><P>Lilo comes with a neat script called <CODE>QuickInst</CODE>. Unpack the lilosource into the target source directory, run this script with the command<CODE>ROOT=/mnt/target ./QuickInst</CODE>. It will ask you questions abouthow you want lilo installed. <P><P>Remember, since we have set <CODE>ROOT</CODE>, to the target partition, you tell it file names relative to that. Sowhen it asks what kernel you want to boot by default, answer <CODE>/boot/bzImage</CODE> <EM>not</EM> <CODE>/mnt/target/boot/bzImage</CODE>.I found a little bug in the script, so it said <P><PRE>        ./QuickInst: /boot/bzImage: no such file </PRE><P>But if you just ignore it, it's ok.<P><P>Where should we get <CODE>QuickInst</CODE> to put the boot sector? When we reboot we want to have the choice of booting into the source systemor the target system, or any other systems that are on this box.And we want the instance of lilo that we are building now to loadthe kernel of our new system. How are we going achieve both of thesethings? Let's digress a little and look at how lilo boots DOS on a dual boot Linux system. The <CODE>lilo.conf</CODE> file on such a systemprobably looks something like this:<P><P><PRE> prompt  timeout = 50default = linuximage = /boot/bzImage         label  = linux        root   = /dev/hda1        read-onlyother = /dev/hda2        label = dos</PRE><P><P><P>If the machine is set up this way, then the master boot record gets read andloaded by the bios, and it loads the lilo bootloader, which gives a prompt. If you type in <CODE>dos</CODE> at the prompt, lilo loads the boot sector fromhda2, and it loads DOS.<P><P>What we are going to do is just the same, except that the boot sector inhda2 is going to be another lilo boot sector - the one that <CODE>QuickInst</CODE>is going to install. So the lilo from the Linux distribution will load thelilo that we have built, and that will load the kernel that we have built.You will see two lilo prompts when you reboot.<P><P>To cut a long story short, when <CODE>QuickInst</CODE> asks you where to put theboot sector, tell it the device where your target filesystem is, eg. <CODE>/dev/hda2</CODE>.<P><P>Now modify the <CODE>lilo.conf</CODE> on your source system, so it hasa line like<P><PRE> other = /dev/hda2        label = target</PRE><P>run lilo, and we should be able to do our first boot into the target system.<P><HR><A HREF="buildMin-6.html">Next</A><A HREF="buildMin-4.html">Previous</A><A HREF="buildMin.html#toc5">Contents</A></BODY></HTML>

⌨️ 快捷键说明

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