📄 ch05.htm
字号:
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<H1></H1>
<UL>
<LI><A HREF="#Heading1">- 5 -</A>
<UL>
<LI><A HREF="#Heading2">Special Installations</A>
<UL>
<LI><A HREF="#Heading3">Determining What Tools You Have Installed</A>
<UL>
<LI><A HREF="#Heading4">FIGURE 5.1.</A>
<LI><A HREF="#Heading5">FIGURE 5.2.</A>
<LI><A HREF="#Heading6">FIGURE 5.3.</A>
</UL>
<LI><A HREF="#Heading7">The installpkg Utility</A>
<LI><A HREF="#Heading8">Generating a New Kernel</A>
<LI><A HREF="#Heading9">CAUTION</A>
<LI><A HREF="#Heading10">Setting the Default Video Mode</A>
<LI><A HREF="#Heading11">Accessing DOS Files</A>
<LI><A HREF="#Heading12">Configuring mtools</A>
<LI><A HREF="#Heading13">TIP</A>
<LI><A HREF="#Heading14">Handling Multiple CD-ROMs</A>
<LI><A HREF="#Heading15">CAUTION</A>
<LI><A HREF="#Heading16">Adding New File Systems</A>
<LI><A HREF="#Heading17">Linux Loadable Modules</A>
<LI><A HREF="#Heading18">Summary</A>
</UL>
</UL>
</UL>
<P>
<HR SIZE="4">
<H2 ALIGN="CENTER"><A NAME="Heading1<FONT COLOR="#000077">- 5 -</FONT></H2>
<H2 ALIGN="CENTER"><A NAME="Heading2<FONT COLOR="#000077">Special Installations</FONT></H2>
<P><I>by Kamran Husain</I></P>
<P><BR>
IN THIS CHAPTER</P>
<UL>
<LI>Determining What Tools You Have Installed
<P>
<LI>The installpkg Utility
<P>
<LI>Generating a New Kernel
<P>
<LI>Setting the Default Video Mode
<P>
<LI>Accessing DOS Files
<P>
<LI>Configuring mtools
<P>
<LI>Handling Multiple CD-ROMs
<LI>Adding New File Systems
<P>
<LI>Linux Loadable Modules
</UL>
<P>This chapter covers a variety of topics that basically could not fit in other
chapters, nor could they justify a chapter by themselves. We cover these topics briefly
and provide locations where you can get more information:
<UL>
<LI>Determining what tools you have installed
<P>
<LI>The <TT>installpkg</TT> utility
<P>
<LI>Generating a new kernel
<P>
<LI>Setting the default video mode
<P>
<LI>Accessing DOS files
<P>
<LI>Configuring <TT>mtools</TT>
<P>
<LI>Handling multiple CD-ROMs
<P>
<LI>How to address some problems accessing the disc
<P>
<LI>Making a file system
</UL>
<H3 ALIGN="CENTER"><A NAME="Heading3<FONT COLOR="#000077">Determining What
Tools You Have Installed</FONT></H3>
<P>The version of Linux on the CD-ROM at the back of this book has the <TT>pkgtool</TT>
utility for you to use. (See Figure 5.1 for this tool's main screen, which includes
a list of some of its features.) You see the screen in Figure 5.1 when you install
Linux. If you have a color monitor, you will see this in color.<BR>
<BR>
<A NAME="Heading4<A HREF="../ART/05/0501.jpg"><FONT COLOR="#000077">FIGURE
5.1.</FONT></A><FONT COLOR="#000077"> </FONT><I>The main screen for <TT>pkgtool</TT>.</I></P>
<P><TT>pkgtool</TT> can be used to install packages from CD-ROM or mounted floppy
disks, or in any mounted directory. You can then view what types of packages are
available for your system and remove or add them as necessary.</P>
<P>To view the contents of a package, move the blue highlighted bar down to the <TT>View</TT>
selection and press Enter. You can also type <TT>V</TT> to go directly to this selection.
After you press Enter, you will see another screen, as shown in Figure 5.2.
<H6></H6>
<P><A NAME="Heading5<A HREF="../ART/05/0502.jpg"><FONT COLOR="#000077">FIGURE
5.2.</FONT></A><FONT COLOR="#000077"><I> </I></FONT><I>The <TT>View</TT> <TT>package
</TT>screen.</I></P>
<P>Let's look at the contents of the <TT>bison</TT> package by using the arrow keys
to scroll down to <TT>bison</TT> and then pressing Enter. You are presented with
the screen as shown in Figure 5.3. You can scroll up and down in this screen to get
the complete listing by using <TT>vi</TT> movement commands (<TT>j</TT> or <TT>k</TT>)
or the arrow keys on your keyboard.
<H6></H6>
<P><A NAME="Heading6<A HREF="../ART/05/0503.jpg"><FONT COLOR="#000077">FIGURE
5.3.</FONT></A><FONT COLOR="#000077"> </FONT><I>The <TT>bison</TT> <TT>View</TT>
screen.</I></P>
<P>Now you can decide if you want this package by reading its description. If you
feel that you would never use a parser generator, then by all means wipe this package
off your disk. (Think twice if you intend to take a compiler class any time in the
future.) To delete this package, you have to go back to the main menu. Press Enter
to select EXIT. You will return to the view selection screen. Select the Cancel button
with the arrow key and press Enter. Then to remove a package, select the Remove option
from the <TT>pkgtool</TT> main menu.</P>
<P>Depending on the speed of your computer, you will most certainly have to wait
while you view a message telling you about how many BogoMIPS this is going to take.
You can toggle the selection of any packages by using the spacebar. Press Enter when
you are done or select the Cancel button if you want to bail out now.
<H3 ALIGN="CENTER"><A NAME="Heading7<FONT COLOR="#000077">The installpkg Utility</FONT></H3>
<P>The <TT>installpkg</TT> utility creates <TT>*.tgz</TT> packages for distributing
Linux files. This program has four modes of operation:
<UL>
<LI><TT>installpkg package_name</TT>. By itself, it will install the <TT>*.tgz</TT>
package you specified in the system. For example, <TT>installpkg flex.tgz</TT> will
install <TT>flex</TT> on your system for you.
<P>
<LI><TT>installpkg -warn package_name</TT>. This will not do the installation process,
but simply tells you what it's about to do.
<P>
<LI><TT>installpkg -r package_name</TT>. This recursively installs the files in the
root directory from your current directory.
<P>
<LI><TT>installpkg -m package_name</TT>. This will make a package for you given all
the files in the directory you happen to execute this is in.
</UL>
<P>Information about all of the installed packages on your system is stored in <TT>/var/adm/packages</TT>.
Any related script files are stored in <TT>/var/adm/scripts</TT>.</P>
<P>The <TT>removepkg</TT> utility is used to remove packages that are listed in the
<TT>/var/adm/packages</TT> directory. There is a <TT>-warn</TT> option that tells
you what files will be removed but are not actually removed yet. Do not use the <TT>removepkg</TT>
utility unless you are absolutely sure that the files in this package are not used
elsewhere.
<H3 ALIGN="CENTER"><A NAME="Heading8<FONT COLOR="#000077">Generating a New
Kernel</FONT></H3>
<P>You will have to install a new kernel if:
<UL>
<LI>After installation, the Linux kernel does not have the features that the boot
disk kernel had. For example, when you used the boot disk, you could access your
CD-ROM, but the kernel on the hard disk does not recognize it!
<P>
<LI>You want to add more features to the kernel. See Chapter 56, "Working with
the Kernel."
<P>
<LI>The kernel Linux installed for you is very big and you want a leaner, meaner
kernel that uses less memory.
</UL>
<P>To compile a custom kernel for your hardware, follow these steps:
<DL>
<DD><B>1.</B> If you haven't installed the C compiler and kernel source, do that
by running <TT>installpkg</TT> (discussed above).<BR>
<B><BR>
2.</B> Use the <TT>bootkernel</TT> disk you created at the time you installed Linux.
At the LILO prompt, enter <TT>mount root=/dev/hda1</TT>. Ignore any error messages
as the system starts up.<BR>
<B><BR>
3.</B> Change to <TT>root</TT>.<BR>
<B><BR>
4. </B>Go to <TT>/usr/src/linux</TT>.<BR>
<B><BR>
5.</B> Run the command <TT>make config</TT>.<BR>
<B><BR>
6. </B>Choose your drivers and so on.<BR>
<B><BR>
7. </B>These four commands will build and install the new kernel to work with LILO:
</DL>
<PRE><FONT COLOR="#0066FF"># make dep
# make clean
# make zlilo
# rdev -R /newkernel
</FONT></PRE>
<DL>
<DT><FONT COLOR="#0066FF"></FONT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading9<FONT COLOR="#000077"><B>CAUTION:</B> </FONT>Before performing
these steps, be sure to read Chapter 56 in its entirety. Compiling a kernel (without
proper precautions) that does not match your system configuration can yield your
Linux installation unmountable.
<HR>
</DL>
<H3 ALIGN="CENTER"><A NAME="Heading10<FONT COLOR="#000077">Setting the Default
Video Mode</FONT></H3>
<P>You don't have to recompile the kernel to set the default video mode. Just use
<TT>rdev</TT> with the <TT>-v</TT> switch to set the video mode in the kernel (either
on your hard drive or on your boot floppy). For example, to change the kernel in
<TT>/vmlinuz</TT> to prompt for the video mode on bootup, type the following:</P>
<PRE><FONT COLOR="#0066FF">rdev -v /vmlinuz -3
</FONT></PRE>
<P>To change the kernel on your boot floppy, type</P>
<PRE><FONT COLOR="#0066FF">rdev -v /dev/fd0 {video-mode}
</FONT></PRE>
<P>These are the valid video-mode options for the kernel: -3 Prompt the user for
a response every time</P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -