Application Packaging Developer's Guide: 2550 Garcia Avenue Mountain View, CA 94043 U.S.A
Application Packaging Developer's Guide: 2550 Garcia Avenue Mountain View, CA 94043 U.S.A
Guide
Please
Recycle
Contents
iii
Package Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Required Package Components . . . . . . . . . . . . . . . . . . . . . . . 27
Optional Package Components . . . . . . . . . . . . . . . . . . . . . . . 28
Package Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
A Package Creation Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Assigning a Package Abbreviation . . . . . . . . . . . . . . . . . . . . 32
Defining a Package Instance. . . . . . . . . . . . . . . . . . . . . . . . . . 32
Defining Object Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Defining Package and Object Locations . . . . . . . . . . . . . . . . 36
Writing Your Installation Scripts . . . . . . . . . . . . . . . . . . . . . . 37
Creating the pkginfo File . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Defining Package Dependencies . . . . . . . . . . . . . . . . . . . . . . 39
Writing a Copyright Message. . . . . . . . . . . . . . . . . . . . . . . . . 40
Reserving Additional Space on the Installation Machine. . 40
Distributing Packages over Multiple Volumes. . . . . . . . . . . 40
Creating the prototype File. . . . . . . . . . . . . . . . . . . . . . . . . 40
Creating a Package with pkgmk. . . . . . . . . . . . . . . . . . . . . . . 47
Transferring the Package to the Media with pkgtrans. . . 50
Installation Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
The Request Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
The Procedure Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
The Class Action Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3. Installing and Checking Packages . . . . . . . . . . . . . . . . . . . . . . . 65
The Installation Software Database . . . . . . . . . . . . . . . . . . . . . . . 66
Contents v
Case #4a: Using the sed Class and a postinstall Script 95
Case #4b: Using Classes and Class Action Scripts. . . . . . . . 98
Case #4c: Using the build Class . . . . . . . . . . . . . . . . . . . . . . 101
Case #5: Using crontab in a Class Action Script . . . . . . . . 103
Case #6: Installing a Driver. . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Case #7:Using the sed Class and postinstall and
preremove Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
vii
viii Application Packaging Developer’s Guide—August 1994
Figures
ix
x Application Packaging Developer’s Guide—August 1994
Preface
Audience
This guide is for developers who are writing applications intended to run
under Solaris® system software.
Chapter 3, “Installing and Checking Packages,” describes the tools for verifying
that a package has been installed correctly.
xi
Chapter 4, “Using Software Manager,” describes how to use clusters and
meta-clusters when packaging software for installation with Software Manager.
The following table describes the type changes and symbols used in this book.
Typeface or
Symbol Meaning Example
AaBbCc123 The names of commands, files, Edit your .login file.
and directories; on-screen Use ls -a to list all files.
computer output system% You have mail.
xiii
Complete code samples should compile and work as represented. Code
fragments, while not compiled, reflect high standards of coding accuracy.
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.
1
1
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.
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.
Testing
CD Mastering at Vendor
Final Verification
Software Distribution
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.
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.
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.
CD Mastering at Vendor
Final Verification
Software 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.
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.
3. 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.
4. 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®
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.
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.
CD Mastering at Vendor
Tape Master
Glass Master
Metal Stamping Tool
Production CD-ROMs
Final Verification
Software Distribution
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®
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® operating system.
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.
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.
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.
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
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.
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.
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.
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.
# 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.
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:
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.
Make sure its contents are the same as your original directory structure.
This chapter describes application packages and the tools used to create a
package. The following topics are covered:
• What a package is and what it is used for
• Licensing considerations for packages
• Installation media format and file organization
• Package components
• A package build scenario
• Custom installation scripts
21
2
The components of a package fall into two categories: package objects, the files
to be installed; and control files, which control how and where the package is
installed.
Table 2-1 shows the commands and control files available to help you create a
package. These commands and files are described in more detail in the
following sections and in the man pages.
Business Operations
Before you begin distributing licensed software, set up your business
operations to distribute, price, and track licenses. There are a variety of ways to
distribute licenses, such as fax, electronic mail, or an 800 telephone number.
You need to choose a method of distribution and set up all the necessary
processes. You also need to consider whether licenses need to be upgraded
with the software and how this will be done.
Pricing policy and types of licenses must also be considered. You must
consider how the product is used and what kinds of licenses your users will
need to use the product effectively. Single user licenses may not be appropriate
for many situations.
Technology
If you are going to use a commercial product for licensing, there are many
things to consider when making your choice. You need to decide what your
priorities are. For example, is ease of administration and use most important?
Or is enforcing the licensing policy more important?
Application Packaging 23
2
You also need to consider whether the software will be used in a
heterogeneous or homogeneous environment and whether standards are
important. You may also want to look at the security provided by the product.
Is it easy to get around the enforcement of licenses?
Installation Media
Application software packages are installed from the distribution media. In
addition to CD-ROM distribution media, SunOS 5.x supports the physical
distribution media listed in the following:
• SPARC systems: System V Application Binary Interface SPARC Processor
Supplement
• x86 systems: System V Application Binary Interface Intel386 Processor
Supplement
Packages are stored as a data stream on the distribution media. There are two
types of data streams: continuous and segmented. The continuous data stream
is valid for all media. The segmented data stream is valid for media that
support multiple sequential files, media with a no rewind mode of operation
(such as a 9-track tape). For the segmented data stream, each of the logical
parts of the data stream is an individual file. For the continuous data stream,
all logical parts on a given volume of media are contained in a single file. Both
data stream types can be created using the pkgmk and pkgtrans utilities.
Packages can also be stored as a standard file system that allows distribution of
multiple packages on large removable media, such as Winchester disks or
optical discs. These types of distribution media are not supported by the ABI.
In a standard file system media format, the application package(s) form a tree
of spooled packages. The file system can be mounted and packages installed
using pkgadd from that spooled package file system.
Package Components
To package your applications, you must create the required and optional
components that make up your package, then use the packaging tools to build
the package.
As shown in Figure 2-1, the contents of a package fall into three categories:
• Required components (the pkginfo (4) file, the prototype (4) file, and
package objects)
• Optional package information files
• Optional installation scripts
Optional package
information files
pkginfo prototype
file file
Package
objects
Objects can be
grouped into classes
Optional packaging
scripts
Application Packaging 25
2
Required Optional
Optional
Information Information
Scripts
Files Files
Developer
compver Input
prototype depend request script Package
pkginfo space other scripts Objects
copyright
pkgmk Tool
admin files
pkgadd
pkgask responses
Configuration
management
(pkginfo, pkgparam)
These are the components that make up the software. They can be
• Files (executable or data)
• Directories
• Named pipes
• Links
The prototype file is a required package information file that lists the
components of the package. It describes the location, attributes, and file type
for each component within a package.
There is one entry for each deliverable object. An entry consists of several
fields of information describing the object. All package components,
including the pkgchk file, must be listed in the prototype file. See the
prototype(4) manual page for more information.
• The pkgmap file
The pkgmk command creates the pkgmap file when it processes the
prototype file. This new file contains all the information in the
prototype file plus three new fields for each entry. See the pkgmk(1) and
pkgmap(4) manual pages for more information.
Application Packaging 27
2
Defines previous versions of the package that are compatible with this
version.
• The depend (4) File
Defines disk space requirements for the target environment. This is space
that is required in addition to the space used by objects defined in the
prototype file. For example, additional space might be needed for files
that are dynamically created at installation time.
• The copyright (4) File
Defines the text for a copyright message that is printed on the terminal at
the time of package installation.
Each package information file used must have an entry in the prototype file.
All of these files are described further in the manual pages.
Installation Scripts
Installation scripts are not required. However, you can deliver scripts that
perform customized actions. An installation script must be executable by sh
(for example, a shell script or executable program). The three script types are
as follows:
• request script (requests input from the installer)
• class action scripts (define a set of actions to perform on a group of objects)
• procedure script (defines actions that occur at particular points during
installation)
Package Objects
These are the files that are being distributed, the files that make up the
application. For example, for a driver the package objects would be the
loadable driver module, the hardware configuration file, the driver’s header
file, and a test program.
Object Locations
You specify package object pathnames in the prototype file. Note that during
packaging and installation, a package object can reside in any of three
locations. You need to be aware of which of the three locations is being
discussed. The locations are:
• Development machine
Application Packaging 29
2
Note – This list and the following procedures are intended as guidelines and
should not replace either your own planning or reading the rest of this manual
to learn about available package options. Each of the steps is explained in more
detail in the following sections.
Decide on values for the three package parameters that make each package
instance unique. See the section “Defining a Package Instance” on page 32.
Decide on the classes you are going to use before you create the prototype
file and before you write your class action scripts.
Assess the needs of your package beyond the actions provided by pkgadd
and decide which types of installation scripts are necessary to install your
software.
Create a pkginfo file before executing pkgmk. The pkginfo file should
define basic information about the package and can be created with any
editor as long as it follows the format described in the pkginfo(4) manual
page. See the section “Creating the pkginfo File” on page 38 for more
information.
Note – You should include a copyright file to provide legal protection for
your application.
Application Packaging 31
2
11. Create the prototype file.
This file is required and must be created before you execute pkgmk. It lists
all the objects that belong to a package and information about each object
(such as its file type and class). Create it with any editor, following the
format described in the prototype entry in the manual pages. You can also
use the pkgproto(1M) command to generate a prototype file.
Create the package with the pkgmk command, which copies objects from the
development machine to the installation medium, puts them into the proper
structure, and automatically spans them across multiple volumes, if
necessary.
This is always the last step of packaging, unless you want to create a
datastream structure for your package. If so, you must execute pkgtrans
after creating a package with pkgmk.
The remainder of this chapter gives procedural information for each step.
Defines the software package abbreviation and remains constant for every
instance of a package.
• VERSION
For example, you might identify two identical versions of a package that run
on different hardware as shown in Table 2-2.
Instance #1 Instance #2
PKG=myapp1 PKG=myapp1
VERSION=1.0 VERSION=1.0
ARCH=sparc ARCH=intel
Application Packaging 33
2
Two different versions of a package that run on the same hardware might be
identified as shown in Table 2-3.
Instance #1 Instance #2
PKG=myapp1 PKG=myapp1
VERSION=1.0 VERSION=2.0
ARCH=sparc ARCH=sparc
The first instance of a package installed on a system does not have a suffix, so
its instance identifier will be the package abbreviation. pkgadd assigns
subsequent instances a suffix, beginning with .2. An instance is given the
lowest integer extension available so it may not correspond to the order in
which a package was installed. For example, if mypkg.2 was deleted after
mypkg.3 was installed, the next instance to be added would be named
mypkg.2.
When asked for pkgid in any of the procedures described in this chapter, you
must use the package identifier. Remember that when you have only one
instance of a package on a machine, which is probably the most common
situation, the package identifier is the package abbreviation.
Note – The CLASSES list determines the order of installation. Class none is
always installed first, if present, and removed last.
f manpage /usr/share/man/manl/myappl.1l
f application /usr/bin/myappl
2. Ensure that the CLASSES parameter in the pkginfo file has an entry for
application. For example:
3. Ensure that a class action script exists for this class. An installation script for
a class named manpage would be named i.manpage and a removal script
would be named r.manpage.
Note – When a file is part of a class that has a class action script, the script
must install the file. pkgadd does not install files for which a class action script
exists.
If you define a class but do not deliver a class action script, the only action
taken for that class is to copy components from the installation medium to the
installation machine.
In addition to the classes that you can define, there are three standard classes
for your use. The sed class provides a method for using sed instructions to
edit files upon package installation and removal. The awk class provides a
Application Packaging 35
2
method for using awk instructions to edit files upon package installation and
removal. The build class provides a method to dynamically construct a file
during package installation.
You can define two types of relocatable objects: collectively relocatable and
individually relocatable. Collectively relocatable objects are located relative to the
same directory once the relocatable root directory is established. Individually
relocatable objects are not restricted to the same directory location as
collectively relocatable objects.
Put a definition for the BASEDIR parameter in your pkginfo file. This
parameter names a directory where relocatable objects are stored by default.
If you supply no value for BASEDIR, no package objects are considered
collectively relocatable.
Note – A package can deliver some objects with relocatable locations and
others with fixed locations.
All objects defined as collectively relocatable are put under the same root
directory on the installation machine. The root directory value is one of the
following (and is determined in this order):
• The installer’s response to pkgadd when asked where relocatable objects
should be installed
• The value of BASEDIR as it is defined in the installer’s admin(4) file (the
BASEDIR value assigned in the admin file overrides the value in the
pkginfo file)
• The value of BASEDIR as it is defined in your pkginfo file (this value is
used only as a default in case the other two possibilities have not supplied
a value)
You are not required to write any installation scripts for a package. The
pkgadd command performs all the actions necessary to install your package,
using the information you supply with the package information files. Any
installation script that you provide is used to perform customized actions
beyond those executed by pkgadd.
Application Packaging 37
2
PARAM=value
In addition, the CLASSES parameter dictates which classes are installed and
the order of installation. Although the parameter is not required, no classes
will be installed without it. Even if you have no class action scripts, the none
class must be defined in the CLASSES parameter before objects belonging to
that class are installed. See also pkginfo(4).
Note – You can choose to define the value of CLASSES with a request script
instead of defining it in the pkginfo file.
PKG=bppdev
NAME=bpp device driver
CATEGORY=system
ARCH=sparc
VERSION=bpp release 2.0
CLASSES=none
Note – The reverse dependency type should be used only when a package that
cannot deliver a depend file relies on the newer package.
Refer to the depend(4) and compver(4) manual pages for details on the
formats of these files.
Note – Be certain that your depend and compver files have entries in the
prototype file. The file type should be i (for package information file).
Application Packaging 39
2
Be certain that your copyright file has an entry in the prototype file. Its file
type should be i (for package information file).
Be certain that your space file has an entry in the prototype file. Its file type
should be i (for package information file).
However, you can use the optional part field in the prototype file to define
in which part you want an object to be located. A number in this field
overrides pkgmk and forces the placement of the component into the part
given in the field. Note that there is a one-to-one correspondence between
parts and volumes for removable media formatted as file systems.
The pathname parameter defines where the component should reside on the
installation medium and tells pkgmk where to find it on your machine. If these
names differ, use the path1=path2 format for pathname, where path1 is the name
it should have on the installation machine and path2 is the name it has on your
machine. Links must use the path1= path2 format and if the link is relative, it
must not begin with a /. Refer to the prototype(4) manpage for more
information on each of the parameters.
i pkginfo
i request
i copyright
i postinstall
f none $BOOTDIR/bbp.kmod 0444 root sys
f none $BOOTDIR/bbp_make_node 0555 root sys
f none $BOOTDIR/bbp_remove_node 0555 root sys
Application Packaging 41
2
pkgproto writes its output to the standard output. To create a file, redirect the
output to a file. The examples shown in this section do not perform redirection.
where path is the name of one or more paths to be included in the prototype
file. If path is a directory, then entries are created for the contents of that
directory as well.
With the following form of the command, all objects are put in the none class
and are assigned the same mode owner group as exists on your machine.
The following example shows pkgproto being executed to create a file for all
objects in the directory /usr/bin:
$ pkgproto /usr/bin
d none /usr/bin 755 bin bin
f none /usr/bin/file1 755 bin bin
f none /usr/bin/file2 755 bin bin
f none /usr/bin/file3 755 bin bin
f none /usr/bin/file4 755 bin bin
f none /usr/bin/file5 755 bin bin
To create a prototype file that contains the output of the example above, you
would execute pkgproto /usr/bin > prototype
The following example is the same as above except the objects have been
assigned to class1.
The following example is like the others shown in this section, except that the
objects are now defined as bin (instead of /usr/bin) and are thus relocatable.
Application Packaging 43
2
pkgproto and Links
pkgproto detects linked files and creates entries for them in the prototype
file. If multiple files are linked together, it considers the first path encountered
as the source of the link.
If you have symbolic links established on your machine but want to generate
an entry for that file with an ftype of f (file), then use the –i option of
pkgproto. This option creates a file entry for all symbolic links.
Creating Links
To create links during package installation, define the following in the
prototype entry for the linked object:
• Its ftype as l (a link) or s (a symbolic link).
• Its pathname with the format path1=path2 where path1 is the destination and
path2 is the source file. Source files can be absolute or relative to the
destination. Absolute links must be preceded with a /; otherwise, it is
considered to be a relative link. For example a prototype entry defining a
symbolic link could be:
s none etc/mount=../usr/etc/mount
To request that one of these objects be created on the installation machine, add
an entry for it in the prototype file with the appropriate ftype.
Note that objects cannot be defined with a symbolic link that is a defined
object. The reasons can best be illustrated by the following example. Consider
the following valid prototype entries:
i pkginfo
d none usr 755 root sys
d none usr/bin 755 root sys
s none bin=usr/bin
f none usr/bin/prog=prog 555 root bin
After running pkgmk, you get a pkgmap file that looks something like this:
l 65
l s none bin=usr/bin
l i pkginfo 167 13556 651817887
l d none usr 0755 root sys
l d none usr/bin 0755 root sys
l f none usr/bin/prog 0555 root bin 8645 63299 651810096
Note how pkgmk sorts the pkgmap file by pathname, with no regard to the
type field in column 1. pkgmk also creates the spooled package in this order,
pkgadd installs it in this order, thus directories are created before any
references to files which will reside in those directories.
Application Packaging 45
2
Now, consider the same prototype file, with the exception that the pathname
prefix for installed files is specified with respect to a symbolic link, which is
also a defined object:
i pkginfo
d none usr 755 root sys
d none usr/bin 755 root sys
s none bin=usr/bin
f none bin/prog=prog 555 root bin
After running pkgmk, you get a pkgmap file that looks like this:
1 s none bin=usr/bin
1 f none bin/prog 0555 root bin 8645 63299 651810096
1 i pkginfo 167 13556 651815761
1 d none usr 0755 root sys
1 d none usr/bin 0755 root sys
Note that the pkgmap file is sorted by pathname. The attempt to create the file
bin/prog would fail because the directory usr/bin, referenced by the
symbolic link bin, has not been created yet. This restriction applies whether
the package is installed at a fixed location or is relocatable.
pkgmk creates a new instance of a package when you specifically assign a new
instance name on the pkgmk command line.
Other options are described in the pkgmk(1M) manual page. For example,
executing pkgmk –d /vol/dev/rfd0/unlabeled creates a package based on a file
named prototype in your current working directory. The package is
formatted and copied to the diskette in the device /vol/dev/rfd0/unlabeled.
Application Packaging 47
2
• You have relocatable objects in your package.
You can use the path1=path2 pathname format in your prototype file, with
path1 as a relocatable name and path2 a full pathname to that object on your
machine.
Or you can use the search command in your prototype file to tell pkgmk
where to look for objects.
You can use the search command in your prototype file to tell pkgmk
where to look for objects.
Or you can use the PARAM=value command in your prototype file to give
pkgmk a value to use for the object name variables while it creates your
package.
Or you can use the VARIABLE=value option on the pkgmk command line to
define a temporary value for variable names.
• The root directory on your machine differs from the root directory described
in the prototype file.
Or, you could change directory to the package source directory and use the
following command:
$ pkgmk -b /product/pkgbin
In this case, pkgmk uses the current working directory to find the other parts of
the package (like the prototype and pkginfo package information files).
Application Packaging 49
2
The following example shows the directory structure for a test package and the
commands to use for this directory structure:
% pwd
/pkgtest
% ls pkgsrc
Makefile
packages/
prototype
pkginfo
SCCS/
copyright
depend
pkgicon
% ls pkgbin
colortool*
cdplayer*
mailcheck*
% more pkgsrc/prototype
#ident “@(#)prototype 1.1 90/09/27 ABC, Inc.”
i pkginfo
i pkgicon
i copyright
i depend
f none colortool 0555 user staff
f none cdplayer 0555 user staff
f none mailcheck 0555 user staff
% cd pkgsrc
% pkgmk -o -b /pkgtest/pkgbin -d /var/spool/pkg -f prototype
--or--
% pkgmk -o -r /pkgtest/pkgsrc -b /pkgtest/pkgbin -d var/spool/pkg -f prototype
where
• device1 is the name of the device where the package currently resides
• device2 is the name of the device onto which the translated package will be
written
• pkg[,pkg2...] is one or more package names
If no package names are given, all packages residing in device1 are translated
and written to device2.
Note – If more than one instance of a package resides on device1, you must use
an instance identifier for pkg.
Use the default device (the installation spool directory) or name a directory
in which the package should be stored. pkgmk creates a package in a fixed
directory format. Specify the capacity of the device where the datastream
will be put as an argument to the -l option.
This command translates the fixed directory format to the datastream format
and writes the datastream to the specified medium.
For example, the two steps shown below create a datastream package.
Application Packaging 51
2
The first step formats a package into a fixed directory format under the device
alias named spool. spool is a device alias that exists in
/etc/device.tab.
The second step translates the fixed directory format of package1 residing on
spool into a format supported by the destination device, ctape1. If the
destination device supports a file system, the translation is in fixed directory
format. Otherwise, the translation is in datastream format, which would
normally be the case for a device called ctape1, a tape device.
The following command is similar to the second step above, except that it sets
the datastream package on the medium in a device named diskette.
pkgtrans forces translation into datastream format on the destination device.
Installation Scripts
This section discusses the optional package installation scripts. The pkgadd
command automatically performs all the actions necessary to install a package
using the package information files as input. You do not have to supply any
packaging scripts. However, you may want to create customized installation
procedures for your package.
1. Executes the request script. This is the only point at which your package
can solicit input from the installer.
Note that the request script is executed only in interactive mode. In non-
interactive mode, the request script should have been previously run by
pkgask.
Application Packaging 53
2
3. Installs the package objects.
Removal also occurs class by class. Removal scripts are processed in the
reverse order of installation, based on the sequence defined in the CLASSES
parameter at installation.
The request script is not processed at the time of package removal. However,
its output (a list of parameter values) is saved and made available to removal
scripts.
Installation Parameters
The following four groups of parameters are available to all installation scripts.
Some of the parameters can be modified by a request script.
• The four system parameters that are part of the installation software (see
Table 2-4). None of these parameters can be modified by a package.
• The 19 standard installation parameters defined in the pkginfo file. Of
these, a package can modify only the CLASSES parameter. (The standard
installation parameters are described in detail in the pkginfo entry in the
manual pages.)
Parameter Description
PATH Specifies the search list used by sh to find commands on
script invocation, PATH is set to
/sbin:/usr/sbin:/usr/bin:/usr/sadm/
install/bin
UPDATE Indicates that the current installation is intended to update
the system. Automatically set to true if the package being
installed is overwriting a version of itself.
PKGINST Specifies the instance identifier of the package being installed.
If another instance of the package is not already installed, the
value is the package abbreviation. Otherwise, it is the
package abbreviation followed by a suffix, such as pkg.1
PKGSAV Specifies the directory where files can be saved for use by
removal scripts or where previously saved files can be found.
See the pkginfo(1) and pkgparam (1) manual pages for details on these tools.
Application Packaging 55
2
Code Meaning
0 Successful completion of script.
1 Fatal error. Installation process is terminated at this point.
2 Warning or possible error condition. Installation continues. A warning
message is displayed at the time of completion.
3 Script was interrupted and possibly left unfinished. Installation
terminates at this point.
10 System should be rebooted when installation of all selected packages
is completed. (This value should be added to one of the single-digit
exit codes described above.)
20 System should be rebooted immediately upon completing installation
of the current package. (This value should be added to one of the
single-digit exit codes described above.)
Note – All installation scripts delivered with your package should have an
entry in the prototype file. The file type should be i.
The output of a request script must be a list of parameters and their values.
This list can include any of the parameters you created in the pkginfo file and
the CLASSES parameter. The list can also introduce parameters that have not
been defined elsewhere.
Note – There can be only one request script per package and it must be named
request.
CLASSES=none class1
• The list should be written to the file named as the argument to the request
script.
Application Packaging 57
2
• The user’s terminal is defined as standard input to the request script.
• The request script is not executed during package removal. However, the
parameter values assigned in the script are saved and are available during
removal.
The four procedure scripts must use one of the names listed below, depending
on when these instructions are to be executed.
• preinstall (executes before class installation begins, no files can be
installed by this script)
• postinstall (executes after all volumes have been installed)
• preremove (executes before class removal begins)
• postremove (executes after all classes have been removed, no files can be
removed by this script)
The name of a class action script is based on the class on which it should
operate and whether those operations should occur during package installation
or removal. The two name formats are as follows:
For example, the name of the installation script for a class named class1
would be i.class1 and the removal script would be named r.class1.
Application Packaging 59
2
Note – The installation service relies upon this condition being met.
• The script is not executed if no files in the given class exist on the current
volume.
• pkgadd and pkgrm create a list of all objects listed in the pkgmap file that
belong to the class. As a result, a class action script can act only upon
pathnames defined in the pkgmap that belong to a particular class.
• A class action script should never add, remove, or modify a pathname or
system attribute that does not appear in the list generated by pkgadd unless
by use of the installf or removef command. (See the manual pages for
details on these two commands and the case studies in Appendix B,
“Packaging Case Studies,” for examples of their use.)
• When the class action script is executed for the last time (meaning the input
pathname is the last path on the last volume containing a file of this class),
it is executed with the keyword argument ENDOFCLASS. This flag enables
you to include post-processing actions into your script.
• User interaction is not permitted during execution of a class action script.
All user interaction is restricted to the request script.
Installation of Classes
The following steps outline the system actions that occur when a class is
installed. The actions are repeated once for each volume of a package as that
volume is being installed.
pkgadd creates a list of pathnames upon which the action script will
operate. Each line of this list contains source and destination pathnames,
separated by a space. The source pathname indicates where the object to be
installed resides on the installation volume and the destination pathname
indicates the location on the installation machine where the object should be
installed. The contents of the list are restricted by the following criteria:
• The list contains only pathnames belonging to the associated class.
• Directories, named pipes, character/block devices, and symbolic links are
included in the list with the source pathname set to /dev/null. They are
automatically created by pkgadd (if not already in existence) and given
proper attributes (mode, owner, group) as defined in the pkgmap file.
The class action script is invoked with standard input containing the list
generated in Step 1. If this is the last volume of the package and there are no
more objects in this class, the script is executed with the single argument of
ENDOFCLASS.
Removal of Classes
Objects are removed class by class. Classes that exist for a package but that are
not listed in the CLASSES parameter are removed first (for example, an object
installed with the installf command). Classes listed in the CLASSES
parameter are removed in reverse order. The following steps outline the system
actions that occur when a class is removed:
Application Packaging 61
2
2. If there is no class action script, the pathnames are removed.
If your package has no removal class action script for the class, all the
pathnames in the list generated by pkgrm are removed.
Note – Always assign a class to files with an ftype of e (editable) and have
an associated class action script for that class. Otherwise, the files will be
removed at this point, even if the pathname is shared with other packages.
pkgrm invokes the class action script with standard input for the script
containing the list generated in Step 1.
Provides a method for using sed instructions to edit files upon installation
and removal.
• The awk class
Provides a method for using awk instructions to edit files upon installation
and removal.
• The build class
address, function, and arguments are as defined in the sed(1) manual page. See
Case Studies #4a and #4b in Appendix B, “Packaging Case Studies,” for
examples of sed class action scripts.
Application Packaging 63
2
The name of the awk class file should be the same as the name of the file on
which the instructions will be executed.
The file to be modified is used as input to awk and the output of the script
ultimately replaces the original object. Parameters may not be passed to awk
with this syntax.
The name of the instruction file should conform to standard system naming
conventions.
A build script must be executable by sh. The script’s output becomes the new
version of the file as it is built.
See Case Study #4c in Appendix B, “Packaging Case Studies,” for an example
build class action script.
This chapter describes how to install and check your software package. You
should install from your CD-ROM image and verify that the installation is
correct before having CD-ROMs manufactured. The following topics are
discussed:
• Installation software database
Describes the database that keeps track of the packages that have been
installed.
• Installing software packages
Describes how to use the pkgchk command to check the integrity of your
packages after they have been installed. Also describes the various types of
information you can display with the pkginfo command.
65
3
Two types of information are associated with each package component. The
attribute information describes the component itself. For example, the
component’s access permissions, owner ID, and group ID are attribute
information. The content information describes the contents of the component,
such as file size and time of last modification.
The installation software database keeps track of the package status. A package
can be either fully installed, (it has successfully completed the installation
process), or partially installed (it did not successfully complete the installation
process).
You can use the pkginfo command to survey the contents of the installation
software database. The commands installf and removef can be used to
modify its contents.
You can install multiple packages at the same time, as long as you separate
package names with a space, as follows:
If you do not name the device on which the package resides, the command
checks the default spool directory (/var/spool/pkg). If the package is not
there, installation fails. The name given after the –d option must be a full
pathname to a device, directory (as shown in the example), or device alias.
Note – You must use a package identifier if multiple versions reside on the
installation medium. In most cases, there is only one instance of a package on a
medium and the package identifier is the package abbreviation without a
suffix.
Be aware that the suffix of a package identifier defines the package instance on
that particular medium. A new package identifier is assigned to this package
when it has been installed on your system. (Use pkginfo –d device to find
out what instances are on a medium.)
A diskless client’s root file system is located on the server, in the directory
/export/root/client. The client’s /usr file system is located in
/export/exec/os_identifier/usr, where os_identifier is a string that identifies
the operating system, version, and instruction architecture of the client.
Use the pkgadd command with the -R option to specify the location of the
client’s root filesystem for the installation. For example:
Files installed in the client’s root file system appear in the client’s software
database as installed. Files that the client expects to find in its /usr file
system are shown as shared in the client’s database. The shared files must be
installed on the server with a separate invocation of pkgadd.
# /usr/sbin/pkgchk -R root_path
# /usr/sbin/pkgrm -R root_path
After mounting the client’s root filesystem on the server, use the pkgadd
command with the -R option to specify the root filesystem of the client for the
installation. For example:
Files installed into the client’s root file system appear in the client’s software
database as installed. Files that the client expects to find in the /usr file
system are shown as shared in the client’s database. The shared files must be
installed on the server with a separate invocation of pkgadd.
For more detailed information about this command, refer to the pkgchk(1M)
manual page.
The pkgchk command also compares the file attributes and contents of the
installed package against the installation software database. The entries
concerning a package may have been changed since the time of installation; for
example, another package may have changed a package component. The
database reflects that change.
If you use the -f option to pkgchk, file attributes are corrected when
discrepancies are found.
Parameter Description
ARCH The architecture supported by this package.
BASEDIR The base directory in which the software package resides (shown if the
package is relocatable).
CATEGORY The software category, or categories, of which this package is a member
(for example, system or application).
CLASSES A list of classes defined for a package. The order of the list determines
the order in which the classes are installed. Classes listed first will be
installed first (on a media by media basis). This parameter may be
modified by the request script.
DESC Text that describes the package.
EMAIL The electronic mail address for user inquiries.
HOTLINE Information on how to receive hotline help concerning this package.
INTONLY Indicates that the package should only be installed interactively when
set to any non-NULL value.
ISTATES A list of allowable run states for package installation (for example,
S s 1).
MAXINST The maximum number of package instances that should be allowed on
a machine at the same time. By default, only one instance of a package
is allowed. This parameter must be set to allow for multiple instances of
a package.
NAME The package name, generally text describing the package abbreviation.
ORDER A list of classes defining the order in which they should be put on the
medium. Used by pkgmk in creating the package. Classes not defined in
this parameter are placed on the medium using the standard ordering
procedures.
PKGINST Abbreviation for the package being installed.
PSTAMP The production stamp for this package
RSTATES A list of allowable run states for package removal (for example, S s
1).
# pkginfo -d /opt/spooldir -x
$ pkginfo
system int Installation Utilities
system backup Backup/Restore Utilities
application pkgA Package A
application pkgA.2 Package A
application anpkg Another Package
$
The extracted format shows the package abbreviation, package name, package
architecture (if available), and package version (if available). Use the –x option
to request the extracted format as shown in the next example.
Using the –l option produces a display in the long format showing all of the
available information about a package, as in the following example.
$ pkginfo –l mypkg
PKGINST: pkgA.3
NAME: Package A
CATEGORY: application
ARCH: SunOS
VERSION: Version 3
INSTDATE: Tue Apr 14 08:41:40 MDT 1988
BASEDIR: /opt/pkgA
VSTOCK: sdr9000
STATUS: completely installed
FILES: 31 installed
3 linked files
10 directories
13 executable
nnnn blocks used (approx)
SERIALNUM: 201-790b
$
This chapter briefly describes how to install software using Software Manager.
For more information on using Software Manager, see the Administration
Application Reference Manual. You may want to include a detailed description of
installing your package with Software Manager in the documentation for your
product.
This chapter also describes package clusters and how to create them. Clusters
can be used with Software Manager to provide a simplified user interface for
installing software.
Installing Software
You must be root to install or remove packages with Software Manager. If you
are not root, you can look at the packages installed on the system. You start the
Software Manager by executing the following command:
$ /usr/sbin/swmtool &
75
4
The following window is displayed:
You must choose Install mode to install software. You then use the Properties
window to select the media from which you want to install.
If the software you are installing is packaged in clusters, you can look at the
clusters by double clicking on the icon for the software or by choosing Expand
from the Software menu.
Audio applications
(sparc) 3.0,REV=1.0.4
(C) 1992-1993 Sun Microsystems, Inc.
Printed in the United States of America.
2550 Garcia Avenue, Mountain View, California, 94043-1100 U.S.A.
Using </> as the package base directory.
## Processing package information.
## Processing system information.
2 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
The following files are already installed on the system and are being
used by another package:
/usr <attribute change only>
/usr/bin <attribute change only>
You must also specify the location of the icon in the pkginfo file. Set the
SUNW_ICON parameter to the pathname of the icon. The pathname should be
the relative path to the icon.
Using Clusters
A cluster is a group of one or more software objects such that each object is
either a software package or another cluster.
Clusters can also simplify the removal and upgrade of software packages and
the distribution of localization modules and machine-dependent code. You can
package each localization module separately, allowing the user to install only
the needed modules. You can also put machine-dependent code in individual
packages so that only the code for the specific system is installed.
These files are optional. You need to use them only if you are using clusters.
.clustertoc .packagetoc
If your package has other locales than C (English), there would be a directory
under locale for each locale. Each locale directory would contain the
localized .clustertoc and .packagetoc files.
.cdtoc File
The .cdtoc resides in the top-level directory on the CD-ROM. It is a text file
that describes the location of each product on a CD-ROM. This file is not
required to define clusters, but your CD_ROM should contain one if you are
putting multiple software products on one CD-ROM.
PARAM=value
.clustertoc File
The .clustertoc file describes all the clusters that make up a product, listing
the packages contained in each cluster. This is the only file that is required to
define clusters for a product.
The .clustertoc file must be in the locale directory for the product. Each
product can have one .clustertoc file describing all the clusters in the
product.
PARAM=value
Parameters are grouped by cluster with the first parameter for a group being
CLUSTER=identifier and the last parameter for a group being END. See the
clustertoc(4) man page for a complete description of the parameters.
.packagetoc File
The .packagetoc file describes the packages that make up a product. This
file must also be in the appropriate subdirectory of the locale directory for
the product. There can only be one .packagetoc per product.
Note – If your product has a .packagetoc file, it must also have a .order
file.
PARAM=value
Parameters are grouped by package with the first parameter for a package
being PKG=identifier. See the packagetoc(4) man page for a complete
description of the parameters.
.order File
The .order file is a text file that specifies the order in which the packages
must be installed. The file consists of a list of package identifiers, one per line.
The .order file resides in the product directory (the directory specified for the
product in the .cdtoc file). This file is not required to use package clusters.
There can be only one .order file per product.
83
A
Overlap in Packages
When constructing the packages, ensure that duplicate files are eliminated
when possible. Unnecessary duplication of files results in support and version
difficulties. If your product has multiple packages, constantly compare the
contents of these packages for redundancies.
Sizing Considerations
Size is package-specific and depends on other criteria. For example, the
maximum size of /opt should be considered. When possible, a good package
should not contain only one or two files or contain extremely large numbers of
files. There are cases where a smaller or larger package might be appropriate to
satisfy other criteria.
Introduction
This appendix presents case studies to show packaging techniques such as
installing objects conditionally, determining at run time how many files to
create, and modifying an existing data file during package installation and
removal.
Each case begins with a description of the study, followed by a list of the
packaging techniques used and a narrative description of the approach taken
when using those techniques. After this material, sample files and scripts
associated with the case study are shown.
Techniques
This case study shows examples of the following techniques:
• Using variables in object pathnames
• Using the request script to solicit input from the installer
• Setting conditional values for an installation parameter
85
B
Approach
To set up selective installation, you must:
• Define a class for each type of object that can be installed.
In this case study, the three object types are the package executables, the
manual pages, and the emacs executables. Each type has its own class: bin,
man, and emacs, respectively. Notice that in the prototype file all the
object files belong to one of these three classes.
• Initialize the CLASSES parameter in the pkginfo file to null.
Normally when you define a class, you should list that class in the CLASSES
parameter. Otherwise, no objects in that class are installed. For this example,
the parameter is initially set to null. CLASSES is given values by the request
script, based on the package pieces chosen by the installer. This way,
CLASSES is set to only those object types that the installer wants installed.
The first figure shows the pkginfo file associated with this package. Notice
that the CLASSES parameter is set to null.
• Use variables to define object pathnames in the prototype file.
The request script sets these variables to the value which the installer
provides. pkgadd resolves these variables at installation time and so knows
where to install the package.
The example prototype file shows how to define the object pathnames with
variables.
• Create a request script to ask the installer which parts of the package should
be installed and where they should be placed.
These two questions are repeated for each of the three object types.
At the end of the request script, the parameters are made available to the
installation environment for pkgadd and any other packaging scripts. For this
example, no other scripts are provided.
When looking at the request script for this example, notice that the questions
are generated by the data validation tools ckyorn and ckpath. See also
ckyorn(1) and ckpath(1).
Sample Files
The following example shows the pkginfo file for Case #1:
Pkg=ncmp
NAME=NCMP Utilities
CATEGORY=application, tools
ARCH=SPARC
VERSION=RELEASE 1.0, Issue 1.0
CLASSES=
i pkginfo
i request
x bin $NCMPBIN 0755 root other
f bin $NCMPBIN/dired=/usr/ncmp/bin/dired 0755 root other
f bin $NCMPBIN/less=/usr/ncmp/bin/less 0755 root other
f bin $NCMPBIN/ttype=/usr/ncmp/bin/ttype 0755 root other
f emacs $NCMPBIN/emacs=/usr/ncmp/bin/emacs 0755 root other
x emacs $EMACS 0755 root other
f emacs $EMACS/ansii=/usr/ncmp/lib/emacs/macros/ansii 0644 root
other
f emacs $EMACS/box=/usr/ncmp/lib/emacs/macros/box 0644 root
other
f emacs $EMACS/crypt=/usr/ncmp/lib/emacs/macros/crypt 0644 root
other
f emacs $EMACS/draw=/usr/ncmp/lib/emacs/macros/draw 0644 root
other
f emacs $EMACS/mail=/usr/ncmp/lib/emacs/macros/mail 0644 root
other
f emacs $NCMPMAN/man1/emacs.1=/usr/ncmp/man/man1/emacs.1 0644
root other
d man $NCMPMAN 0755 root other
d man $NCMPMAN/man1 0755 root other
f man $NCMPMAN/man1/dired.1=/usr/ncmp/man/man1/dired.1 0644 root
other
f man $NCMPMAN/man1/ttype.1=/usr/ncmp/man/man1/ttype.1 0644 root
other
f man $NCMPMAN/man1/less.1=/usr/ncmp/man/man1/less.1 0644 inixmr
other
trap ’exit 3’ 15
# determine if and where general executables should be placed
ans=‘ckyorn -d y \
-p "Should executables included in this package be installed"
‘ || exit $?
if [ "$ans” = y ]
then
CLASSES="$CLASSES bin”
NCMPBIN=‘ckpath -d /usr/ncmp/bin -aoy \
-p "Where should executables be installed"
‘ || exit $?
fi
# determine if emacs editor should be installed, and if it should
# where should the associated macros be placed
ans=‘ckyorn -d y \
-p "Should emacs editor included in this package be installed"
‘ || exit $?
if [ "$ans" = y ]
then
CLASSES=”$CLASSES emacs”
EMACS=‘ckpath -d /usr/ncmp/lib/emacs -aoy \
-p "Where should emacs macros be installed"
‘ || exit $?
Case #2: Using Classes, Class Action Scripts, and the space File
This study creates a database file at installation and saves a copy of the
database when the package is removed.
Techniques
This case study shows examples of the following techniques:
• Using classes and class action scripts to perform special actions on different
sets of objects
• Using the space file to inform pkgadd that extra space is required to install
this package properly
• Using the installf command
Notice in the prototype file that none of the pathnames begins with a
slash or a variable. This indicates that they are collectively relocatable.
• Calculate the amount of space the database file requires and create a space
file to deliver with the package. This file notifies pkgadd that the package
requires extra space and specifies how much extra space.
• Create an installation class action script for the admin class.
The script shown initializes a database using the data files belonging to the
admin class. To perform this task, it:
• Copies the source data file to its proper destination
• Creates an empty file named config.data and assigns it to a class of
cfgdata
• Executes the bin/config command (delivered with the package and
already installed) to populate the database file config.data using the
data files belonging to the admin class
• Executes installf –f to finalize installation
No special action is required for the admin class at removal time so no
removal class action script is created. This means that all files and
directories in the admin class are removed from the system.
• Create a removal class action script for the cfgdata class.
The removal script makes a copy of the database file before it is deleted. No
special action is required for this class at installation time, so no installation
class action script is needed.
Sample Files
The following example file shows the pkginfo file for Case #2:
PKG=krazy
NAME=KrAzY Applications
CATEGORY=applications
ARCH=SPARC
VERSION=Version 1
CLASSES=none cfgdata admin
This example file shows the prototype file for Case #2:
i pkginfo
i request
i i.admin
i r.cfgdata
d none bin 555 root sys
f none bin/process1 555 root other
f none bin/process2 555 root other
f none bin/process3 555 root other
f admin bin/config 500 root sys
d admin cfg 555 root sys
f admin cfg/datafile1 444 root sys
f admin cfg/datafile2 444 root sys
f admin cfg/datafile3 444 root sys
f admin cfg/datafile4 444 root sys
d cfgdata data 555 root sys
Techniques
This case study shows examples of the following techniques:
• Using the copyright file
• Using the compver file
• Using the depend file
The pkginfo file shown in the next figure defines this package version as
version 3.0. The compver file defines version 3.0 as being compatible with
versions 2.3, 2.2, 2.1, 2.1.1, 2.1.3 and 1.7.
• Create a depend file.
Files listed in a depend file must already be installed on the system when a
package is installed. The example shown has 11 packages which must
already be on the system at installation time.
Sample Files
The following example file shows the pkginfo file for Case #3:
PKG=case3
NAME=Case Study #3
CATEGORY=application
ARCH=SPARC
VERSION=Version 3.0
CLASSES=none
This example file shows the copyright file for Case #3:
Version 2.3
Version 2.2
Version 2.1
Version 2.1.1
Version 2.1.3
Version 1.7
This example file shows the depend file for Case #3:
Techniques
This case study shows examples of the following techniques:
• Using the sed class
Approach
To modify /sbin/inittab at the time of installation, you must:
• Add the sed class script to the prototype file.
The name of a script must be the name of the file that will be edited. In this
case, the file to be edited is /sbin/inittab and so our sed script is named
/sbin/inittab. There are no requirements for the mode owner group
of a sed script (represented in the sample prototype by question marks).
The file type of the sed script must be e (indicating that it is editable).
• Set the CLASSES parameter to include sed.
In the case of the example shown next, sed is the only class being installed.
However, it could be one of any number of classes.
• Create a sed class action script.
You cannot deliver a copy of /sbin/inittab that looks the way you need
it to, since /sbin/inittab is a dynamic file and you have no way of
knowing how it will look at the time of package installation. Using a sed
script allows us to modify the /sbin/inittab file during package
installation.
As already mentioned, the name of a sed script should be the same as the
name of the file it will edit. A sed script contains sed commands to remove
and add information to the file.
• Create a postinstall script.
You need execute init q to inform the system that /sbin/inittab has
been modified. The only place you can perform that action in this example
is in a postinstall script. Looking at the example postinstall script,
you will see that its only purpose is to execute the following command:
init q
KG=case4a
NAME=Case Study #4a
CATEGORY=applications
ARCH=SPARC
VERSION=Version 1d05
CLASSES=sed
The following example file shows the prototype file for Case #4a:
i pkginfo
i postinstall
e sed /sbin/inittab ? ? ?
This example file shows the sed class action script for Case #4a:
remove
# remove all entries from the table that are associated
# with this package, though not necessarily just
# with this package instance
/^[^:]*:[^:]*:[^:]*:[^#]*#ROBOT$/d
!install
# remove any previous entry added to the table
# for this particular change
/^[^:]*:[^:]*:[^:]*:[^#]*#ROBOT$/d
# add the needed entry at the end of the table;
# sed(1) does not properly interpret the ’$a’
# construct if you previously deleted the last
# line, so the command
# $a\
# rb:023456:wait:/usr/robot/bin/setup #ROBOT
# will not work here if the file already contained
# the modification. Instead, you will settle for
# inserting the entry before the last line!
$i\
rb:023456:wait:/usr/robot/bin/setup #ROBOT
Techniques
This case study shows examples of the following techniques:
• Creating classes
• Using installation and removal class action scripts
Approach
To modify /sbin/inittab during installation, you must:
• Create a class.
This file contains the information for the entry that you will add to
/sbin/inittab. Notice in the prototype file figure that inittab is a
member of the inittab class and has a file type of e for editable.
Since class action scripts must be multiply executable (meaning you get the
same results each time they are executed), you cannot just add the sample
text to the end of the file. The class action script performs the following
procedures:
• Checks to see if this entry has been added before
• If it has, removes any previous versions of the entry
• Edits the inittab file and adds the comment lines so you know where
the entry is from
• Moves the temporary file back into /sbin/inittab
• Executes init q when it receives the end-of-class indicator
The removal script is very similar to the installation script. The information
added by the installation script is removed and init q is executed.
This case study resolves the drawbacks to Case #4a. You can support multiple
package instances since the comment at the end of the inittab entry is now
based on package instance. Also, you no longer need a one-line postinstall
script. However, this case has a drawback of its own. You must deliver two
class action scripts and the inittab file to add one line to a file. Case #4c
shows a more streamlined approach to editing /sbin/inittab during
installation.
Sample Files
This example file shows the pkginfo file for Case #4b:
PKG=case4b
NAME=Case Study #4b
CATEGORY=applications
ARCH=SPARC
VERSION=Version 1d05
CLASSES=inittab
i pkginfo
i i.inittab
i r.inittab
e inittab /sbin/inittab ? ? ?
This example file shows the installation class action script for Case #4b:
This example file shows the one line inittab file needed for Case #4b:
rb:023456:wait:/usr/robot/bin/setup
Techniques
This case study shows examples of the following technique:
• Using the build class
Approach
This approach to modifying /sbin/inittab uses the build class. A build
class file is executed as a shell script and its output becomes the new version of
the file being executed. In other words, the data file inittab that is delivered
with this package will be executed and the output of that execution will
become /sbin/inittab.
The entry for the build file in the prototype file should place it in the
build class and define its file type as e. Be certain that the CLASSES
parameter in the pkginfo file is defined as build.
• Create the build file.
This solution addresses the drawbacks in case studies #4a and #4b. Only one
short file is needed (beyond the pkginfo and prototype files). The file
works with multiple instances of a package since the $PKGINST parameter
is used, and no postinstall script is required since init q can be
executed from the build file.
Sample Files
The following example file shows the pkginfo file for Case #4c:
PKG=case4c
NAME=Case Study #4c
CATEGORY=applications
ARCH=SPARC
VERSION=Version 1d05
CLASSES=build
i pkginfo
e build /sbin/inittab ? ? ?
The following example file shows the build file for Case #4c:
Techniques
This case study shows examples of the following techniques:
• Using classes and class action scripts
• Using the crontab command within a class action script
Create an entry in the prototype file for each crontab file that will be
edited. Define the class as cron and the file type as e for each file. Use the
actual name of the file to be edited.
• Create the crontab files for the package.
These files contain the information you want added to the existing crontab
files of the same name.
• Create an installation class action script for the cron class.
The i.cron script, shown in the next figure, performs the following
procedures:
• Determines the user ID.
This is done by setting the variable user to the base name of the cron
class file being processed. That name equates to the user ID. For example,
the basename of /var/spool/cron/crontabs/root is root (which is
also the user ID).
• Executes crontab using the user ID and the –l option.
Using the –l options tells crontab to send the contents of the crontab
for the defined user to the standard output.
• Pipes the output of the crontab command to a sed script that removes
any previous entries added with this installation technique.
• Puts the edited output into a temporary file.
• Adds the data file for the root user ID (that was delivered with the
package) to the temporary file and adds a tag so you will know where
these entries came from.
• Executes crontab with the same user id and give it the temporary file as
input.
The removal script is the same as the installation script except there is no
procedure to add information to the crontab file.
These procedures are performed for every file in the cron class.
Sample Files
The following example file shows the pkginfo file for Case #5:
PKG=case5
NAME=Case Study #5
CATEGORY=application
ARCH=SPARC
VERSION=Version 1.0
CLASSES=cron
This example file shows the prototype file for Case #5:
i pkginfo
i i.cron
i r.cron
e cron /var/spool/cron/crontabs/root ? ? ?
e cron /var/spool/cron/crontabs/sys ? ? ?
The following example file shows the removal class action script for Case #5:
0 * * * 0-6 /usr/lib/sa/sa1
20,40 8-17 * * 1-5 /usr/lib/sa/sa1
5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A
Techniques
This case study shows examples of the following techniques:
• Installing and loading a driver with a postinstall script
• Unloading a driver with a preremove script
Approach
To install a driver at the time of installation, you must include the object and
configuration files for the driver in the prototype file.
In this example, the executable module for the driver is named buffer. This is
the file on which the add_drv command operates. The buffer.conf file is
used by the kernel to help configure the driver.
Looking at the prototype file for this example notice the following:
• Since no special treatment is required for these files, you can put them into
the standard none class. The CLASSES parameter is set to none in the
pkginfo file example.
• There is an entry for the postinstall script (the script that will
perform the driver installation).
• Create a request script.
The main function of the request script is to determine where the installer
wants the driver objects to be installed, accomplished by questioning the
installer and assigning the answer to the $KERNDIR parameter.
The script ends with a routine to make the two parameters CLASSES and
KERNDIR available to the installation environment and the postinstall
script.
• Create a postinstall script.
The preremove script uses rem_drv to unload the driver from the system,
and then removes the link /dev/buffer0.
Sample Files
This example shows the prototype file for Case #6:
i pkginfo
i request
i postinstall
i preremove
f none $KERNDIR/buffer 444 root root
f none $KERNDIR/buffer.conf 444 root root
PKG=bufdev
NAME=Buffer Device
CATEGORY=system
ARCH=INTEL
VERSION=Software Issue #19
CLASSES=none
trap ‘exit 3’ 15
# determine where driver object should be placed; location
# must be an absolute pathname that is an existing directory
KERNDIR=‘ckpath -aoy -d /kernel/drv -p \
“Where do you want the driver object installed”‘ || exit $?
CLASSES=’$CLASSES’
KERNDIR=’$KERNDIR’
!
exit 0
The following example shows the postinstall script for Case #6:
Case #7:Using the sed Class and postinstall and preremove Scripts
This study shows how to use the two mandatory control files (prototype and
pkginfo) and postinstall, sed, and preremove scripts to install a driver.
There is also a copyright file.
The prototype file defines all of the contents of the package, that is, it
contains an entry for each package object and for each control file (except
itself). This file is discussed last (on page 115), immediately before creating the
package itself.
PKG=SUNWsst
NAME=Simple SCSI Target Driver
VERSION=1
CATEGORY=system
ARCH=sparc
VENDOR=Sun Microsystems
BASEDIR=/opt
All of the parameters shown in the example are mandatory. The settings of
PKG, VERSION and ARCH together define the package instance. The installation
utility, pkgadd(1M), distinguishes instances by appending an instance number
to the package name.
In the driver example, a sed class script is used to add an entry for the driver
to the file /etc/devlink.tab. This file is used by devlinks(1M) to create
symbolic links from /dev into /devices. This is the sed script:
!remove
/name=sst;/d
add_drv uses BASEDIR, so the script has to unset BASEDIR before running
the utility, and restore it afterwards.
One of the actions of add_drv is to run devlinks, which uses the entry
placed in /etc/devlink.tab by the sed class script to create the /dev
entries for the driver.
The exit code from postinstall is significant. 20 tells pkgadd to tell the
user to reboot the system (necessary after installing a driver), and 2 tells
pkgadd to tell the user that the installation partially failed.
exit
The script removes the /dev entries itself; the /devices entries are removed
by rem_drv.
Creating a Package
The main task in creating a package is to create the prototype file. This file
specifies the locations of the package objects on both the development and the
installation workstations. Before creating the prototype file, you must
determine the layout of the package objects.
pkg
sst
scsi
sst.conf
targets
sst_def.h
The remaining components of the package (all the control files) go in the top
directory of the package on the development machine, except the sed class
script. This is called devlink.tab after the file it modifies, and goes into etc,
the directory containing the real devlink.tab file.
pkg
etc
pkginfo sst
postinstall devlink.tab
preremove sst
copyright sst.conf
sst_def.h
sstest.c
This file needs to be modified. Entries are not needed for directories that
already exist on the installation machine, the access permissions and
ownerships need to be changed, and entries must be added for the control files.
Finally, a slash must be prepended to the fixed package objects. This is the final
prototype file:
i pkginfo
i postinstall
i preremove
i copyright
e sed /etc/devlink.tab ? ? ?
f none /usr/include/sys/scsi/targets/sst_def.h 0644 bin bin
f none /usr/kernel/drv/sst 0755 root sys
f none /usr/kernel/drv/sst.conf 0644 root sys
d none SUNWsst 0775 root sys
f none SUNWsst/sstest.c 0664 root sys
The questions marks in the entry for the sed script indicate that the access
permissions and ownership of the existing file on the installation machine
should not be changed.
The entries in the prototype file specify the locations of the objects on both
the development and the installation machines. Note that the source files are
relative, so you need to tell pkgmk where they are when you run it. This would
not be necessary if you had specified ‘pwd‘=/usr/kernel/drv to
pkgproto (but the prototype entries would be rather long).
The initial prototype file must be edited; entries for the control files are
added and the access permissions and ownerships need to be changed.
Further, the initial prototype file shows all files being installed into the same
i pkginfo
i postinstall
i preremove
i copyright
e sed /etc/devlink.tab ? ? ?
f none /usr/kernel/drv/sst=sst 0755 root sys
f none /usr/kernel/drv/sst.conf=sst.conf 0644 root sys
f none /usr/include/sys/scsi/targets/sst_def.h=sst_def.h 0644
bin bin
d none SUNWsst 0755 root sys
f none SUNWsst/sstest.c=sstest.c 0664 root sys
The questions marks in the entry for the sed script indicate that the access
permissions and ownership of the existing file on the installation machine
should not be changed.
The -r option is still needed because the prototype entry for the sed class
script doesn’t specify a location on the development machine.
: 1 120
1 e sed /etc/devlink.tab ? ? ? 218 19258 719022555
1 f none /usr/include/sys/scsi/targets/sst_def.h 0644 bin bin
3623 \
23380 711071279
1 f none /usr/kernel/drv/sst 0755 root sys 31808 28921 711830351
1 f none /usr/kernel/drv/sst.conf 0644 root sys 326 26818
711830359
1 d none SUNWsst 0775 root sys
1 f none SUNWsst/sstest.c 0664 root sys 3676 19733 711830366
1 i copyright 434 38929 719080369
1 i pkginfo 165 13317 719107352
1 i postinstall 666 55221 719078817
1 i preremove 424 34950 719079244
The -s option tells pkgtrans to convert from file system format to datastream
format. pkgtrans supports multiple volumes.
Note – This example will probably not work correctly if you install it onto a
diskless client. In this case, you are better off making the whole package
relocatable (install all files into /opt/SUNWsst), and then copying the
necessary files to the right places in the postinstall script. Use
installf(1M) to put the files into the installation software database.
Remember to remove the files in the preremove script and also to use
removef(1M).
Artwork
Camera-ready art used to print the CD-ROM disc label, product insert, and
J-card. May contain file system type, part numbers, and trademark and
copyright information associated with specific product.
ABI
Application Binary Interface.
Caddy
The plastic rectangular container that holds the CD-ROM when it is placed into
the CD drive.
Catalyst CDware
The SunSoft Catalyst product that distributes third-party software demos on
CD-ROM from SunSoft distribution centers.
CD-ROM
Compact Disc-Read Only Memory.
CD drive
Same as CD player.
CD player
The hardware device used to read CD-ROMs.
121
Check disc
The name used by some CD-ROM manufacturers to describe a data proof
CD-ROM. This may be used to verify that the software product on CD-ROM
media is correct.
Coaster
A one-off CD-ROM that has been cut incorrectly.
Copyright
The right to own and sell intellectual property, such as software, source code,
or documentation. Ownership must be stated on the CD-ROM and insert text,
whether the copyright is owned by SunSoft, or by another party. Copyright
ownership is also acknowledged in SunSoft documentation.
DAT
Digital Audio Tape.
dd
The Solaris user command used to copy a file system image to tape.
Disc
The optical compact medium used to hold software or audio data. Discs are
read-only, as opposed to read-write.
Disk
The spelling used for hard disk drives, such as SMD, SCSI, or IPI. Does NOT
include CD-ROM.
Exabyte
A type of magnetic tape cartridge, 8MM format. It is the 3M vendor-preferred
transfer media to receive data for mastering.
First article
The name used to describe a completed CD-ROM. This may be used to verify
that the software and disc label on CD-ROM media are correct and can be used
to approve a production run of the CD-ROM media. The first article comes
High Sierra
Early CD-ROM file system standard. See ISO 9660.
Image tape
The software in its file system format ready to be transferred to a CD-ROM.
This image of the software may be transported on a variety of media, 1/2 inch
reel magnetic tape, 1/4 inch cassette magnetic tape, Exabyte magnetic tape, or
compact disc before being mastered into a CD-ROM.
Insert
The name used to describe the document inside the front of the CD-ROM jewel
box. Among other things, the insert may carry product specific information
and installation instructions.
ISO 9660
An industry standard file system used for distribution of software on CD-
ROM. This file system is tailored to the read-only environment, but does not
currently contain many essential POSIX features. This format is often
erroneously referred to as High Sierra, which is a subset.
J-card
Printed card with a small, folded edge that fits into the back of the CD-ROM
jewel box. It carries the product name and part number so that this information
can be read without opening the jewel box. The edge corresponds to the spine
of a book.
Jewel box
The plastic case that contains the CD-ROM, the insert, and the J-card.
Mastering fee
The CD-ROM manufacturer charges a mastering fee to cover the expenses of
preparing to make a CD-ROM for production. This fee includes downloading
your data to a mastering machine, creating a glass master, creating a metal
stamper used in the production run, and testing for quality control of these
processes.
Glossary 123
One-off
A special CD-ROM used as a check disc. This CD-ROM is relatively costly and
cannot be duplicated. It should be used only for internal testing purposes
before mass production.
Packages
A collection of file and directories required for a software application. Packages
are created with pkgmk or swmtool. The software resides in a directory
hierarchy which also contains various information files describing the package
contents.
Premastering machine
The equipment used for cutting pre-master CD-ROMs. Premastering machine
is synonymous with one-off machine. It may be more accurate to call it a CD-
Write Once machine, writable CD-ROM publisher, or check disc recorder.
Premastering usually describes the whole process previous to mastering.
Production disc
The disc distributed to customers.
Replication
The production run of CD-ROM discs at the manufacturer’s facilities.
Rock Ridge
Extensions to the ISO 9660 standard for CD-ROMs. These extensions provide
functionality needed by UNIX file systems, such as symbolic links. SunSoft
currently uses this file system for distribution of its Solaris software.
tar
Tape Archive Retrieval. Solaris command for adding or extracting files from
a media.
UFS
The file system format currently used for Sun’s unbundled products on
CD-ROM. The same format is used for file systems on disk partitions.
125
compact disc See CD-ROM parameters, 55
compver file, 28, 39 software database, 66
example, 93 installation parameters, 54
copyright file, 28, 40 example, 85
example, 93, 113 installation scripts, 28, 37, 52
creating a CD-ROM, 8 example, 98
creating a CD-ROM using Rock Ridge, 18 exit codes, 56
parameters, 54
creating a package, 30
processing of, 54
creating a pkginfo file, 38
installation software database, 66
creating a prototype file, 40
installation, full, 66
creating an icon, 78
installf command example, 89
installing a driver, package example, 107
D installing classes, 60
data proof, 10 installing packages, 67
depend file, 28, 39 installing packages on diskless clients, 68
example, 93 installing software from CD-ROM, 15
displaying information about installed installing software with Software
packages, 70 Manager, 75
distributing audio data, 9 ISO 9660, 12
driver, package example, 107 Rock Ridge extensions to, 13
F J
file system J-card, 5
High Sierra, 12 jewel box, 5
ISO 9660, 12
RockRidge, 13
UFS, 13 L
first article, 10 links, creating with prototype file, 44
G M
guidelines, packaging, 83 manufacturing process for a CD-ROM, 11
H O
High Sierra File System (HSFS), 12 object classes, 34, 43
awk, 62
build, 62
I example, 98
icon, creating, 78 installing, 60
insert, 5 removing, 61
installation sed, 62
Index 127
preinstall, 58
preremove, 58
example, 113
procedure, 53, 58
usage rules, 58
processing of, 54
request, 53, 56
usage rules, 57
request example, 85
sed class, 62
example, 111
sed class, 62
example, 95
sed class script, 62
example, 111
software licensing, 23
Software Manager, 15
installing software, 75
software packages, 15, 16, 21
components, 22, 24
creating, 30, 47
instance, 32
object locations, 29
objects, 29
optional components, 25, 28
overview, 26
required components, 25, 27
space file, 28, 40
example, 89
swmtool, 15
swmtool command, 75
system object classes, 62
T
testing a CD-ROM, 8
translating a package, 52
U
UFS, 13