Application Packaging Developer's Guide
只搜尋這本書
以 PDF 格式下載這本書

Distributing Software on CD-ROM

1

Introduction

After you have completed development of your software, you need to put the software on media in a form that can be easily installed by users. The media should be packaged with any documentation required for your product before being distributed to customers.
CD-ROM is the best medium available for the distribution of data. For this reason, all SunSoft software is released on CD-ROM. Some features of CD-ROM include:
  • Large capacity - 644 megabytes of digital data, or 325,000 pages, saving several trees.
  • Multimedia - Can contain text, images, graphics, and high quality sound data.
  • Portable - Unlike hard disks, CD-ROMs can be easily moved.
  • Stable storage - CD-ROMs are optical, not magnetic, and are read-only. They can't be accidentally erased or overwritten.
  • Low cost - About $2 each to produce. Making 100 CD-ROMs is break-even with tape.
  • Mass produced - Injection molded, not magnetically duplicated.
  • High quality - Digital error correction means fewer data errors.
  • Interchangeable - All CD-ROMs are the same at the bit level. Almost any CD-ROM player can read ISO 9660 formatted CD-ROMs.
  • Interactive - Random-access file system allows execution from the CD-ROM.
CD-ROMs are random-access devices that can be directly mounted by the operating system. Unlike tapes, CD-ROMs are not limited to serving as serial input/output devices.
Software can be published on a CD-ROM in a serial format such as tar or can be published as a complete file system. The latter is preferred since it enables the individual data files to be directly accessed or executed from the CD-ROM.
Direct access and execution benefits the user because the software does not have to consume scarce disk resources before it is used. For trial and demonstration uses, installation time can be drastically reduced since the CD-ROM file system only has to be mounted, not copied and installed onto hard disk.
This chapter describes how to create a CD-ROM image for your application and prepare it for mass duplication. An image is a device-independent electronic representation of your data and software.
The SVR4 application packaging tools provide a means to bundle the files for your application into one installable unit. You provide several text files describing the contents of the package and where the contents should be installed. Chapter 2, "Application Packaging," describes how to use the SVR4 packaging tools to create a package that can be placed on CD-ROM.
After you have created a package, you should verify that it installs correctly. Tools such as pkgchk(1M) help you verify the installation. Chapter 3, "Installing and Checking Packages," describes these tools.
You may want to use Software Manager for installation of your application. Software Manager provides a graphical user interface to the SVR4 packaging tools. Software Manager also provides a way to group the files in your application into clusters, which simplifies the installation process for large applications by enabling users to select the clusters to be installed. Chapter 4, "Using Software Manager," decribes how to set up clusters for your package.

Manufacturing a CD-ROM

Several tasks are required to produce a CD-ROM and bring it to publication. Experience at SunSoft shows that some of these tasks can be done at the same time, in particular, documentation and software development. Figure 1-1 illustrates the development cycles for each. If you can perform these processes independently, you can save time.

圖形

Figure 1-1

Documentation

Three kinds of documentation can accompany a CD-ROM:
  • Documentation and artwork printed on heavy insert stock
  • Artwork silkscreened on the disc itself
  • Separate, traditional documentation printed on paper
The traditional paper documentation for CD-ROM will probably differ only slightly from your documentation for tape release. You will need to modify your installation instructions to discuss CD-ROM installation and may want to add a short discussion of the CD-ROM medium.
You also need to consider what type of paper documentation is needed. Typically, there are three kinds of paper documentation: user's guide, developer's guides, and system administration manuals. Your application may only require a user's guide. But if a system administrator needs to install and configure the software, you probably want to include a manual or section for administrators, too.
If manual pages accompany your software, you need to make sure the manual pages have the correct section numbers. The contents of the manual page sections are as follows:
  • Section 1 - describes user commands and applications
  • Section 1M - describes system administration commands
  • Section 2 - describes system calls
  • Section 3 - describes user-level library routines
  • Section 4 - describes device drivers, protocols, and network interfaces
  • Section 5 - describes the format of files used by various programs
  • Section 6 - describes games
  • Section 7 - contains miscellaneous information, mostly relating to troff macro packages
  • Section 9 - provides an overview of DDI/DKI device driver interface specifications
  • Section 9E - describes DDI/DKI driver entry points
  • Section 9F - describes DDI/DKI kernel functions
  • Section 9S - describes DDI/DKI data structures

CD-ROM Packaging

Each CD-ROM can be packaged in a jewel box, a small plastic case, or a less expensive paper sleeve. In addition to the CD-ROM disc, the jewel box contains an insert and a J-card.

Insert

The insert slides into the front cover of the CD-ROM jewel box, and usually serves as the product label. Inserts usually include the file system format type, part numbers, and trademark and copyright information associated with the specific product. If your documentation is short enough, you can include it in the insert, as well.
The insert can be one page with text and artwork, or it can be several pages long. In fact, a small booklet can be produced, with artwork for the cover of the jewel box and text describing the product and giving simple installation instructions. Keep in mind, however, that the printing may be quite small and difficult to read on the insert.

J-card

The optional J-card is a printed card with a small folded edge that fits into the back of the CD-ROM jewel box. It typically has the product name and part number, which can be read by the user without opening the jewel box. It serves the same function as printing on the spine of a book. The J-card can give basic information instead of an insert, allowing the artwork on the disc itself to show through the front cover.
The artwork for the J-card and CD-ROM insert are prepared by a graphic artist. The artwork is assembled at the manufacturer's location with the CD-ROM and jewel box.

CD-ROM Artwork

The CD-ROM itself can have label art, but the amount of information that can be put on the label is limited because of the CD-ROM size. The disc artwork should include product name, company name and address, part number, revision level, trademark, copyright, and a list of platforms on which it runs. It can also have limited boot instructions or state the file system format type.

Delivery to the CD-ROM Manufacturer

Documentation production has a long lead time. Because the printing is done by an external vendor for your company, you have limited control of the schedule. The CD-ROM manufacturer, or its subcontractor, usually takes four weeks to produce a first article (a completed CD-ROM used to verify artwork and contents) from camera ready artwork. This time could be accelerated by coordinating your own printing locally, but your printed materials would have to be integrated with the finished CD-ROM after the manufacturing process. Schedules for lead times can be negotiated with your manufacturer.
Contact the CD-ROM manufacturing company early to discuss requirements and limitations for creating and printing insert text and graphics, because each vendor has different specifications.
Plan to deliver the camera ready disc artwork, the insert copy artwork, and the optional J-card artwork to the CD-ROM manufacturer. The manufacturer places the printed material and the disc in the jewel box and then shrink-wraps the jewel box in clear plastic.

圖形

Figure 1-2

Putting Your Software on CD-ROM

The simplest way to make a CD-ROM for distribution is to create a CD-ROM image of your application on magnetic disk and transfer that image to tape for delivery to a CD-ROM mass producer. However, this approach gives you no opportunity to test an actual CD-ROM version of your product. You may also want more control or require more involvement in the process.
Every company has a different process to release and manufacture a product. At a minimum, the following steps are necessary to transfer your software to CD-ROM:
  1. Completing the application code.

  2. Building the source into an executable media image.

  3. Testing the image and installation.

  4. Verifying the master image.

  5. Mass producing the CD-ROM media (by the manufacturer).

  6. Receiving the finished goods and combining with documentation for distribution.

The rest of this section explains each of these steps in more detail.
  1. After the application code source is complete, all the data that makes up the product is collected in one location. The file system structure layout must be determined by this time. See the section "File System Formats" on page 12.

  2. At build time, quality audits are done and a prototype executable is made. When the prototype media image is satisfactorily built, you have to choose how to hand off this image to be tested. Because CD-ROM is a read-only random-access file system, this image could be simulated electronically, using a read-only magnetic disk image of the CD-ROM file system for testing on a magnetic disk partition. If applicable to your product, this electronic handoff would provide you more opportunities for testing before you actually create a CD-ROM.

    A more complex option is to use an actual CD-ROM for testing. The CD-ROM can be created in a variety of ways. One common way is to take a magnetic tape with a CD-ROM image to a CD-ROM service bureau. For a

