Approach

The request script determines where the administrator wants the driver objects to be installed, by questioning the administrator 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 postinstall script actually performs the driver installation. It is executed after the two files buffer and buffer.conf have been installed. The postinstall file shown for this example performs the following actions:

Uses the add_drv command to load the driver into the system.

Creates a link for the device using the installf command.

Finalizes the installation using the installf -f command.

Creates a preremove script.

The preremove script uses the rem_drv command to unload the driver from the system, and then removes the link /dev/buffer0.

Since no special treatment is required for the package objects, you can put them into the standard none class. The CLASSES parameter is set to none in the pkginfo file.

The path names for buffer and buffer.conf begin with the variable $KERNDIR. This variable is set in the request script and allows the administrator to decide where the driver files should be installed. The default directory is /kernel/drv.

There is an entry for the postinstall script (the script that will perform the driver installation).

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