DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Installing, configuring, and packaging SVR5 drivers

Files that control packaging

The following files are used to define how the driver package will be built: prototype, pkginfo, postinstall, preremove, and request.

The sample drivers provided in the HDK include sample packaging files; copy the files for the driver that is most similar to yours and modify them accordingly.

prototype

prototype(4) is an ASCII file that lists the DSP contents intended to be installed. Each entry in the file describes a single deliverable object, and an object may be a data file, directory, source file, executable object, and so on. Entries in a prototype file consist of several fields of information separated by white space. Comment lines begin with a ``#'' and are ignored.

The package's prototype file should install the DSP component files in the /tmp directory. Then, the postinstall script, when executed, should cd to that directory before executing idinstall to add the driver to the system.

postinstall

postinstall is the script file in a package that installs the driver. The following steps should be performed in a postinstall script:

  1. Change directory to /tmp/xyzzy, where the driver files were installed.

  2. Execute idinstall -a -P <driver_name>. This creates the needed directories and moves the driver files to the appropriate locations. The -P option records all the installed files in the contents file. If the idinstall -a fails, the package was already installed.

  3. If the driver has already been installed, use the idinstall -u -P <driver_name> command to update the package using the files from the DSP.


    NOTE: Always use the idinstall command rather than copy files directly into the destination directory.

  4. Run the idbuild command with or without the -m option to create a loadable module.

  5. removef any /tmp files installed.
When writing a postinstall script, you should make liberal use of echo and message commands to tell the user what is going on. You should also make sure to exit with the appropriate return value based on a successful or unsuccessful installation.

The following script exit codes are required:


0
Successful completion of the script.

1
Fatal error. Installation process is terminated at this point.

2
Warning or possible error condition. Installation will continue. A warning message will be 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 above; for example, "12", means that an error occurred and the system should be rebooted after all selected packages are installed.)

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 above; for example, "22" means that an error occurred and the system should be rebooted immediately after the current package is installed.)

preremove

preremove is the script file in a package used when needed to remove the associated drivers from the system. The following steps should be performed in a preremove script:

  1. Use idcheck to make sure the driver to be removed exists on the system. If not, the script should exit and display an error message.

  2. Run idinstall -d -P <driver_name>. This removes the driver module from /etc/conf. The -P option updates the ``contents'' file.

  3. Invoke idbuild without any options to implement a deferred build.

© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005