fee, usually $600 to $800 (check with various service bureaus), the service bureau creates a CD-ROM using a pre-mastering or one-off machine. Many CD-ROM manufacturing facilities offer these services.
You could also purchase your own one-off system, if your CD-ROM production quantity requires it. A one-off machine produces each copy of the CD-ROM individually, so a one-off machine is not usually used for high volume manufacturing of CD-ROMs. The CD-ROM medium itself is more expensive than tape and can cost from $35 to $80 each, depending on volume and discount.
  1. The media image is handed off to testing. The image must be tested against all configurations of systems on which it is expected to operate. It is extremely important to test the installation process. For manual or automated installation testing, having a CD-ROM one-off is invaluable.

  2. When all tests have been completed, the final image must be captured for mass production. When you want to cut a CD-ROM, you need to put it on the medium that your CD-ROM manufacturing facility can accept. Contact the manufacturer for the appropriate medium. In many cases the manufacturer expects the master image on a tape, sometimes on EXATAPE(R) 8mm data cartridges.

    An outline of the basic steps to lay out your file system for the Rock Ridge format (the recommended file system format for CD-ROMs) is provided in "Using Rock Ridge to Create a CD-ROM" on page 18. The software toolkit for creating a CD-ROM in the Rock Ridge format is available from Young Minds, Inc. Please consult your Catalyst Catalog.

    If your application contains any audio data, you will need to contact the manufacturer to find out the medium and format required to handle this data. For example, some manufacturers require that you provide this data on Digital Audio Tape (DAT) at 44.1 KHz.

  3. If you use an external CD-ROM manufacturer, you can expect a turnaround ranging from one day to several days, depending on the quantity and how much you are willing to pay for faster turnaround. In general, it costs about $800 to $2500 to set up the master, and approximately $2 for each CD-ROM produced. Required turnaround time and quantities affect these numbers. The process at the CD-ROM manufacturing factory usually follows the path shown in Figure 1-3.

The CD-ROM manufacturer transfers the image from your tape master to a glass master. From this, a metal stamping tool is produced. This tool is used to manufacture the CD-ROMs. A limited number of CD-ROMs, called check discs or first articles, can be produced and returned to you for a final media check against your original media image.
Depending on the manufacturer, the media check can be done at several different stages. Some manufacturers may produce a data proof for early review. A data proof is a disc with a generic label but the actual data image on the disc. For review at a later stage a manufacturer may produce a first article, a disc with the actual data image and the actual label artwork.
The media check is an optional step that can take time, but it is your safety net. If there is any discrepancy, you may save yourself the cost of remastering and redoing an expensive mass production run. The cost and conditions for these review services can be negotiated with your CD-ROM manufacturer.
When all is satisfactory, the CD-ROM manufacturer can begin mass production of your CD-ROMs.
  1. The CD-ROM manufacturer returns CD-ROMs to you in jewel boxes with optional inserts, all in shrink-wrapped packages. These can then be packaged with documentation for distribution. For an additional fee, some manufacturers handle the distribution as well. Check with them for fees and schedules.

圖形

Figure 1-3

File System Formats

There are nine levels of information on a CD-ROM as shown in Table 1-1. There are standards for the lowest three levels of the CD-ROM (file/volume, data, and physical). This section discusses the file system format (file/volume in Table 1-1) level.
Table 1-1
User Interface
Applications
Operating System Extensions
Device Driver
Hardware Interface
Drive/Commands
File/Volume (High Sierra, ISO 9660, UFS, Rock Ridge)
Data
Physical

High Sierra

In 1985, several CD-ROM and computer manufacturers met and agreed upon a common format for file systems on CD-ROM. The format covers the logical structure (file system format); the physical structure is the same as for music CD-ROMs. This logical structure became known as the High Sierra File System (HSFS).
HSFS fit naturally into a DOS environment, supporting various DOS features and naming conventions. Unfortunately, it did not support several UNIX(R) features.

ISO 9660

In 1988, the International Organization for Standardization (ISO) adopted a superset of the HSFS requirements as the ISO 9660 standard. This standard included support for the VMS(R) operating system.
Though any file system format can be used, the international standard for CD-ROM is ISO 9660. Many different types and classes of computers read ISO 9660, allowing data interchange among the different ISO 9660 compatible systems. For example, a database application on a CD-ROM could contain the data, plus access software for UNIX, Apple Macintosh(R), MS-DOS(R) and other types of systems.
Unfortunately, ISO 9660 is a least-common-denominator approach and has several limitations in an IEEE/POSIX or X/Open environment such as the SunOS operating system:
  • File names are limited in length and allowable characters
  • The depth of subdirectories is limited to seven
  • File mode bits are not fully supported

UFS

Since any bit pattern can be written to a CD-ROM, alternatives to ISO 9660 can be used. For example, the file format used by Solaris on hard disks, UFS, can also be used on CD-ROM. However, UFS is not effective for CD-ROM use because UFS was designed for both reading and writing. Therefore, UFS can be slower than ISO 9660. More importantly, UFS is not a CD-ROM standard and does not offer the data interchange capabilities of ISO 9660. The advantage of UFS is that it does not have the naming and other limitations of ISO 9660.

Rock Ridge Extensions to ISO 9660

To provide UNIX functionality on the ISO standard, a set of UNIX extensions has been proposed as a solution. These extensions are known as the Rock Ridge Extensions. Rock Ridge adds all the functionality UNIX needs in the file system, such as directory depths greater than eight levels and symbolic links to files.
Features of the Rock Ridge Extensions The Rock Ridge extensions support capabilities that are not available under the MS-DOS or VAX VMS operating systems for which the ISO 9660 was designed. These capabilities include support for mixed-case names, long filenames, special characters, directory structures deeper than seven levels, symbolic links, special file types, setuid, setgid and sticky bits, as well as more efficient encoding of user and group IDs and permissions.
When mounted on a system that supports the Rock Ridge format, such as Solaris 1.x system or later, all the UNIX file system information is available to the user. On systems that support only the ISO 9660, all the file content is available to the user (minus some of the UNIX file system information), supporting the major goal of the ISO 9660 information interchange.
The combination of the ISO 9660 and the Rock Ridge extensions provide an exceptional blend of flexibility and performance. Rock Ridge CD-ROMs execute 25% to 30% faster than UFS images recorded on CD-ROMs, yet support complete POSIX file system semantics. Further, the Rock Ridge protocols are a nonproprietary, open specification being implemented by many of the major UNIX vendors. The protocols promise support within heterogeneous networks, including multiple product lines from a single vendor. Multiplatform software vendors can also use a single Rock Ridge format CD-ROM to distribute their products for many or all the platforms they support.
Rock Ridge Proposal Group Sixteen technology companies, known collectively as the Rock Ridge Group, worked to develop a CD-ROM file format that is completely compatible with ISO 9660, yet removes the naming and other restrictions mentioned above. In Solaris 1.x, Solaris 2.x, and up, SunSoft supports this new file system in addition to the CD-ROM file systems already supported.

Choosing a File System Format

As a software developer who wants to publish software via CD-ROM, you have four options:
  • ISO 9660 format with tar (or cpio or similar) files. The tar files can contain long names and unlimited subdirectories. The files cannot be directly executed or read from the CD-ROM. Existing Solaris applications can easily be ported with this method. The CD-ROM can be read by most systems, allowing software for multiple systems to be published on the same CD-ROM.
  • ISO 9660 format as a file system. The files must conform to ISO 9660 naming restrictions. For pre-existing UNIX applications, this requirement can create a great deal of work. SunSoft does not provide third-party tools for producing CD-ROMs using the ISO 9660 file system format.
  • UFS format as a file system. The files can be directly read and executed from the CD-ROM. There are no additional file naming restrictions beyond those in Solaris. Existing Solaris applications can be ported to CD-ROM easily; however, performance is not optimal because this is not the CD-ROM standard.
  • Rock Ridge format as a file system. When the CD-ROM is created, a utility can be used to automatically create ISO 9660 file names from the longer UNIX file names. "Makedisc" is a utility with this capability; it is available from Young Minds, Inc., a Catalyst vendor: (714) 335-1350. Check your Catalyst Catalog for others.

    If you are interested in using the Rock Ridge file system format for your CD-ROM image, refer to the outline of basic steps provided in the section "Using Rock Ridge to Create a CD-ROM" on page 18.

