📄 linux-kernel.html
字号:
module dependencies for these, see the <AHREF="compile-notes-modules">Note on modules</A>.</P><H4><A NAME="10"><A NAME="compile-notes">Notes on Compilation</A></A></H4><P><A NAME="compile-notes-sig11"><B>Note on sig11:</B></A><br> A<tt>signal 11</tt> error during kernel compilation means that <tt>gcc</tt>found an error in one of the files while compiling. <TT>sig11</TT>s, asthey are commonly referred to, are typically caused by bad hardware. Inmy (jbm) experience, they have been caused by bad processors, bad memory,and overclocked memory. With the popularity of 100MHz bus clock systems(ie: k6-2/3 and pII/pIII), there is an increasing number of peopleoverclocking RAM. I know, I do it myself. I often get <TT>sig11</TT>messages during compiles, when the computer is getting hot. My generalstrategy for dealing with these is to lower system load (close x, stoplistening to MP3s, etc), and recompile the whole kernel. Because this is akernel-level file, do not simply remove the .o file and move on. Thiscould lead to system damage.<H4><A NAME="11">Where to Copy the Kernel</A></H4><P>When you're copying the kernel to where it's supposed to be, that maychange from system to system. You can use what I have up there if you'reon a standard Red Hat system; if you're using Slackware, it's not in<TT>/boot</TT>--it's in <TT>/</TT>. So instead of<TT>/boot/vmlinuz-2.2.zz-new</TT>, it's <TT>/vmlinuz-2.2.zz-new</TT>.</P><P>We use the vmlinuz-2.2.zz-new for safety's sake. If you forgotsomething essential in your kernel, your computer wouldn't be able to bootwith the new kernel. Unfortunately, this makes life a little morecomplicated now, but it's not so bad. All you have to do is edit<TT>/etc/lilo.conf</TT> (a somewhat daunting task, but really prettysimple).</P><H4><A NAME="12">Editing <TT>/etc/lilo.conf</TT></A></H4><P><TT>/etc/lilo.conf</TT> is the settings file for <B>lilo</B>, the LInuxLOader. Editing this file can be hazardous to the health of your computer. Before you edit it, make a backup copy of it (<TT>cp /etc/lilo.conf/etc/lilo.conf.backup-foo</TT>, or some other name you can remember.). This backup is in case you accidentally delete a line in the file. If youneed to restore your old lilo.conf, just do <TT>cp /etc/lilo.conf.backup-foo /etc/lilo.conf</TT> and start anew. Now then -to the real work with lilo.conf</P><P>Open up <TT>/etc/lilo.conf</TT> in your favorite text editor. The fileshould look something like this:<PRE># LILO configuration file# generated by 'liloconfig'## Start LILO global sectionboot = /dev/hda#compact # faster, but won't work on all systems.delay = 50vga = normal # force sane state# ramdisk = 0 # paranoia setting# End LILO global section# Linux bootable partition config beginsimage = /vmlinuz root = /dev/hda2 label = Linux append = "ether=9,0x310,eth0 mem=64M"# Linux bootable partition config ends# DOS bootable partition config beginsother = /dev/hda1 label = DOS table = /dev/hda# DOS bootable partition config ends</PRE><P>What you want to do is this: copy the section from "image =vmlinuz" through to the "# Linux bootable partition configends"(or the next "image =" line, if you have one) letterfor letter right below where it currently is, like so:</P><PRE># LILO configuration file# generated by 'liloconfig'## Start LILO global sectionboot = /dev/hda#compact # faster, but won't work on all systems.delay = 50vga = normal # force sane state# ramdisk = 0 # paranoia setting# End LILO global section# Linux bootable partition config beginsimage = /vmlinuz root = /dev/hda2 label = Linux append = "ether=9,0x310,eth0 mem=64M"image = /vmlinuz root = /dev/hda2 label = Linux append = "ether=9,0x310,eth0 mem=64M"# Linux bootable partition config ends# DOS bootable partition config beginsother = /dev/hda1 label = DOS table = /dev/hda# DOS bootable partition config ends</PRE><P>If you don't have a "delay = xx" line, or if xx is equal to0, change it to "delay = 50" (without the quotes). By addingthis line, you instruct LILO to wait 5 seconds for you to enter in akernel image to load before it automatically boots the first one in thelist (in this case Linux). Now change the second "image =/vmlinuz" (or "image = /boot/vmlinuz") line to "image= /vmlinuz-2.2.zz-new" (xx is the version number, like 2.2.4). Alsochange the second "label = Linux" line to "label =New". This section of the file now looks like this:</P><PRE>image = /vmlinuz root = /dev/hda2 label = Linux append = "ether=9,0x310,eth0 mem=64M"image = /vmlinuz-2.2.zz-new root = /dev/hda2 label = New append = "ether=9,0x310,eth0 mem=64M"</PRE><P>Save the file to lilo.conf. Now type in <TT>lilo</TT> at the commandprompt. It should give you output similiar to this:</P><PRE>Added Linux *Added NewAdded DOS</PRE><P>If you encounter any error when you type <TT><B>lilo</B></TT> thenthere the kernel is probably in a differnt locataion than the image = linesays. Check that, and look for capitialization problems.</P><P>Reboot, and when the LILO: comes up, hit left-shift (or any other keythat happens to please you), and then type in "new" (withoutquotes, again). This will boot the image labeled new -/vmlinuz-2.2.zz-new. If this boots and works well, just do <TT>cp /vmlinuz/vmlinuz-backup</TT> and <TT>cp /vmlinuz-2.2.zz-new /vmlinuz</TT>. Open up<TT>/etc/lilo.conf</TT> again and change the New section to be name =backup, with the image being /vmlinuz-backup. If you don't want the LILOboot prompt, comment out the delay = 50 line (stick a # in front of it). Now type <TT>lilo</TT> at a prompt and if lilo installs well, tryrebooting to make sure both your new kernel and your backup kernelwork.</P><H4><A NAME="13">PPP Support in the Kernel</A></H4><P>Before compiling, make sure you enable PPP support during <TT>makeconfig</TT> or <TT>make menuconfig</TT>. It's left to be NOT supported onmost of the kernels I've compiled so far (maybe because the kerneldevelopers have high-speed digital connections), but if you connect toyour ISP through PPP, you better enable this or else you'll have torecompile later on to connect to the Internet.</P><H4><A NAME="14">Math Coprocessor/FPU</A></H4><P>If you don't have a math coprocessor (if your CPU is a 386DX or 486SXwithout a math coprocessor), make sure you say <B>YES</B> on <B>kernelmath emulation</B>. This is what stopped me the first two times; I forgotabout the <B>EMULATION</B> part. If you have a tape drive, SCSI interface,or any other weird or expensive stuff then go through <B><TT>makeconfig</TT></B> very carefully to optimize your system. If you have a486DX, Pentium, or higher processor with normal system specs, then justbrowse through configuration a bit and be careful. This may get boring(especially if you have to do it three times to get it right), but stillread through it before jumping to compilation. Eventually you'll knowwhat's there to configure and you'll just zoom past it.</P><H4><A NAME="15">Unresolved Modules?</A></H4><P>You might see some errors/complaints about "unresolvedmodules" when you're booting the new kernel. Whatever the cause is,try moving your old module directory in <TT>/lib/modules</TT> (or whereveryour kernel module directory is) to <TT>/lib/oldmodules/</TT>. Forexample, when I boot up and some errors pop up about my 2.2.4 modulesbeing unresolved, I might go into <TT>/lib/modules/2.2.4</TT> and move themodules that are being complained about. To avoid these errors, do <TT>cp-r /lib/modules/2.2.yy /lib/oldmodules/; rm -rf /lib/modules/2.2.yy</TT>before you do <TT>make modules</TT> and <TT>make modules_install</TT>.(For example, if I were recompiling Linux 2.2.4 and I already had modulesfor 2.2.4 installed, I would type <TT>cp -r /lib/modules/2.2.4/lib/oldmodules/; rm -rf /lib/modules/2.2.4</TT> before I went andcompiled the modules). The unresolved modules error is quite common forthe first few times you complie the kernel and has stumped Linux newbiesworldwide. Of course, you could just delete the old modules directory(<TT>rm -rf /lib/modules/2.2.4</TT> for example), but it is generally abad idea to delete things you might wind up needing if the compile doesn'tgo quite right (also a common problem for your first few compiles ;^) ).So just move things around.</P><P>I've had a problem while compiling development kernels (those startingwith 2.1) that complains about unresolved modules; I thought I needed toupdate a few programs, and I was right. I found the page at <AHREF="http://www.linuxhq.com/pgmup21.html"TARGET="_top">http://www.linuxhq.com/pgmup21.html</A>.</P><H3><A NAME="16">Comments</A></H3><P><!-- Simon's comments --><tt>You might wish to add that when you use an <b>RPM</b> kernel version, itappears to come in separate kernel-source and kernel-headers files.<br><a href="simon.hampton@tvd.be">Simon Hampton <simon.hampton@tvd.be></a><!-- /simon's comments --></tt><P>(The bold is my own, to stress the importance of <fontsize="+1"><b>RPM</b></font> here. This particular problem is due to abroken-by-design strategy on the part of the RPM package maintainers. Iguess it keeps package size down, at a large convenience/stability cost.-jbm)</P><H3><A NAME="17">Authors' Notes</A></H3><!-- Include information here about sig11 messages --><P>Some people using SCSI on their Linux box <I>may</I> have problemscompiling the kernel. Since I don't have SCSI installed on my system, Idon't know what to do. However, Jeffrey here seems to know. If any of youSCSI users have been having the same problem, please verify thisinformation with me so that I'll sound more confident. :)</P><PRE>Here's a list of my in's and out's of getting the SCSI modules to bootwith your new kernel.* After you have made the kerenel and modules i.e. "make zImage" and "make modules" make sure that your loopback device is available try "insmod loop" OR maybe it isn't a module or just complied in straight then you don't have RHL installed and this isn't for you!, This is default as a module with RHL along with everything else* Another trap that I found is that with comfiguring the Kerenel with "make xconfig" at a res of 640x480 the two buttons at the bottom are cut off and I kept on going to just close the window and wonder why the kerenel wouldn't compile! * After you have inseted the loopback device, do a "make modules_install" to install the new modules (including you brand new SCSI drivers!) (Don't forget to back up the old set of modules in case you stuffed on the "insmod loop" and need to reinsert it later! * Now just type "mkinitrd /boot/initrd 2.2.3" where the filename points to the image file in the lilo.conf and the version of your new kerenel is there and present! The program mkinitrd works off your /etc/config.modules file! * FEW THINGS TO REMEMBER! - Don't forget to back up your old kernels and old initrd image file!, you never know this MAY not work successfully! (I know I have stuffed it up completely about 10 times!) :( anyway this booted for me on both options the old and linux in LILO then copy your new kerenel into it's final home and RUN LILO! Jeffrey Borg<A HREF="mailto:jeffrey@tudogs.net.au">jeffrey@tudogs.net.au</A></PRE><HR><P>Comments, questions, suggestions, corrections? Send them to <AHREF="mailto:jbm@intertek.net">jbm@intertek.net</A> - if they're my mistakeI'll reply, if not I'll forward them on to Joshua.</P><HR><P><B><FONT SIZE="-1">Copyright © 1997-1999 <AHREF="mailto:jgo@local.net">Joshua Go (jgo@local.net)</A>.All rights reserved. Permission to use, distribute, and copy this documentis hereby granted. You may modify this document as long as credit to meis given.</FONT></B></P><P><B><FONT SIZE="-1">jbm hereby grants all copyright permissions hehas to Joshua Go. In other words - it's still Joshua's property, althoughI'd like a little credit if you use this document.</FONT></B></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -