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.
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.
The rules file must have the following attributes:
The rules file can contain any of the following:
Commented text
Any text that is included after the # symbol on a line is treated by JumpStart as commented text. If a line begins with the # symbol, the entire line is treated as a comment.
One or more blank lines
One or more multiline rules
To continue a single rule onto a new line, include a backslash character (\) just before pressing Return.
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.
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.
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.
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.
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.
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:
A keyword, a value, and a corresponding profile
A minus sign (-) in the begin and finish fields if no begin or finish scripts are specified
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.
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.
Save the rules file in the JumpStart directory.
Ensure that root owns the rules file and that the permissions are set to 644.
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.
# 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.
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.
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.
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.
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.
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.
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.