JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 10 1/13 Installation Guide: JumpStart Installations     Oracle Solaris 10 1/13 Information Library
search filter icon
search icon

Document Information

Preface

1.  Where to Find Oracle Solaris Installation Planning Information

2.  JumpStart (Overview)

3.  Preparing JumpStart Installations (Tasks)

4.  Using Optional JumpStart Features (Tasks)

5.  Creating Custom Rule and Probe Keywords (Tasks)

Probe Keywords

Creating a custom_probes File

Syntax of the custom_probes File

Syntax of Function Names in the custom_probes File

How to Create a custom_probes File

Validating the custom_probes File

How to Validate the custom_probes File

6.  Performing a JumpStart Installation (Tasks)

7.  Installing With JumpStart (Examples)

8.  JumpStart Keyword Reference

9.  Installing a ZFS Root Pool With JumpStart

Glossary

Index

Creating a custom_probes File

The rule and probe keywords that are described in Rule Keywords and Values and Probe Keywords and Values might not be precise enough for your needs. You can define your own custom rule or probe keywords by creating a custom_probes file.

The custom_probes file is a Bourne shell script that contains two types of functions. You must save the custom_probes file in the same JumpStart directory where you saved the rules file. The two types of functions that you can define in a custom_probes file are as follows:

Syntax of the custom_probes File

The custom_probes file can contain any valid Bourne shell command, variable, or algorithm.

You can define probe and comparison functions that require a single argument in the custom_probes file. When you use the corresponding custom probe keyword in the rules file, the argument after the keyword is interpreted (as $1).

When you use the corresponding custom rule keyword in the rules file, the arguments are interpreted in sequence. The sequence starts after the keyword and ends before the next && or begin script, whichever comes first.

The custom_probes file must meet the following requirements:

To improve clarity and organization, define all probe functions first at the top of the file, followed by all comparison functions.

Syntax of Function Names in the custom_probes File

The name of a probe function must begin with probe_. The name of a comparison function must begin with cmp_.

Functions that begin with probe_ define new probe keywords. For example, the function probe_tcx defines the new probe keyword tcx. Functions that begin with cmp_ define new rule keywords. For example, cmp_tcx defines the new rule keyword tcx.

How to Create a custom_probes File

  1. Create a Bourne shell script text file and name it custom_probes.
  2. In the custom_probes text file, define your probe and comparison functions.

    When you use corresponding custom probe keyword in the rules file, the arguments after the keyword are interpreted in sequence (as $1, $2, and so on).

    When you use the corresponding custom rule keyword in the rules file, the arguments are interpreted in sequence. The sequence starts after the keyword and ends before the next && or begin script, whichever comes first.

  3. Save the custom_probes file in the JumpStart directory next to the rules file.
  4. Ensure that root owns the rules file and that the permissions are set to 644.

Example 5-1 custom_probes File

#!/bin/sh
# 
# custom_probe script to test for the presence of a TCX graphics card.
# 

# 
# PROBE FUNCTIONS
# 
probe_tcx() {
  SI_TCX=`modinfo | grep tcx | nawk '{print $6}'`
  export SI_TCX
}

# 
# COMPARISON FUNCTIONS
# 
cmp_tcx() {
  probe_tcx

  if [ "X${SI_TCX}" = "X${1}" ]; then
     return 0
  else
     return 1
  if
}

Example 5-2 Custom Probe Keyword Used in a rules File

This example rules file shows the use of the probe keyword that is defined in the preceding example, tcx. If a TCX graphics card is installed and found in a system, profile_tcx is run. Otherwise, profile is run.

probe tcx
tcx     tcx     -     profile_tcx     -
any     any     -     profile         -

See Also

You can find additional examples of probe and comparison functions in the following directories:


Note - Always place probe keywords at or near the beginning of the rules file. This placement ensures that the keywords are read and run before other rule keywords that might rely on the probe keywords.