📄 kernel.html
字号:
<HTML><HEAD><TITLE>Installing a kernel</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="Creating the /etc/fstab file"HREF="../chapter08/fstab.html"><LINKREL="NEXT"TITLE="Making the LFS system bootable"HREF="../chapter08/lilo.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/fstab.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="../chapter08/lilo.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="ch08-kernel">8.3. Installing a kernel</A></H1><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen">Estimated build time: Depends on options selectedEstimated required disk space: Depends on options selected</PRE></FONT></TD></TR></TABLE><P>Building the kernel involves a few steps: configuring it and compilingit. There are a few ways to configure the kernel. If you don't like theway this book does it, read the <TTCLASS="filename">README</TT> that comeswith the kernel source tree, and find out what the other options are.</P><P>Something you could do, is take the .config file from your hostdistribution's kernel source tree and copy it to $LFS/usr/src/linux.This way you don't have to configure the entire kernel from scratch andcan use your current values. If you choose to do this, first run themake mrproper command below, then copy the .config file over, then runmake menuconfig (make oldconfig may be better in some situations. Seethe <TTCLASS="filename">README</TT> file for more details when to use makeoldconfig).</P><P>The following commands are run to build the kernel:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cd /usr/src/linux &&</B></TT><TTCLASS="userinput"><B>make mrproper &&</B></TT><TTCLASS="userinput"><B>make menuconfig &&</B></TT><TTCLASS="userinput"><B>make dep &&</B></TT><TTCLASS="userinput"><B>make bzImage &&</B></TT><TTCLASS="userinput"><B>make modules &&</B></TT><TTCLASS="userinput"><B>make modules_install &&</B></TT><TTCLASS="userinput"><B>cp arch/i386/boot/bzImage /boot/lfskernel &&</B></TT><TTCLASS="userinput"><B>cp System.map /boot</B></TT></PRE></FONT></TD></TR></TABLE></P><P>Note: the arch/i386/boot/bzImage path may vary on different platforms.</P><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN4508">8.3.1. Dependencies</A></H2><P>Linux-2.4.8 needs the following to be installed:</P><PCLASS="literallayout"><br>sh from the bash package<br><br>ar from the binutils package<br>as from the binutils package<br>ld from the binutils package<br>nm from the binutils package<br>objcopy from the binutils package<br><br>chown from the fileutils package<br>cp from the fileutils package<br>ln from the fileutils package<br>mkdir from the fileutils package<br>mv from the fileutils package<br>rm from the fileutils package<br><br>find from the findutils package<br>xargs from the findutils package<br><br>gcc from the gcc package<br><br>grep from the grep package<br><br>make from the make package<br><br>awk from the mawk package<br><br>depmod from the modutils package<br>genksyms from the modutils package<br><br>hostname from the net-tools package<br><br>sed from the sed package<br><br>basename from the sh-utils package<br>date from the sh-utils package<br>expr from the sh-utils package<br>pwd from the sh-utils package<br>uname from the sh-utils package<br>whoami from the sh-utils package<br>yes from the sh-utils package<br><br>cat from the textutils package<br>md5sum from the textutils package<br>sort from the textutils package<br>tail from the textutils package<br>touch from the textutils package<br>tr from the textutils package<br></P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="../chapter08/fstab.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="../chapter08/lilo.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Creating the /etc/fstab file</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../chapter08/chapter08.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Making the LFS system bootable</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -