JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Application Packaging Developer's Guide     Oracle Solaris 10 1/13 Information Library
search filter icon
search icon

Document Information

Preface

1.  Designing a Package

2.  Building a Package

3.  Enhancing the Functionality of a Package (Tasks)

4.  Verifying and Transferring a Package

5.  Case Studies of Package Creation

Soliciting Input From the Administrator

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The request Script

Creating a File at Installation and Saving It During Removal

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The space File

The i.admin Class Action Script

The r.cfgdata Removal Script

Defining Package Compatibilities and Dependencies

Techniques

Approach

Case Study Files

The pkginfo File

The copyright File

The compver File

The depend File

Modifying a File by Using Standard Classes and Class Action Scripts

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The i.inittab Installation Class Action Script

The r.inittab Removal Class Action Script

The inittab File

Modifying a File by Using the sed Class and a postinstall Script

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The sed Class Action Script (/etc/inittab)

The postinstall Script

Modifying a File by Using The build Class

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The Build File

Modifying crontab Files During Installation

Techniques

Approach

Case Study Files

The pkginfo Command

The prototype File

The i.cron Installation Class Action Script

The r.cron Removal Class Action Script

crontab File #1

crontab File #2

Installing and Removing a Driver With Procedure Scripts

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The request Script

The postinstall Script

The preremove Script

Installing a Driver by Using the sed Class and Procedure Scripts

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The sed Class Action Script (/etc/devlink.tab)

The postinstall Installation Script

The preremove Removal Script

The copyright File

6.  Advanced Techniques for Creating Packages

Glossary

Index

Installing and Removing a Driver With Procedure Scripts

This package installs a driver.

Techniques

This case study demonstrates the following techniques:

For more information on these scripts, see Writing Procedure Scripts.

Approach

Case Study Files

The pkginfo File

PKG=bufdev
NAME=Buffer Device
CATEGORY=system
BASEDIR=/
ARCH=INTEL
VERSION=Software Issue #19
CLASSES=none

The prototype File

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; the add_drv command operates on this file. The kernel uses the configuration file, buffer.conf, to help configure the driver.

i pkginfo
i request
i postinstall
i preremove
f none $KERNDIR/buffer 444 root root
f none $KERNDIR/buffer.conf 444 root root

Looking at the prototype file for this example, notice the following:

The request Script

trap 'exit 3' 15
# determine where driver object should be placed; location
# must be an absolute path name that is an existing directory
KERNDIR=`ckpath -aoy -d /kernel/drv -p \
“Where do you want the driver object installed”` || exit $?

# make parameters available to installation service, and
# so to any other packaging scripts
cat >$1 <<!

CLASSES='$CLASSES'
KERNDIR='$KERNDIR'
!
exit 0

The postinstall Script

# KERNDIR parameter provided by `request' script
err_code=1                    # an error is considered fatal
# Load the module into the system
cd $KERNDIR
add_drv -m '* 0666 root sys' buffer || exit $err_code
# Create a /dev entry for the character node
installf $PKGINST /dev/buffer0=/devices/eisa/buffer*:0 s
installf -f $PKGINST

The preremove Script

err_code=1                    # an error is considered fatal
# Unload the driver
rem_drv buffer || exit $err_code
# remove /dev file
removef $PKGINST /dev/buffer0 ; rm /dev/buffer0
removef -f $PKGINST