📄 00000063.htm
字号:
Edit the /etc/lilo.conf file to add your new kernel. Use the lines from the <BR>image=/vmlinuz line to the next image= line or the
<BR>end. Duplicate what you see, then change the first line to image=/zImage <BR>(assuming your kernel is in the root directory) and
<BR>choose a different name for the label=. The first image in the file is the <BR>default, others will have to be specified on the
<BR>command line in order to boot them. Save the file and type:
<BR>
<BR>lilo
<BR>
<BR>You will now see the kernel labels, and the first one will have an asterisk. <BR>If you don't see the label that you gave your new kernel
<BR>or LILO terminates with an error, you'll need to redo your work in <BR>/etc/lilo.conf (see LILO man pages).
<BR>
<BR>We're almost ready to reboot. At this point, if you know your system will <BR>only require one reboot to run properly, you might want
<BR>to issue the command:
<BR>
<BR>depmod -a 2.0.x
<BR>
<BR>where x is the minor number of the kernel you just built. This command <BR>creates the dependencies file some modules need. You'll
<BR>also want to make sure you don't boot directly into xdm. For Red Hat type <BR>systems, this means ensuring the /etc/inittab file doesn't
<BR>have a default run level of 5, or that you remember to pass LILO the run <BR>level at boot time. For Debian systems, you can just type:
<BR>
<BR>mv /etc/init.d/xdm /etc/init.d/xdm.orig
<BR>
<BR>for now and move it back later.
<BR>
<BR>
<BR>
<BR>Normal Rebooting the New Kernel
<BR>
<BR>Reboot your machine using:
<BR>
<BR>shutdown -r now
<BR>
<BR>While typing reboot or pressing the ctrl+alt+del key combination usually <BR>works, I don't recommend either one. Under
<BR>some circumstances, the file systems won't be properly unmounted and could <BR>corrupt open files. At the LILO prompt, if you need
<BR>to boot the old kernel or pass some parameters for bootup and you don't see <BR>the boot: prompt, you can try pressing either the
<BR>shift or ctrl key, and the boot: prompt should appear. Once you have it, <BR>press tab to see the available kernel labels. Type
<BR>the label and optionally enter any parameters for bootup. Normally, however, <BR>the default kernel should boot automatically after the
<BR>timeout interval specified in the /etc/lilo.conf file. During bootup, you may <BR>see a few error messages containing: SIOCADDR or
<BR>the like. These usually indicate that a module (normally a network module) <BR>didn't load. We'll handle this shortly. If you got the
<BR>error, ``VFS, cannot mount root'', you didn't compile the proper disk or <BR>file-system support into the kernel.
<BR>
<BR>
<BR>
<BR>Troubleshooting
<BR>
<BR>Due to the different ways in which each distribution handles daemon startup <BR>from /etc/inittab, it is difficult in this article to cover all
<BR>the possible reasons your bootup may not have gone smoothly and the reasons <BR>why. However, I can tell you where to start
<BR>looking.
<BR>
<BR>First, run depmod -a to ensure you have an up-to-date, module dependency file <BR>(it will be created in the appropriate
<BR>subdirectory). If you get a string of errors about unresolved dependencies, <BR>old modules are present in the modules subdirectories,
<BR>and you didn't configure the kernel with ``Module Versions'' enabled. This is <BR>not a fatal error. The modules you compiled and
<BR>installed are good. Check the /etc/conf.modules file and make sure that any <BR>lines pointing to /lib/modules are complete:
<BR>
<BR>/lib/modules/`uname -r`/xx
<BR>
<BR>(Note: the grave quote on each side of uname -r is located above the Tab key <BR>in the upper left corner of the keyboard on a
<BR>U.S. keyboard).
<BR>
<BR>Make sure kerneld is running and that it is loaded early in the bootup <BR>process. If it is, then the system doesn't need to explicitly
<BR>load modules, kerneld will handle it. Be careful about calling kerneld too <BR>early in the first rc script. kerneld will stop the bootup
<BR>process forcing a hard reboot via the reset button or power switch, if it is <BR>called before the system knows its host name. If this
<BR>happens to you, you can reboot passing LILO the -b argument which prevents <BR>init from executing any rc scripts. Next, look in
<BR>/etc/rc.d/ at the rc, rc.sysinit and rc.modules files. One or more may point <BR>to a directory such as /etc/modules/`uname -r`/`uname
<BR>-v` where a list of bootup modules are located. You can just copy the old <BR>file over to the new directory;
<BR>
<BR>mkdir /etc/modules/`uname -r` ;
<BR>cp /etc/modules/2.0.xx/g#1 Thu 3 Sep 1997.\
<BR> default /etc/modules/`uname -r`/\
<BR> `uname -v`.default""
<BR>
<BR>Your system will almost certainly have a different date for the modules file. <BR>Your system also may or may not use the default
<BR>extension. Pay close attention to the use of grave quotes and double quotes <BR>in the above example, since both are needed in the
<BR>proper places. Once you have found the keys to your system, you should be <BR>able to reboot into a properly functioning system. If
<BR>you experience further problems, the best place to get quick, expert advice <BR>is on a mailing list dedicated to your particular
<BR>distribution. Those successfully running a particular distribution usually <BR>delight in assisting novices with problems they may
<BR>encounter. Why? Because they hit the same brick walls when they were novices <BR>and received help with many problems. Lurk a
<BR>few days on a list, and if your question isn't asked by someone else, ask it <BR>yourself. Check the mail-list archives first, if any are
<BR>present. These archives contain answers to frequently asked questions (FAQ). <BR>
<BR>
<BR>
<BR>
<BR>Conclusion
<BR>
<BR>While building a kernel tailored to your system may seem a daunting challenge <BR>for new administrators, the time spent is worth it.
<BR>Your system will run more efficiently, and more importantly, you will have <BR>the satisfaction of building it yourself.
<BR>
<BR>The few areas where you may encounter trouble are in remembering to rerun <BR>LILO after installing the new kernel, but you didn't
<BR>overwrite your old one (or did you?), so you can always revert to one that <BR>worked from the lilo: prompt. Distribution specific
<BR>problems during bootup may also be encountered during the first reboot but <BR>are usually easily resolved. Help is normally only an
<BR>e-mail away for those distributions that don't come with technical support.
<BR>
<BR>
<BR>
<BR> <BR>-- <BR> 白马带著她一步步的回到中原。白马已经老了,只能慢慢的走, <BR>但终是能回到中原的。江南有杨柳、桃花,有燕子、金鱼…… <BR>汉人中有的是英俊勇武的少年,倜傥潇洒的少年……但这个美 <BR>丽的姑娘就像古高昌国人那样固执: <BR> <BR> 「那都是很好很好的,可是我偏不喜欢。」 <BR> <BR>※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 202.99.18.67] <BR><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -