5    Producing Kernel Product Kits

This chapter tells you how to produce a kernel product kit, what additional files are required, and how to test the kit installation.

Note

The information in this chapter describes how to produce kernel product kits.

Follow these steps to create and test a kernel product kit:

  1. Read Chapter 1 for an overview of product kits.

  2. Design the kit directory structure as described in Chapter 2.

  3. Create subsets as described in Chapter 3. Kernel product kits require a subset control program (Section 3.4).

  4. Create additional installation files as described in Section 5.2.

  5. Rerun the newinv utility as described in Section 3.7 to update the master inventory file with the additional installation files.

  6. Rerun the kits utility as described in Section 3.5 to produce updated subsets and control files.

  7. Create the kit distribution media as described in Section 5.3.

  8. Test the distribution media as described in Section 5.4.

5.1    Overview

A kernel product is a layered product that contains kernel support. Users do not run kernel products directly; the operating system and utilities access kernel products to perform their work. For example, a device driver is one common type of kernel product. A user runs an application or utility, which generates system requests to perform operations such as opening a file or writing data to a disk. The system determines which device driver should service this request and then calls the required driver interface.

The kernel modules and the kit support files are distributed as part of the kernel product kit, and can be installed either directly from the distribution media or loaded onto a Remote Installation Services (RIS) area for installation by RIS clients over a local area network (LAN).

5.2    Creating Additional Installation Files

The files needed to build a kernel product kit depend on whether the kit will be configured statically or dynamically on the customer's system. For example:

Note:

A module that can be loaded dynamically also can be linked statically. The only difference is the call to configure the product. For more information on static and dynamic drivers, refer to Writing Device Drivers.

Figure 5-1 shows the files that make up the ODB product kit source directory. Additional kernel product files are highlighted.

Figure 5-1:  Kernel Product Source Directory

  1. /README.odb -- a text file containing general product information

    This file is installed in the root ( / ) file system and is placed in the opt/OAT100 source directory.

  2. /sbin/odb_recover -- a utility to recover corrupt ODB documents when the system boots. The odb_recover script executes when the system boots and the /usr file system may not be mounted.

    This file is installed in the root ( / ) file system and is placed in the opt/OAT100/sbin source directory.

  3. /usr/bin/odb_start -- the ODB tool startup script. The odb_start script is a user command.

    This file is installed in the /usr file system and is placed in the usr/opt/OAT100/bin source directory.

  4. /usr/var/templates/odb_template -- a document template that can be modified by a user.

    This file is installed in the /var file system and is placed in the usr/var/opt/OAT100/templates source directory.

  5. /usr/var/log_files/odb_log -- the context-dependent symbolic link (CDSL) for the odb_log file.

    This symbolic link is installed in the /usr/var file system and is placed in the usr/var/opt/OAT100/log_files source directory.

  6. /usr/var/cluster/members/member0/log_files/odb_log -- the file listing all of the ODB documents created by a user. The odb_log file can be modified by users.

    This file is installed in the /usr/var file system and is placed in the usr/var/cluster/members/member0/opt/OAT100/log_files source directory.

  7. files -- the files file fragment contains information about the location of the source code and modules associated with the driver, tags indicating when the driver is loaded into the kernel, and whether the source or binary form of the driver is supplied to the customer.

  8. sysconfigtab -- the sysconfigtab file fragment contains device special file information, bus option data, and information on contiguous memory usage for statically and dynamically configured drivers. The sysconfigtab file fragment gets appended to the /etc/sysconfigtab database when the kernel product kit is installed. For more information, refer to the sysconfigtab(4) reference page.

  9. odb_printer.mod -- the object module file containing the single binary module for the ODB kernel product.

A kernel product kit requires you to include the following files on the distribution media to make the kernel product accessible during installation:

5.2.1    The files File Fragment

The files file fragment contains information about the location of the source code and modules associated with the driver, tags indicating when the driver is loaded into the kernel, and whether the source or binary form of the driver is supplied to the customer. You need to edit this file if the kit development directory structure differs from the driver development directory structure or if you must change the driver name for any reason.

Caution

The files file fragment must be in the same directory as the kernel modules or the kreg and doconfig utilities will not work properly.

Figure 5-2 shows which fields within the files file fragment need to change.

Figure 5-2:  Editing the files File Fragment

5.2.2    The sysconfigtab File Fragment

The sysconfigtab file fragment contains device special file information, bus option data information, and information on contiguous memory usage for statically and dynamically configured drivers. When the user installs a kernel product kit, the driver's sysconfigtab file fragment gets appended to the /etc/sysconfigtab database. You should place this file fragment in a product directory, such as /opt/OAT100/etc.

You do not need to change the sysconfigtab file fragment unless you change the driver (subsystem) name. The driver name appears in three places within the file, as shown in Figure 5-3. In the example, the driver runs on a TURBOchannel bus (indicated by the TC_Option entry), but a similar set of bus options would be specified for other bus types.

Figure 5-3:  Editing the sysconfigtab File Fragment

This file is described in the sysconfigtab(4) reference page.

5.2.3    The Object Module File

The driver.mod object module file contains the single binary module for both statically and dynamically configured drivers. Include this file in a product directory, such as /opt/OAT100/sys/BINARY, in the root ( / ) file system.

Caution

You cannot use RIS to link compressed modules. Use the file command to determine if a file is compressed. You see output similar to the following:

# file odb_graphics.mod
odb_graphics.mod:
    alpha compressed COFF executable or object module not stripped

5.2.4    The Source and Header Files

The *.c (source) and *.h (header) files contain the source code for the device driver. Include these files in a product directory, such as /usr/opt/OAT100/src, when the driver is statically configured and distributed in source form.

5.2.5    The Method Files

The device.mth method files contain driver methods that are called during automatic configuration to create device special files for dynamically configured drivers. The subset control program creates links to these device special files in the customer's subsys directory when the driver is installed. The driver method files are on the distribution media and are not installed onto the customer's system. The device driver developer can tell you which method files the subset control program should link to, typically /subsys/device.mth. Link the method in a device driver kernel kit only if the driver needs to have device special files created for its devices.

5.3    Producing Distribution Media

After you have tested the subsets, you can produce the distribution media. Distribution media production consists of the following tasks:

  1. Rerunning the newinv utility to update the master inventory file with the additional installation files (Section 3.7)

  2. Rerunning the kits utility to produce updated subsets and control files (Section 3.5)

  3. Editing the /etc/kitcap file. (Section 5.3.1)

  4. Building the kernel product kit on the distribution media.

You can produce the kernel product kit in either tar format or direct CD-ROM (DCD) format.

Installation time for DCD format kits is slower than for tar format kits.

You can distribute user product kits on diskette, CD-ROM, or magnetic tape, as follows:

Figure 5-4 shows the types of file formats and distribution media that are available for kernel product kits.

Figure 5-4:  Kernel Product Kit File Formats

5.3.1    Editing the /etc/kitcap File

The gendisk and gentapes utilities refer to the /etc/kitcap file, a database containing information about the kits to be built on the system. Each record contains a product code and the names of the directories, files, and subsets that make up the product kit. Before you can build your kit, you must add a media descriptor record to the /etc/kitcap database.

Note

If you use the gendisk utility to produce your kit on disk distribution media, you can specify an alternate kit descriptor database. Refer to the gendisk(1) reference page for additional information.

Use the following conventions when you add a record to the /etc/kitcap file:

The contents of a kitcap record differ depending on whether you are producing disk or tape media. You must add one record for each media type on which you plan to distribute your kit.

The contents of the record also depend on the product type you are delivering. For example, the kitcap record for a kernel product may require the kk=true parameter and the rootdd= option. Refer to the kitcap(4) reference page for more information about the contents of the /etc/kitcap file.

5.3.1.1    Disk Media Descriptor

Create a disk media kitcap record when you produce kits for distribution on diskette or CD-ROM. The kitcap record for disk media contains the following elements:

Refer to the kitcap(4) reference page for more information about the disk media record format.

Refer to Section 3.3 for information about the key file.

Example 5-1 shows the record to be added to the /etc/kitcap file to produce the ODB kit on disk media:

Example 5-1:  Sample Disk Media Descriptor for Kernel Product

OAT100HD:c:\
  dd=/OAT100:Orpheus_Document_Builder:/mykit/output:\
  OATODB100:OATODBTEMPS100:OATODBKERNEL100

Based on the information shown in Example 5-1, the gendisk utility places the kit on the c partition in the / (root) directory of the disk media. The product description is Orpheus_Document_Builder and the kit output directory is named /mykit/output. The kit consists of three subsets: OATODB100, OATODBTEMPS100, and OATODBKERNEL100.

5.3.1.2    Tape Media Descriptor

The kitcap record for tape media contains the following elements:

Refer to the kitcap(4) reference page for more detailed information about the tape media record format.

Example 5-2 shows the record to be added to the /etc/kitcap file to produce the ODB kit on TK50 tapes:

Example 5-2:  Sample Tape Media Descriptor

OAT100TK|Orpheus Document Builder:\
  /mykit/output:SPACE:SPACE:SPACE:\
  INSTCTRL:OATODB100:OATODBTEMPS100:OATODBKERNEL100

The product name, OAT100, is the same name that appears in the key file. The product description, Orpheus Document Builder also appears in the key file. The name of the output directory is specified as /mykit/output, and three SPACE files are included for compatibility with operating system kits. The last line of the record contains the INSTCTRL directory and the names of the subsets that make up the kit: OATODB100, OATODBTEMPS100, and OATODBKERNEL100.

5.3.2    Building a Kernel Product Kit on Disk Media

When the product subsets are located in the output area of the kit directory structure, use the gendisk utility to create the kit on a disk.

Note

The gendisk utility supports diskettes but does not allow you to create a chained diskette kit. A kit written to diskette must fit on a single diskette or be packaged as a set of kits on separate diskettes.

Use the following syntax for the gendisk command:

gendisk [-d] [-i] [-k filename] [-w] [-v] [hostname:] prodID devname

-d

Creates a distribution disk in direct CD (DCD) format. This means that the distribution disk contains uncompressed file systems that are arranged in the same way as the software will be installed on the system.

-i

Creates a distribution disk in ISO 9660 format. This means that the distribution disk contains an ISO 9660-compliant CD-ROM file system (CDFS).

-k filename

Uses an alternate kit descriptor database, filename, on the local system. You may use either a full absolute pathname or a relative pathname from the directory where you run the gendisk utility. You do not have to name the file kitcap.

-w

If used without the -v option, writes the product media without verification. If used with the -w option, the gendisk utility writes and then verifies the product media.

-v

If used without the -w option, verifies the product media without writing it first. This assumes that you already have written kit files to the distribution media. If used with the -w option, the gendisk utility writes and then verifies the product media.

hostname:

The optional hostname: operand is the name of a remote machine that contains the kitcap file. The utility searches the /etc/kitcap file on the remote machine for the prodID and uses it for creating the media. The colon (:) is a required delimiter for TCP/IP networks, and space is permitted between the colon and the prodID. For example, if the product code is OAT100 and you are using the kit descriptor database on node mynode, use mynode:OAT100 for this option.

prodID

The mandatory prodID operand is a kit identifier consisting of the product code and version number specified in the CODE and VERS fields of the kit's key file. Refer to Section 3.3 for information about the key file.

devname

The mandatory devname operand specifies the device special file name for a raw or character disk device such as /dev/rdisk/dsk1. The gendisk utility uses the disk partition specified in the kit descriptor and ignores any partition specified on the command line.

Note

If you do not use either the -w or -v options, the gendisk utility writes and then verifies the product media.

The command illustrated in Example 5-3 creates a tar format kernel product kit for OAT100 on the c partition of dsk0:

Example 5-3:  Sample gendisk Command

# gendisk OAT100 /dev/rdisk/dsk0c

Refer to the gendisk(1) reference page for more information about this utility.

5.3.3    Building a Kernel Product Kit on Magnetic Tape

When the product subsets are located in the output area of the kit directory structure, use the gentapes utility to create the kit on magnetic tape. Use the following syntax for the gentapes command:

gentapes [ -w | -v ] [hostname:] prodID devname

-w

Writes the product media without verification. Do not use the -w option with the -v option.

-v

Verifies the product media without writing it first. Do not use the -v option with the -w option.

hostname:

The optional hostname: argument is the name of a remote network machine that contains the kit descriptor database. The gentapes utility searches the kit descriptor database on the remote machine for the kit identifier (prodID[TK|MT]) and uses it to create the media. The colon (:) is a required delimiter for TCP/IP networks, and space is permitted between the colon and the prodID. For example, if the product code is OAT100 and you are using the kit descriptor database on node mynode, use mynode:OAT100 for this option.

prodID

The mandatory prodID operand is a kit identifier consisting of the product code and version number specified in the CODE and VERS fields of the kit's key file. Refer to Section 3.3 for information about the key file.

devname

The mandatory devname operand specifies the device special file name for a no-rewind tape device such as /dev/ntape/tape0l. The gentapes utility uses the default tape density for the device and ignores any suffix specified on the command line.

Note

If you do not use either the -w or -v option, the gentapes utility writes the tape, rewinds it, and then verifies the files in the kit descriptor.

The command illustrated in Example 5-4 creates a tar format user product kit for OAT100 on the magnetic tape in /dev/ntape/dat:

Example 5-4:  Sample gentapes Command

# gentapes OAT100 /dev/ntape/dat

Refer to the gentapes(1) reference page for more information about this utility.

5.4    Testing the Distribution Media

Before shipping a kernel product kit to customers, you should test the kit with the same procedures that your customers will use on configurations that resemble your customers' systems.

Run the following tests to test a kernel product kit:

  1. Use the setld utility to verify that the subsets have been built correctly and that the files get installed into the correct locations on the target system. (Section 5.4.1)

  2. Use the ris utility to add a kernel product kit into a RIS area and verify that the correct files are present on the kit. Then, register the client system to the RIS area and start a Full Installation on the client system. (Section 5.4.2)

The following sections describe how to set up and perform these tests.

5.4.1    Testing a Kernel Product Kit with the setld Utility

Use the setld utility to test a kernel product kit as described in the following procedure for the OAT100 kit:

  1. Log in to the system as root or use the su command to gain superuser privileges.

  2. Place the CD-ROM in the drive.

  3. Create a directory to be the media mount point, such as /cdrom:

    # mkdir /cdrom
    

  4. Mount the CD-ROM on /cdrom. For example, if the CD-ROM device is located on the c partition of cdrom0, enter the following command:

    
    # mount -r /dev/disk/cdrom0c /cdrom
    

  5. Use the setld utility to install the kernel product subsets:

    # setld -l /cdrom/OAT100/kit
    

    *** Enter subset selections ***
     
    The following subsets are mandatory and will be installed automatically
    unless you choose to exit without installing any subsets:
     
          * Document Builder Kernel Support
          * Document Builder Tools
     
    The subsets listed below are optional:
     
     - Other:
         1) Document Builder Templates
     
    Or you may choose one of the following options:
     
         2) ALL mandatory and all optional subsets
         3) MANDATORY subsets only
         4) CANCEL selections and redisplay menus
         5) EXIT without installing any subsets
     
    Estimated free diskspace(MB) in root:54.5 usr:347.0
     
    Enter your choices or press RETURN to redisplay menus.
     
    Choices (for example, 1 2 4-6): 2
     
    You are installing the following mandatory subsets:
     
            Document Builder Kernel Support
            Document Builder Tools
     
    You are installing the following optional subsets:
     
     - Other:
            Document Builder Templates
     
    Estimated free diskspace(MB) in root:54.5 usr:347.0
     
    Is this correct? (y/n): y
     
    Checking file system space required to install selected subsets:
     
    File system space checked OK.
     
    3 subset(s) will be installed.
     
    Loading subset 1 of 3 ...
     
    Document Builder Tools
       Copying from /cdrom/OAT100/kit (disk)
       Verifying
     
    Loading subset 2 of 3 ...
     
    Document Builder Templates
       Copying from /cdrom/OAT100/kit (disk)
       Verifying
     
    Loading subset 3 of 3 ...
     
    Document Builder Kernel Support
       Copying from /cdrom/OAT100/kit (disk)
       Verifying
     
    3 of 3 subset(s) installed successfully.
     
    Configuring "Document Builder Tools" (OATODB100)
     
    The installation of the Document Builder Tools (OATODB100)
    software subset is complete.
     
    Please read the /opt/OAT100/README.odb file before
    using the Document Builder Tools product.
     
    Configuring "Document Builder Templates" (OATODBTEMPS100)
     
    Configuring "Document Builder Kernel Support" (OATODBKERNEL100)
     
    *** Document Builder Kernel Support Product Installation Menu ***
     
    1. Statically configure the graphics support
    2. Dynamically configure the graphics support
     
    Type the number of your choice []: 1
     
    *** KERNEL CONFIGURATION AND BUILD PROCEDURE ***
     
    Saving /sys/conf/TEST01 as /sys/conf/TEST01.bck
     
    Do you want to edit the configuration file? (y/n) [n]: n
     
    *** PERFORMING KERNEL BUILD ***
            Working....Fri May 19 14:49:25 EDT 2000
     
    The new kernel is /sys/TEST01/vmunix
     
    The /sys/TEST01/vmunix kernel has been
    moved to /vmunix and the changes will take effect
    the next time the system is rebooted.
    # 
    

    The setld utility displays prompts and messages to guide you through the process of selecting the subsets you want to install. As each subset is loaded, the setld utility calls the subset control program as needed, including static or dynamic driver configuration. Figure 5-5 shows the steps the subset control program takes to statically configure the driver.

    Figure 5-5:  Static Configuration of a Driver

  6. When the installation is complete, unmount the CD-ROM:

    # umount /cdrom
    

  7. If the product was configured statically, restart the system with the new kernel:

    # /usr/sbin/shutdown -r now
    

    When the system restarts, the device driver is available on the system.

  8. Verify that the installed product functions correctly.

  9. Delete the ODB subsets with the setld -d command. You see output similar to the following:

    
    # setld -d OATODB100 OATODBTEMPS100 OATODBKERNEL100
    

    Deleting "Document Builder Templates" (OATODBTEMPS100).
     
    *** KERNEL CONFIGURATION AND BUILD PROCEDURE ***
     
    Saving /sys/conf/TEST01 as /sys/conf/TEST01.bck
     
    Do you want to edit the configuration file? (y/n) [n]: n
     
    *** PERFORMING KERNEL BUILD ***
            Working....Fri May 19 14:55:31 EDT 2000
     
    The new kernel is /sys/TEST01/vmunix
     
    The /sys/TEST01/vmunix kernel has been
    moved to /vmunix and the changes will take effect
    the next time the system is rebooted.
     
    Deleting "Document Builder Kernel Support" (OATODBKERNEL100).
     
    Deleting "Document Builder Tools" (OATODB100).
    # 
    

  10. Restart the system to ensure that it reboots with the new kernel after the product is removed:

    # /usr/sbin/shutdown -r now
    

    When the system restarts, the product should not be available on the system.

Refer to the Installation Guide and the setld(8) reference page for more information about using the setld utility to install layered products.

5.4.2    Testing a Kernel Product Kit in a RIS Area

Use the ris utility to test a kernel product kit on a RIS server as described in the following procedure for the OAT100 kit. Refer to the Sharing Software on a Local Area Network manual for additional information about Remote Installation Services (RIS).

  1. Log in to the RIS server as root or use the su command to gain superuser privileges.

  2. Place the CD-ROM in the drive.

  3. Create a directory to be the media mount point, such as /cdrom:

    # mkdir /cdrom
    

  4. Mount the CD-ROM on /cdrom. For example, if the CD-ROM device were located on the c partition of cdrom0, enter the following command:

    
    # mount -r /dev/disk/cdrom0c /cdrom
    

  5. Enter /usr/sbin/ris to start the ris utility. You see the RIS Utility Main Menu:

    Checking accessibility of RIS areas.... done
     
    *** RIS Utility Main Menu ***
     
    Choices without key letters are not available.
     
      ) ADD a client
      ) DELETE software products
     i) INSTALL software products
      ) LIST registered clients
      ) MODIFY a client
      ) REMOVE a client
      ) SHOW software products in remote installation environments
     x) EXIT
     
    Enter your choice:
    

  6. Enter i to select Install software products. You see the RIS Software Installation Menu:

    RIS Software Installation Menu:
        1)  Install software into a new area
        2)  Add software into an existing area
        3)  Return to previous menu
     
    Enter your choice:
    

  7. Depending on your test environment, enter 1 to select Install software into a new area or 2 to Add software into an existing area.

  8. Install the software as described in Sharing Software on a Local Area Network.

To install the product kit from the RIS server onto the client system, first register the client system with the RIS server and then use the setld utility as described in the following procedure:

  1. Log in to the RIS server as root or use the su command to gain superuser privileges.

  2. Enter /usr/sbin/ris to start the ris utility. You see the RIS Utility Main Menu:

    Checking accessibility of RIS areas.... done
     
    *** RIS Utility Main Menu ***
     
    Choices without key letters are not available.
     
      ) ADD a client
      ) DELETE software products
     i) INSTALL software products
      ) LIST registered clients
      ) MODIFY a client
      ) REMOVE a client
      ) SHOW software products in remote installation environments
     x) EXIT
     
    Enter your choice:
    

  3. Enter a to select ADD a client.

  4. Enter the client information as described in Sharing Software on a Local Area Network.

  5. Log in to the RIS client as root or use the su command to gain superuser privileges.

  6. Use the setld -l command to load the product subsets from the RIS area. For example, if the RIS server is named test01, enter the following command:

    
    # setld -l test01:
    

    The setld utility displays prompts and messages to guide you through the installation process as described in Sharing Software on a Local Area Network.

    Refer to the Installation Guide and the setld(8) reference page for more information on using the setld utility to install layered products.