Solaris 10 Installation Guide for IBM BladeCenter Servers

Creating the rules File

The rules file is a text file that contains rules for each group of systems on which you want to install the Solaris OS. Each rule distinguishes a group of systems that are based on one or more system attributes. Each rule also links each group to a profile. A profile is a text file that defines how the Solaris software is to be installed on each system in the group. For example, the following rule specifies that the JumpStart program use the information in the basic_prof profile for installing any system with the sun4u platform group:

karch sun4u - basic_prof -

The rules file is used to create the rules.ok file, which is required for custom JumpStart installations.


Note –

If you set up the JumpStart directory by using the procedures in Creating a Profile Server for Networked Systems, a sample rules file is already located in the JumpStart directory. The sample rules file contains documentation and some sample rules. If you use the sample rules file, make sure you comment out the sample rules that you do not intend to use.


Syntax of the rules File

The rules file must have the following attributes:

The rules file can contain any of the following:

A rule within a rules file must adhere to the following syntax:

!rule-keyword rule-value && !rule-keyword rule-value ... begin  profile  finish
!

A symbol that is used before a keyword to indicate negation.

rule-keyword

A predefined lexical unit or word that describes a general system attribute, such as host name, hostname, or memory size, memsize. rule-keyword is used with the rule value to match a system with the same attribute to a profile.

rule-value

A value that provides the specific system attribute for the corresponding rule-keyword. Rule values are described in the section, Rule Keywords and Values in Solaris 10 Installation Guide: Custom JumpStart and Advanced Installations.

&&

A symbol you must use to join rule-keyword and rule-value pairs in the same rule (a logical AND). During a custom JumpStart installation, a system must match every pair in the rule before the rule matches.

begin

The name of an optional Bourne shell script that can be executed before the installation begins. If no begin script exists, you must type a minus sign (-) in this field. All begin scripts must be located in the JumpStart directory.

Information about how to create begin scripts is presented in Creating Begin Scripts in Solaris 10 Installation Guide: Custom JumpStart and Advanced Installations.

profile

The name of a text file that defines how the Solaris software is to be installed on the system when a system matches the rule. The information in a profile consists of profile keywords and their corresponding profile values. All profiles must be located in the JumpStart directory.

finish

The name of an optional Bourne shell script that can be executed after the installation is completed. If no finish script exists, you must type a minus sign (-) in this field. All finish scripts must be located in the JumpStart directory.

Information about how to create finish scripts is presented in Creating Finish Scripts in Solaris 10 Installation Guide: Custom JumpStart and Advanced Installations.

At the minimum, each rule must contain the following:

ProcedureHow To Create a rules File

  1. Use a text editor to create a text file that is named rules. Or, open the sample rules file in the JumpStart directory that you created.

  2. Add a rule in the rules file for each group of systems on which you want to install the Solaris software.

    For an example of some rules file keywords and values, see rules File Example. For a complete list of the rules file keywords and values, see Rule Keywords and Values in Solaris 10 Installation Guide: Custom JumpStart and Advanced Installations.

  3. Save the rules file in the JumpStart directory.

  4. Ensure that root owns the rules file and that the permissions are set to 644.

rules File Example

The following shows example rules in a rules file. Each line has a rule keyword and a valid value for that keyword.

The JumpStart program scans the rules file from top to bottom. When the JumpStart program matches a rule keyword and value with a known system, the JumpStart program installs the Solaris software that is specified by the profile listed in the profile field.


Example 1–11 Generic rules File

 # rule keywords and rule values       begin script       profile       finish script
 # -----------------------------       ------------       --------      -------------
  hostname eng-1                       -                  basic_prof    -
  network 192.168.255.255 && !model \
 'SUNW,Sun-Blade-100'                  -                  net_prof      -
  model SUNW,SPARCstation-LX           -                  lx_prof       complete
  network 192.168.2.0 && karch i86pc  setup               x86_prof      done
  memsize 64-128 && arch i386          -                  prog_prof     -
  any   -                              -                  generic_prof  -

The following describes some of the keywords and values from this example.

hostname

The rule matches if the system's host name is eng-1. The basic_prof profile is used for installing the Solaris software on systems that match the rule.

network

The rule matches if the system is on subnet 192.168.255.255, and if the system is not a Sun BladeTM 100 (SUNW,Sun-Blade-100). The net_prof profile is used for installing the Solaris software on systems that match this rule.

model

The rule matches if the system is a SPARCstation® LX. The lx_prof profile and the complete finish script are used to install the Solaris software on systems that match this rule.

network

The rule matches if the system is on subnet 192.168.2.0 and is an x86 based sun4u system. The setup begin script, the x864u_prof profile, and the done finish script are used for installing the Solaris software on systems that match the rule.

memsize

The rule matches if the system has between 64 and 128 MB of memory and is an x86 based system. The prog_prof profile is used for installing the Solaris software on systems that match this rule.

any

The rule matches any system that did not match the preceding rules. The generic_prof profile is used for installing the Solaris software on systems that match this rule. If any is used, it should always be the last rule in the rules file.