The rules file is a text file used to create the rules.ok file. The rules file is a lookup table consisting of one or more rules that define matches between workstation attributes and profiles. For example, the rule
karch sun4c - basic_prof -
matches a workstation with a sun4c platform name to the basic_prof profile, which the Trusted Solaris installation program would use to install the workstation.
If you set up the JumpStart directory by using the procedures "Creating a JumpStart Directory on a Diskette " or "Creating a JumpStart Directory on a Server", an example rules file should already be in the JumpStart directory; the example rules file contains documentation and some example rules. If you use the example rules file, make sure you comment out the example rules that you will not use.
During a custom JumpStart installation, the Trusted Solaris installation program attempts to match the rules in the rules.ok file in order, first rule through the last rule. A rule match occurs when the workstation being installed matches any of the rule values in the rule (as defined in "Rule Keyword and Rule Value Descriptions"). As soon as a workstation matches a rule, the Trusted Solaris installation program stops reading the rules.ok file and begins to install the workstation as defined by the matched rule's profile.
Since a workstation installed with custom JumpStart does not automatically reboot, create a rules file whose entries include a finish script that automatically reboots the workstation. An example finish script is in "Rebooting the Workstation with a Finish Script". A sample rules file:
hostname wren - basic_prof finish.sh
matches a workstation whose hostname is wren to the basic_prof profile, which the Trusted Solaris installation program would use to install the workstation. After installation, the finish.sh script would be executed to reboot the workstation.
Overview - The procedure to create a rules file involves:
Editing a file
Selecting rule keywords and rule values for each group of workstations you want to install using custom JumpStart. Any workstations that match the rule keyword and rule value will be installed as specified by the corresponding profile.
Follow this procedure to create a rules file.
As secadmin, at label admin_low
,
open the Admin Editor.
See "To Create or Open a File from the Trusted Editor" if you are unfamiliar with the steps.
To edit the sample rules file:
File to Edit: /jumpstart/rules
To create a rules file in /export/tmp:
File to Edit: /export/tmp/rules
Add a rule in the rules file for each group of workstations you want to install using custom JumpStart.
Be aware of these things as you add rules to the rules file:
"Rule Examples" provides some examples of rules.
"Rule Keyword and Rule Value Descriptions" provides the list of valid rule keywords and values.
The rules file must have at least one rule
A rule must have at least a rule keyword, a rule value, and a corresponding profile.
An individual rule in the rules file must have the following syntax:
[!]rule_keyword rule_value [&& [!]rule_keyword rule_value]... begin profile finish
The fields of a rule are described below:
A symbol used before a rule keyword to indicate negation.
A symbol used to indicate an optional expression or field.
A symbol used to indicate the preceding expression may be repeated.
A symbol that must be used to join (logically AND) rule keyword and rule value pairs together in the same rule. During a custom JumpStart installation, a workstation must match every pair in the rule before the rule matches.
A predefined keyword that describes a general system attribute, such as host name (hostname) or memory size (memsize). It is used with the rule value to match a workstation with the same attribute to a profile. See "Rule Keyword and Rule Value Descriptions" for the list of rule keywords.
A value that provides the specific system attribute for the corresponding rule keyword. See "Rule Keyword and Rule Value Descriptions" for the list of rule values.
A name of an optional Bourne shell script that can be executed before the installation begins. If no begin script exists, you must enter a minus sign (-) in this field. All begin scripts must reside in the JumpStart directory.
See "Creating Begin Scripts" for detailed information on how to create begin scripts.
A name of a text file used as a template that defines how to install Trusted Solaris on a workstation. The information in a profile consists of profile keywords and their corresponding profile values. All profiles must reside in the JumpStart directory.
Note - There are optional ways to use the profile field, which are described in "Using a Site-Specific Installation Program" and "Creating Derived Profiles With Begin Scripts".
A name of an optional Bourne shell script that can be executed after the installation completes. If no finish script exists, you must enter a minus sign (-) in this field. All finish scripts must reside in the JumpStart directory.
See "Creating Finish Scripts" for detailed information on how to create finish scripts.
This completes the procedure to create a rules file. To validate the rules file, see "How to Use check to Validate the rules File".
The following illustration shows several example rules in a rules file. Each line has a rule keyword and a valid value for that keyword. The Trusted Solaris installation program scans the rules file from top to bottom. When the Trusted Solaris installation program matches a rule keyword and value with a known workstation, it installs the Trusted Solaris software 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.43.34.0 && !model \ 'SUNW,Sun 4_50' - net_prof - model SUNW,SPARCstation-LX - lx_prof complete network 193.144.2.0 && karch sparc setup ultra_prof done any - - generic_prof -
This rule matches if the workstation's host name is eng-1. The basic_prof profile is used to install the Trusted Solaris software on the workstation that matches this rule.
The rule matches if the workstation is on subnet 192.43.34.0 and it is not a SPARCstation IPXTM(SUNW,Sun 4_50). The net_prof profile is used to install the Trusted Solaris software on workstations that match this rule.
The rule matches if the workstation is a SPARCstation LX. The lx_prof profile and the complete finish script are used to install the Trusted Solaris software on workstations that match this rule. This rule also provides an example of rule wrap, which is defined on "Important Information About the rules File".
This rule matches if the workstation is on subnet 193.144.2.0 and the workstation is a Sun Ultra. The setup begin script, the ultra_prof profile, and the done finish script are used to install the Trusted Solaris software on workstations that match this rule.
This rule matches any workstation that did not match the previous rules. The generic_prof profile is used to install the Trusted Solaris software on workstations that match this rule. If used, -any should always be in the last rule.
The following information is important to know about the rules file:
The rules.ok file is a generated version of the rules file, and it is required by the custom JumpStart installation software to match a workstation to a profile. You must run the check script to create the rules.ok file, and the rules.ok file should be owned by root and have permissions equal to 644.
You can add a comment after the pound sign (#) anywhere on a line. If a line begins with a #, the entire line is a comment line. If a # is specified in the middle of a line, everything after the # is considered a comment. Blank lines are also allowed in the rules file.
When creating the rules.ok file, the check script removes all the comment lines, comments at the end of a rule, and blank lines.
When a rule spans multiple lines, you can let a rule to wrap to a new line, or you can continue a rule on a new line by using a backslash (\) before the carriage return.
The rule_value, begin, and finish fields must have a valid entry or a minus sign (-) to specify that there is no entry.
The rule keywords and rule values that you can use in the rules file are listed and described below.
minus sign (-)
Match always succeeds.
processor_type
Matches a workstation's processor type. The uname -p command reports the workstation's processor type.
For example, SPARC is a platform; sparc is a processor_type.
domain_name
Matches a workstation's domain name, which controls how a name service determines information.
If you have a workstation already installed, the domainname(1M) command reports the workstation's domain name.
disk_name -- A disk name in the form cxtydz, such as c0t3d0, or the special word rootdisk. rootdisk should be used only when trying to match workstations that contain the factory-installed JumpStart software. rootdisk is described on Table 8-3.
size_range -- The size of the disk, which must be specified as a range of Mbytes (xx-xx).
Matches a workstation's disk (in Mbytes).
Example: disksize c0t3d0 250-300
The example tries to match a workstation with a c0t3d0 disk that is between 250 and 300 Mbytes.
When calculating size_range, remember that a Mbyte equals 1,048,576 bytes. A disk may be advertised as a "207 Mbyte" disk, but it may have less than 207 million bytes of disk space. The Trusted Solaris installation program will actually view the "207 Mbyte" disk as a 197 Mbyte disk because 207,000,000 / 1,048,576 = 197. So, a "207 Mbyte" disk would not match a size_range equal to 200-210.
IP_address
Matches a workstation's IP address.
host_name
Matches a workstation's host name.
If you have a workstation already installed, the uname -n command reports the host name.
slice - A disk slice name in the form cwtxdysz, such as c0t3d0s5, or the special words any or rootdisk. If -any is used, any disk attached to the workstation attempts to match. rootdisk should be used only when trying to match workstations that contain the factory-installed JumpStart software.rootdisk is described on Table 8-3.
version - A version name, such as Trusted_Solaris_7, or the special word any. If any is used, any Trusted Solaris or SunOS release is matched.
Matches a disk that has a root file system corresponding to a particular version of Trusted Solaris software.
Factory-installed JumpStart may not be supported by Trusted Solaris software.
platform_group
Matches a workstation's platform name.
Valid values are sun4d, sun4c, sun4m, and sun4u. (See Solaris 7 Sun Hardware Platform Guide.)
If you have a workstation already installed, the arch -k command or the uname -m command reports the workstation's platform group.
physical_mem
Matches a workstation's physical memory size (in Mbytes). The value must be a range of Mbytes (xx-xx) or a single Mbyte value.
Example: memsize 32-64
The example tries to match a workstation with a physical memory size between 32 and 64 Mbytes.
If you have a workstation already installed, the prtconf(1M) command reports the workstation's physical memory size in line 2. Run the command in the role admin.
model_name
Matches a workstation's model number, which is workstation-dependent and varies by the manufacturer. The list shown is not complete.
If you have a workstation already installed, the prtconf command reports the workstation's model number in line 5.
If you have a workstation already installed, the uname -i command reports the workstation's model name.
For example, a system name is different from a model_name:
Model Name
Sun 4_60
SUNW,Sun_4_50
SUNW,SPARCstation-10
SUNW,SPARCclassic
SUNW,SPARCstation-LX
SUNW,SPARCserver-1000
SUNW,SPARCcenter-2000
SUNW,SPARCstation-10,SX
SUNW,SPARCstation-20
SUNW,S240
SUNW,Ultra-1
SUNW,Ultra-1
SUNW,Ultra-2
SUNW,Ultra-Enterprise
Note: If the model_name contains spaces, the model_name must be inside a pair of single quotes ('). For example: 'SUNW,Sun 4_60'
network_num
Matches a workstation's network number, which the Trusted Solaris installation program determines by performing a logical AND between the workstation's IP address and the subnet mask.
Example: network 193.144.2.0
The example would match a workstation with a 193.144.2.8 IP address (if the subnet mask were 255.255.255.0).
Trusted_Solaris_version
Matches a version of Trusted Solaris software already installed on a workstation. Trusted_Solaris_version is the version of the Trusted Solaris environment installed on the workstation: for example, Trusted Solaris 2.5.1.
size_range
Matches the total disk space on a workstation (in Mbytes). The total disk space includes all the operational disks attached to a workstation. The value must be specified as a range of Mbytes (xx-xx).
Example: totaldisk 300-500
The example tries to match a workstation with a total disk space between 300 and 500 Mbytes.
When calculating size_range, remember that a Mbyte equals 1048576 bytes. A disk may be advertised as a "207 Mbyte" disk, but it may have only 207 million bytes of disk space. The Trusted Solaris installation program will actually view the "207 Mbyte" disk as a 197 Mbyte disk because 207000000 / 1048576 = 197. So, a "207 Mbyte" disk would not match a size_range equal to 200-210.
rootdisk is the logical name of the disk where the root file system is placed during an installation. During a custom JumpStart installation, the Trusted Solaris installation program sets the value of rootdisk (that is, the actual disk it represents) depending on various situations; this is described in the following table.
Table 8-3 How the Trusted Solaris Installation Program Sets rootdisk
For the Trusted Solaris installation program to use the value of rootdisk, the following conditions must be true in the profile specified for the workstation: