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

📄 ch52_05.htm

📁 the unix power tools
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 52] 52.5 Using the Power Tools CD-ROM </TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly &amp; Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly &amp; Associates, Inc."><METANAME="DC.date"CONTENT="1998-08-04T21:58:36Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-260-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="ch52_01.htm"TITLE="52. What's on the Disc"><LINKREL="prev"HREF="ch52_04.htm"TITLE="52.4 Quick Descriptions of What's on the Disc "><LINKREL="next"HREF="ch52_06.htm"TITLE="52.6 Don't Have a CD-ROM Drive? "></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><DIVCLASS="htmlnav"><H1><IMGSRC="gifs/smbanner.gif"ALT="UNIX Power Tools"USEMAP="#srchmap"BORDER="0"></H1><MAPNAME="srchmap"><AREASHAPE="RECT"COORDS="0,0,466,58"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="467,0,514,18"HREF="jobjects/fsearch.htm"ALT="Search this book"></MAP><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch52_04.htm"TITLE="52.4 Quick Descriptions of What's on the Disc "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 52.4 Quick Descriptions of What's on the Disc "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 52<BR>What's on the Disc</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch52_06.htm"TITLE="52.6 Don't Have a CD-ROM Drive? "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 52.6 Don't Have a CD-ROM Drive? "BORDER="0"></A></TD></TR></TABLE>&nbsp;<HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="SECT1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-9503">52.5 Using the Power Tools CD-ROM </A></H2><PCLASS="para">[In addition to this article,  be sure to read the file called README for any late-breaking news on using the CD-ROM. -LM]</P><PCLASS="para">The CD-ROM that comes with this book can be used in two different ways.First, it can be mounted just long enough for software to be copied ontoa local hard disk.In this respect, it is a distribution medium similar to magnetic tapes or floppy disks.Second, it can be mounted so that it is always present and availableas a local read-only hard disk.It will appear as a filesystem andyou can use familiar UNIX commands to peruse it.</P><DIVCLASS="sect2"><H3CLASS="sect2"><ACLASS="title"NAME="UPT-ART-9503-SECT-1.1">52.5.1 CD-ROM Formats </A></H3><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-62631"></A><ACLASS="indexterm"NAME="AUTOID-62633"></A><ACLASS="indexterm"NAME="AUTOID-62635"></A>The Power Tools CD conforms to the ISO standard 9660.This is sometimes called&quot;High Sierra,&quot; but there are differences between the two formats.The 9660 standardis what most CD-ROM drivers will support from now on, even though they will readHigh Sierra discs.</P><PCLASS="para">For UNIX users, ISO 9660 may come as a shock.  Forexample, a directory listing of an ISO 9660 disc might looklike this:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>ls /cdrom</B></CODE>ALPHA/      CONFIG1      HP700/       INSTINFO/   RS6000/    SUN4C/BUILD.PT*   CONFIG2.REV  I386/        LINUX/      SOURCES/COMMON/     CONFIG3.Z    INSTALL.PT*  README      SSOL2/</PRE></BLOCKQUOTE></P><PCLASS="para">ISO 9660 specifies that the filenames are mono-case, and limited to 8 characterswith 3-character extensions.If the filename doesn't contain a dot, one isadded at the end of the filename.A &quot;version number&quot; is also appended, followinga semicolon (version numbers are used in some non-UNIX filesystems suchas VMS).Some systems do not use all these features, so there are several variationsthat you will encounter.</P><PCLASS="para">For example, a file called <EMCLASS="emphasis">install.pt</EM> may appear as any of the following,depending on what system you mount the CD-ROM on:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">INSTALL.PT;1 INSTALL.PT install.pt;1 install.pt</PRE></BLOCKQUOTE></P><PCLASS="para">Directory names are simply 8 characters or less and mono-case.A directorycalled &quot;SOURCES&quot; can appear as <EMCLASS="emphasis">SOURCES</EM> or <EMCLASS="emphasis">sources</EM>. ISO 9660 also limits directory depth to 8 levels.</P><PCLASS="para">Note that the semicolon character (<CODECLASS="literal">;</CODE>) in version numbers needs to be <SPANCLASS="link">quoted (<ACLASS="linkend"HREF="ch08_14.htm"TITLE="Bourne Shell Quoting ">8.14</A>)</SPAN>when you are specifying the filename in aUNIX shell.If you don't quote such a filename, you'll get a message like this:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">INSTALL.PT: Command not found.1: Command not found.</PRE></BLOCKQUOTE></P><PCLASS="para">Luckily for you, we provide installation software that hides most of this ugliness.</P></DIV><DIVCLASS="sect2"><H3CLASS="sect2"><ACLASS="title"NAME="UPT-ART-9503-SECT-1.2">52.5.2 Mounting the CD-ROM </A></H3><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-62658"></A>For UNIX users, the CD-ROM should be made available as if it were a filesystem.In most cases, the standard <EMCLASS="emphasis">mount</EM> command can be used.This usually hasthe form:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>mount</B></CODE> <CODECLASS="replaceable"><I>CD-ROM_device mount_point</I></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">The CD-ROM device name varies depending on the type of system.If you do not knowthe device name, consult the documentation that comes with your system.On some systems, the SCSI ID of the CD-ROM device can vary.The SCSI IDwill be part of the device name&nbsp;- for example,<EMCLASS="emphasis">/dev/rz3c/</EM> is the CD-ROMat SCSI ID 3 on a DECstation.</P><PCLASS="para">The mount point is simply a directory that will become the parent directoryof the CD-ROM when it is mounted.</P><PCLASS="para">Most systems do not provide a way for unprivileged users to mount the CD.It is probably necessary to mount and use it as the<SPANCLASS="link">superuser (<ACLASS="linkend"HREF="ch01_24.htm"TITLE="The Superuser (Root) ">1.24</A>)</SPAN>.For this reason, the bulk of this article assumes some knowledge ofsystem administration and superuser commands.You may need to haveyour system administrator install the power tools software for you.</P><PCLASS="para">As the CDis read-only, you may have to specify this fact to the <EMCLASS="emphasis">mount</EM> program orit will generate an error if it tries to open the CD-ROM device forwriting.Some systems also need to be told the type of filesystembeing mounted if it is not the default (usually <CODECLASS="literal">ufs</CODE> or <CODECLASS="literal">nfs</CODE>).There may be options to the <EMCLASS="emphasis">mount</EM> program that control whether all theISO 9660 features (such as version numbers) are turned on.</P><PCLASS="para">For example, the CD can be mounted on a SunOS 4.1.1 system with thecommand:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>/etc/mount -r -t hsfs /dev/sr0 /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">This command mounts the CD (<EMCLASS="emphasis">/dev/sr0</EM>) on the mount point (<EMCLASS="emphasis">/cdrom</EM>)in a read-only fashion (<EMCLASS="emphasis">-r</EM>).<ACLASS="indexterm"NAME="AUTOID-62683"></A>If you omit the <EMCLASS="emphasis">-r</EM> option, <EMCLASS="emphasis">mount</EM> will give the following error:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">mount_hsfs: must be mounted readonlymount: giving up on:   /cdrom</PRE></BLOCKQUOTE></P><PCLASS="para">If you omit the filesystem type of <CODECLASS="literal">hsfs</CODE>(High Sierra Filesystem, which preceded the ISO 9660 format), you will get:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">mount: /dev/sr0 on /cdrom: Invalid argumentmount: giving up on:   /cdrom</PRE></BLOCKQUOTE></P><PCLASS="para">The procedure for mounting a CD-ROM varies with each type of operating system.You should consult the manual pages for the <EMCLASS="emphasis">mount</EM> command and lookfor a mention of CD-ROM, ISO 9660, or High Sierra:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>man mount</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">Some examples of <EMCLASS="emphasis">mount</EM> commands for the supported systems are:</P><DLCLASS="variablelist"><DTCLASS="term">Sun4 SunOS 4.1.4</DT><DDCLASS="listitem"><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>/etc/mount -r -t hsfs /dev/sr0 /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para"></P></DD><DTCLASS="term">IBM RS/6000 AIX 3.2</DT><DDCLASS="listitem"><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>/etc/mount -r -v cdrfs /dev/cd0 /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para"></P></DD><DTCLASS="term">HP 700 HP-UX</DT><DDCLASS="listitem"><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>/etc/mount -r -s cdfs /dev/dsk/c201d2s0 /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para"></P></DD><DTCLASS="term">SCO UNIX</DT><DDCLASS="listitem"><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>/etc/mount -r -fHS,lower,intr,soft,novers /dev/cd0 /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para"></P></DD><DTCLASS="term">Solaris</DT><DDCLASS="listitem"><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>/etc/mount -F -hsfs -r /dev/dsk/c0t4d0s0 /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para"></P></DD><DTCLASS="term">Alpha</DT><DDCLASS="listitem"><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>/usr/sbin/mount -t cdfs -o noversion /dev/rz3c /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para"></P></DD><DTCLASS="term">Linux</DT><DDCLASS="listitem"><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>/bin/mount -t iso9660 -o ro /dev/cdrom /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para"></P></DD></DL><PCLASS="para">An example of a <EMCLASS="emphasis">mount</EM> command on another system is:</P><DLCLASS="variablelist"><DTCLASS="term">SGI IRIX 4.x</DT><DDCLASS="listitem"><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>/usr/etc/mount -o ro,notranslate -t iso9660 \      /dev/scsi/sc0d5l0 /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">&#13;You can also start up the <EMCLASS="emphasis">cdromd</EM> process:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>cdromd -o ro,notranslate -d /dev/scsi/sc0d5l0 /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">To mount the disc, just insert it in the drive.To unmount it, usethe <EMCLASS="emphasis">eject</EM> command.</P></DD></DL><PCLASS="para">Once you have the CD-ROM mounted, you can run the installation program to copypre-compiled binaries off the CD and onto your system's hard disk.The installation program is Ready-to-Run Software's &quot;Smart Installation System.&quot;</P></DIV><DIVCLASS="sect2"><H3CLASS="sect2"><ACLASS="title"NAME="UPT-ART-9503-SECT-1.3">52.5.3 Installing Pre-Compiled Binaries </A></H3><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-62770"></A><ACLASS="indexterm"NAME="AUTOID-62773"></A>There are two software installation programs provided on the CD.The firstprogram &quot;installs&quot; pre-compiled binaries.The second program &quot;builds&quot; programsfrom source code.If you have one of the supported platforms, you can installsoftware off the CD-ROM and use it immediately.If your platform is not one ofthe supported platforms or you wish to change the software in some way, you shouldbe able to <SPANCLASS="link">build it from source code (<ACLASS="linkend"HREF="ch52_08.htm"TITLE="Building Programs from Source Code ">52.8</A>)</SPAN>.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-62777"></A>Binaries for the following platforms are on this CD-ROM:</P><ULCLASS="itemizedlist"><LICLASS="listitem"><PCLASS="para">Red Hat Linux 4.1</P></LI><LICLASS="listitem"><PCLASS="para">Sun4 Solaris 2.5</P></LI><LICLASS="listitem"><PCLASS="para">Sun4 SunOS 4.1.4</P></LI><LICLASS="listitem"><PCLASS="para">Digital Equipment Corp. 3.2</P></LI><LICLASS="listitem"><PCLASS="para">IBM RS/6000 AIX 3.2.5</P></LI><LICLASS="listitem"><PCLASS="para">HP 700 HP-UX 9.01</P

⌨️ 快捷键说明

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