X Server Device Developer's Guide
  Rechercher uniquement dans ce livre
Télécharger cet ouvrage au format PDF

Packaging and Installation Hints

B

The Loadable DDX interface introduces issues pertaining to packaging and installation of loadable modules (DDX handlers, Xinput modules and X Extension modules). This appendix discusses these issues and assumes familiarity with the Application Packaging & Installation facilities in Solaris 2.x. See the SunOS 5.x Application Packaging and Installation Guide for more information.

Installation Hints

Loadable modules and OWconfig file entries are installed in either of two directories, as discussed in "File and Module Search Paths" on page 263. The directories in /etc/openwin are intended to be machine-specific, or local, whereas the directories in /usr/openwin could be either local to the machine or NFS mounted from a remote filesystem. The /etc/openwin location is recommended for most loadable modules installed by IHVs (Independent Hardware Vendors). The exception is when a module is being installed on a server for shared use by a number of workstations requiring the module. In this case, install the module in the same directory in which either the SUNWxwplt (SPARC) or SUNWxwpls (x86) package was installed.
Whether you install a module in the /etc or /usr location, your installation script should always checks for an OWconfig file and the relevant entries in that location. If an OWconfig file does not exist in the installation location, the installation script should create it with the relevant module entries inserted in
the file. The package should also have a corresponding removal script that removes any entries inserted by it into the OWconfig file. It should delete the file if (and only if) it becomes empty as a result of the deletions.
If you use the /etc location for installation, the installation script takes into account the fact that there might not be sufficient space in the / filesystem to accommodate large loadable modules. The recommended approach is to install the DDX modules in a subdirectory under /opt/<package_name>, and populate the /etc/openwin/server/modules directory with symbolic links. Install and edit the OWconfig file in the /etc location directly, not via symbolic links.

Packaging Hints

Follow the following convention for package names:

  <organization><package-descriptor>  

For example:
  • SUNWxwplt..Sun's OpenWindows required package for SPARC
  • SUNWxwpls..Sun's OpenWindows required package for x86
  • ACMEowdyn ACME dynamo frame buffer's DDX handler package
The typical convention is that packages edit the OWconfig file to insert entries with the following comment lines containing the package name. The package in this example is ACMEowdyn.

  # Start ACMEowdyn  
  # [a number of lines containing the actual OWconfig entry]  
  # End ACMEowdyn  

The SUNWxwplt package, for example, marks all of the default entries it installs (in /usr location) as follows:

  # Start SUNWxwplt  
  # [a number of lines containing the default OWconfig entries]  
  # End SUNWxwplt  

Package Delivery Example

The following is an example of the packaging scripts and prototype files for delivering a package containing the DDX handler module for the ACME dynamo graphics display adapter. All of these examples are for the ACMEowdyn package.
Code Example B-1 pkginfo File

  PKG=ACMEowdyn  
  NAME=ACME Dynamo Display Adapter Support  
  ARCH=sparc  
  VERSION=1.0.0,REV=2.2.2  
  CATEGORY=system,graphics  
  PRODNAME=Dynamo  
  PRODVERS=2.3  
  DESC="OpenWindows dynamically loaded drivers for the Dynamo  
  display adapter. Not needed if you do not have a Dynamo display  
  adapter installed on your system."  
  BASEDIR=/etc  
  VENDOR="ACME Display Adapters, Inc."  
  HOTLINE="1-800-USA-ACME"  
  EMAIL="hotline@ACME.COM"  
  MAXINST=1000  
  CLASSES=base OWconfig  

Code Example B-2 Prototype File

  i pkginfo  
  i copyright  
  i depend  
  i i.OWconfig  
  i r.OWconfig  
  d base openwin 0775 root bin  
  d base openwin/server 0775 root bin  
  d base openwin/server/etc 0775 root bin  
  e OWconfig openwin/server/etc/OWconfig 0755 root bin  
  d base openwin/server/modules 0775 root bin  
  f base openwin/server/modules/ddxACMEdyn.so.1 0755 bin bin  

Put the following code in a stub file named OWconfig.
Code Example B-3 OWconfig File

  # Start ACMEowdyn  
  # ACME dynamo display adapter  
  class="XSCREEN" name="ACMEdyn"  
       ddxHandler="ddxACMEdyn.so.1" ddxInitFunc="ACMEdynInit";  
  # End ACMEowdyn  

Code Example B-4 i.OWconfig File

  #  
  # Installation script for the OWconfig class  
  # If an OWconfig file existed, remove any entry belonging to  
  # this package, and append a new entry.  
  #  
  while read src dst  
  do  
       if [ -r $dst ]  
       then  
           # An OWconfig file already exists  
           if [ -w $dst ]  
           then  
                # It's editable by this script, edit it.  
                cp $dst /tmp/$$OWconfig || exit 2  
                sed -e "/# Start ACMEowdyn/,/# End ACMEowdyn/d" \  
                /tmp/$$OWconfig > $dst || exit 2  
                cat $src >> $dst || exit 2  
                rm -f /tmp/$$OWconfig  
           else  
                # An OWconfig file exists that's not editable !  
                exit 2  
           fi  
       else  
           # An OWconfig file was not present  
           cat $src >> $dst || exit 2  
       fi  
  done  
  exit 0  

Code Example B-5 r.OWconfig File

  #  
  # Removal script for the OWconfig class  
  # Remove any entries that belong to this package.  
  # Delete the file if it's empty.  
  #  
  while read dst  
  do  
       sed -e ~~/# Start ACMEowdyn/,/# End ACMEowdyn/d" $dst > \  
       /tmp/$$OWconfig || exit 2  
       if [ -s /tmp/$$OWconfig ]  
       then  
           mv /tmp/$$OWconfig $dst || exit 2  
       else  
           rm $dst || exit 2  
       fi  
  done  
  exit 0  

Code Example B-6 depend File

  P SUNWcar        Core Architecture, (Root)  
  P SUNWkvm        Core Architecture, (Kvm)  
  P SUNWcsr        Core Sparc, (Root)  
  P SUNWcsu        Core Sparc, (Usr)  
  P SUNWcsd        Core Sparc Devices  
  P SUNWxwplt      OpenWindows required core package for SPARC  
  P SUNWxwpls      OpenWindows required core package for x86  

Code Example B-7 copyright File

  Copyright 1993 ACME Display Adapters, Inc.  
       <insert your copyright information here>  
  All Rights Reserved.