The Solaris system software supports CD-ROMs encoded using High Sierra, ISO 9660, UFS, and Rock Ridge formats.

Installing Software from CD-ROM

The goal of installation is to move code from a distribution medium to a customer's system. CD-ROM simplifies this, because the customer handles only one CD-ROM instead of multiple tapes or diskettes.
Your installation instructions should tell the user to insert the CD-ROM into the CD-ROM caddy before inserting it into the CD-ROM drive. Some CD-ROM devices, like home audio units, do not have a caddy.
The user does not need to mount the CD-ROM; it is automatically mounted by the volume management software.
The installation method you choose depends upon the product format you select for laying out your files on the CD-ROM. The product format is largely independent of the file system you choose, with the exception of the limitations already mentioned for ISO 9660.
For Solaris 2.x releases, Sun is standardizing on the Rock Ridge file system format for both OS and unbundled product CD-ROMs. SVR4 software packages is the standard API that is used for the product format, both for OS and unbundled product CD-ROMs. A second-generation tool, Software Manager (swmtool), can be used as an easy-to-use installation tool and as a frontend to the Package utilities such as pkgadd and pkgrm. Software Manager is bundled
with Solaris 2.x and is available for use as an installation tool for any product that uses SVR4 Packages and conforms to the Software Manager API. See the Administration Application Reference Manual for more information.
A CD-ROM file system toolkit is a set of tools and utilities that enables you to easily transition to CD-ROM for distributing computer-based materials. The critical component is a CD-ROM formatting utility that converts a UNIX file system to a CD-ROM disc image compliant with the ISO 9660 international standard format. If the utility also supports the Rock Ridge extensions to the ISO 9660, the resulting CD-ROM retains all the UNIX file system features.

Software Packaging

The System V ABI specifies a new model, called software packages, for the distribution format of applications. Software that is formatted with the ABI model is guaranteed to install correctly, easily, and in a similar manner on all ABI-compliant systems. All software producers, including applications programmers and developers of device drivers, kernel modules, and other system software for Solaris 2.x, should use the software packages model and packaging tools. See Chapter 2, "Application Packaging," for more information on the packaging tools.
If you distribute your software as one or more software packages, you can instruct the user to install this software with either of the package installation facilities bundled with Solaris: generic ABI package commands (pkgadd) or the Software Manager. See the Administration Application Reference Manual for more information.

Generic Package Interface

If you document the ABI package commands as your preferred means of installation, you need to provide instructions for each of the following functions:
You do not need to provide instructions for mounting the CD-ROM. The CD-ROM is mounted automatically by the volume management software when it is inserted in the drive.
The packaging commands do not let the user run demonstration programs or display text files. If you are using pkgadd, your user documentation should describe how to manually perform these functions. For example, the documentation should indicate the location of any demonstrations, ASCII text files, or Postscript files included with your product. (If you include Postscript files, you should describe how to display them with pageview(1) or another tool.)
The Software Manager, on the other hand, enables the user to run demos and display ASCII or Postscript text. As a result, if you use Software Manager for the installation interface, you do not need to provide as much documentation. See the Administration Application Reference Manual for more information.

Executing Applications from CD-ROM

CD-ROM can be used for execution as well as distribution. CD-ROM is a random-access file system, so you can execute your application directly from the mounted CD-ROM without installing it onto a magnetic disk first. This can save magnetic disk resources.
There are three things that must be considered when executing directly from CD-ROM:
  • Make sure the application does not try to create files on the distribution file system. For example, don't let the application write a log file to ./logfile. In the past, this was not a problem because you loaded the product onto magnetic disk where you had write permission. But if you execute directly from the CD-ROM, you cannot write to it, because it is a read-only medium.
  • The application should not rely on an absolute mount point. The application should use path names that are relative to the mount point instead.
  • Performance. An optical disk is slower than a magnetic hard disk.

Using Rock Ridge to Create a CD-ROM

This section describes how to put application software on a CD-ROM that is usable under Solaris system software. The procedures described in this section explain how to make a mountable UFS file system, containing your software, that can be transferred to CD-ROM. The topics covered include:
  • How to create a file system you can use on CD-ROM
  • Transferring your files to this file system
  • Making an image of the file system that can be used to create a CD-ROM
At the end of this section is a brief discussion of the steps required to make a mountable Rock Ridge file system.
This material does not describe how to prepare audio tracks to be placed on CD-ROM, nor does it address the specific techniques for transferring the file system or audio tracks to a CD-ROM. These techniques should be explained by the CD-ROM mastering machine documentation.

CD-ROM File System Creation Procedure

The steps for creating a file system to put on a CD-ROM are as follows:
  1. Determining which files will be on the CD-ROM

  2. Finding a disk partition for the file system

  3. Creating the file system

  4. Mounting the file system

  5. Transferring your files to the file system

  6. Unmounting the file system

  7. Making an image of the file system

  8. Testing the image before transferring it to CD-ROM

Determining Which Files Go on the CD-ROM Choose the directories and files that you want to put on the CD-ROM file system. Keep in mind that this is a read-only file system.
You should create a clean directory structure containing only the files and directories you want to put on the file system. This makes the tasks of determining the size required for the file system and transferring the files to the file system much easier.
Finding a Disk Partition Find or create a disk partition large enough to hold the file system. A reasonable minimum size is one and a half times the size of the directory hierarchy you want to place on the CD-ROM. The maximum size is the size of the CD-ROM, roughly 600 Mbytes. Choosing a size closer to the minimum saves storage space and CD-ROM creation time. It also leaves space on the CD-ROM for audio tracks.
Creating and Mounting the File System Create a file system in the partition and mount the file system. See File System Administration for information about creating and mounting file systems.
Transferring Your Directory Structure to the File System Copy your files to the new file system. The directory structure should be as you want it on your CD-ROM. Make sure all file attributes, such as permissions, modes, and links, are set correctly.
Unmounting the File System See the File System Administration for information on unmounting file systems.
Making a Rock Ridge Image of the File System Use the third party tool you have selected to create a Rock Ridge image of the UFS file system created in the preceding step. After the Rock Ridge file system image is created, it can be copied to a standard disk, and tested.
To copy the partition to a regular file, use dd as follows:

  # dd if=/dev/rpart of=cdromimage  

where part is the device for the disk partition containing the file system and cdromimage is the name of the file where the image should be put.
If you are copying the image to a tape, you probably have to specify block size. Block size is determined by your tape drive and by the equipment the tape will be read on. Your CD-ROM mastering equipment or the company mastering your CD-ROM will specify this. Find a suitable block size (such as 8Kbyte) and use dd as follows:

  # dd if=/dev/rpart of=/dev/rmt0 obs=8k  

where part is the device for the disk partition containing the file system. If needed, replace rmt0 with the correct name for the tape drive.
If the entire image won't fit on a single tape, use a series of dd commands to transfer the image, as follows:

  (insert first tape)  
  # dd if=/dev/rpart of=/dev/rmt0 bs=8k count=16000 skip=0  
  (when done, insert second tape)  
  # dd if=/dev/rpart of=/dev/rmt0 bs=8k count=16000 skip=16000  
  (then the third tape)  
  # dd if=/dev/rpart of=/dev/rmt0 bs=8k count=16000 skip=32000  
  (etc)  

using the device for your disk partition for part. Replace rmt0 with the correct name for the tape drive. Replace the 16000 following count with the capacity of your tape drive (in 8Kbyte blocks), and increase the skip value by this amount for each successive tape.
Testing Your CD-ROM Master When you receive your CD-ROM master, check the contents. The CD-ROM is automatically mounted by the volume management software when it is inserted in the drive. The mount point will be /cdrom/cdrom_name.
Make sure its contents are the same as your original directory structure.