The rules file is a text file that should contain a rule for each group of systems (or single systems) that you want to automatically install. Each rule distinguishes a group of systems based on one or more system attributes, and it links each group to a profile, which is a text file that defines how the Solaris software will be installed on each system in the group. For example, the rule
karch sun4c - basic_prof - |
specifies that the Solaris installation program will automatically install any system with the sun4c platform group based on the information in the basic_prof profile. 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 on "Creating a Profile Diskette " or "Creating a Profile 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 Solaris installation program attempts to match the system being installed to the rules in the rules.ok file in order: first rule through the last rule. A rule match occurs when the system being installed matches all of the system attributes defined in the rule. As soon as a system matches a rule, the Solaris installation program stops reading the rules.ok file and begins to install the system based on the matched rule's profile.
At least one rule.
Rules that have at least a rule keyword, a rule value, and a corresponding profile. Rules must also have a minus sign (-) in the begin and finish fields if there is no entry.
The rules file allows:
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.
Rules to span multiple lines. You can let a rule wrap to a new line, or you can continue a rule on a new line by using a backslash (\) before the carriage return.
Open a new text file (it must be named rules) using the editor of your choice.
You can create a new rules file or edit the sample rules file provided in the JumpStart directory you created.
Add a rule in the rules file for each group of systems you want to install using custom JumpStart.
Refer to the following information as you add rules to the rules file:
A rule within the rules file must have the following syntax:
[!]rule_keyword rule_value [&& [!]rule_keyword rule_value]... begin profile finish |
Is a symbol used before a rule keyword to indicate negation. |
|
Is a symbol used to indicate an optional expression or field. |
|
Is a symbol used to indicate the preceding expression may be repeated. |
|
Is 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 system with the same attribute to a profile. See Table 8-2 for the list of rule keywords. |
|
Is a value that provides the specific system attribute for the corresponding rule keyword. See Table 8-2 for the list of rule values. |
|
Is a symbol that must be used to join rule keyword and rule value pairs together 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. |
|
Is 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. |
|
Is a name of a text file that defines how the Solaris software will 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 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". |
|
Is the 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. |
Save the rules file into the JumpStart directory.
The rules file should be owned by root and have permissions equal to 644.
This completes the procedure to create a rules file. To create profiles, go to "Creating a Profile".
The following code example shows several example rules in a rules file. Each line has a rule keyword and a valid value for that keyword. The Solaris installation program scans the rules file from top to bottom. When the Solaris installation program matches a rule keyword and value with a known system, it installs the Solaris software specified by the profile listed in the profile field.
# rule keywords and rule values begin script profile finish script # ----------------------------- ------------ -------- ------------- [This rule matches if the system's host name is eng-1. The basic_prof profile is used to install the Solaris software on the system that matches this rule.] hostname eng-1 - basic_prof - [The rule matches if the system is on subnet 192.43.34.0 and it is not a SPARCstation IPX(TM) (SUNW,Sun 4_50). The net_prof profile is used to install the Solaris software on systems that match this rule. ] network 192.43.34.0 && !model \ 'SUNW,Sun 4_50' - net_prof - [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. This rule also provides an example of rule wrap, which is defined on "Important Information About the rules File".] model SUNW,SPARCstation-LX - lx_prof complete [This rule matches if the system is on subnet 193.144.2.0 and the system is an x86 system. The setup begin script, the x86_prof profile, and the done finish script are used to install the Solaris software on systems that match this rule.] network 193.144.2.0 && karch i86pc setup x86_prof done [This rule matches if the system has between 16 and 32 Mbytes of memory and is an x86 system. The prog_prof profile is used to install the Solaris software on systems that match this rule.] memsize 16-32 && arch i386 - prog_prof - [This rule matches any system that did not match the previous rules. The generic_prof profile is used to install the Solaris software on systems that match this rule. If used, -any should always be in the last rule.] any - - generic_prof - |
Table 8-2 describes the rule keywords and rule values that you can use in the rules file.
Table 8-2 Rule Keyword and Rule Value Descriptions
Rule Keyword |
Rule Values |
Description |
|
---|---|---|---|
minus sign (-) |
Match always succeeds. |
||
processor_type Valid values for processor_typeare sparc for the SPARC platform, and i386 for the x86 platform. |
Matches a system's processor type. The uname -p command reports the system's processor type. |
||
domain_name |
Matches a system's domain name, which controls how a name service determines information. If you have a system already installed, the domainname command reports the system's domain name. |
||
disk_name size_range disk_name - A disk name in the form cxtydz, such as c0t3d0, or the special word rootdisk. If rootdisk is used, the disk to be matched is determined in the following order:
size_range - The size of the disk, which must be specified as a range of Mbytes (xx-xx). |
Matches a system's disk (in Mbytes). Example:
The example tries to match a system with a c0t3d0 disk that is between 250 and 300 Mbytes. Note - When calculating size_range, remember that a Mbyte equals 1,048,576 bytes. A disk may be advertised as a "535 Mbyte" disk, but it may have only 510 million bytes of disk space. The Solaris installation program will actually view the "535 Mbyte" disk as a 510 Mbyte disk because 535,000,000 / 1,048,576 = 510. So, a "535 Mbyte" disk would not match a size_range equal to 530-550. |
||
IP_address |
Matches a system's IP address. |
||
host_name |
Matches a system's host name. If you have a system already installed, the uname -n command reports the system's host name. |
||
slice version slice - A disk slice name in the form cwtxdysz, such as c0t3d0s5, or the special words any or rootdisk. If any is used, all of the system's disks will try to be matched (in kernel probe order). If rootdisk is used, the disk to be matched is determined in the following order:
version - A version name, Solaris_2.x, or the special words any or upgrade. If any is used, any Solaris or SunOS release is matched. If upgrade is used, any upgradable Solaris 2.1 or greater release is matched. If the installation program finds a Solaris release but is unable to determine the version, the version returned is SystemV. |
Matches a disk that has a root file system corresponding to a particular version of Solaris software. Example:
The example tries to match a system that has a Solaris 2.5 root files system on c0t3d0s1. |
||
platform_group Valid values are: sun4d, sun4c, sun4m, sun4u, i86pc, prep. (See Appendix C, Platform Names and Groups for a detailed list of systems and their corresponding platform group.) |
Matches a system's platform group. If you have a system already installed, the arch -k command or the uname -m command reports the system's platform group. |
||
physical_mem The value must be a range of Mbytes (xx-xx) or a single Mbyte value. |
Matches a system's physical memory size (in Mbytes). Example:
The example tries to match a system with a physical memory size between 16 and 32 Mbytes. If you have a system already installed, the output of the prtconf command (line 2) reports the system's physical memory size. |
||
platform_name |
Matches a system's platform name. See Appendix C, Platform Names and Groups for a list of valid platform names. To find the platform name of an installed system, use the uname -i command or the output of the prtconf command (line 5). Note - If the platform_name contains spaces, you must replace spaces with underscores (_). For example: SUNW,Sun_4_50 |
||
network_num |
Matches a system's network number, which the Solaris installation program determines by performing a logical AND between the system's IP address and the subnet mask. Example:
The example tries to match a system with a 193.144.2.8 IP address (if the subnet mask were 255.255.255.0). |
||
Solaris_2.x |
Matches a version of Solaris software already installed on a system. Example:
The example tries to match a system with Solaris 2.5 already installed. |
||
size_range The value must be specified as a range of Mbytes (xx-xx). |
Matches the total disk space on a system (in Mbytes). The total disk space includes all the operational disks attached to a system. Example:
The example tries to match a system with a total disk space between 300 and 500 Mbytes. Note - When calculating size_range, remember that a Mbyte equals 1,048,576 bytes. A disk may be advertised as a "535 Mbyte" disk, but it may have only 510 million bytes of disk space. The Solaris installation program will actually view the "535 Mbyte" disk as a 510 Mbyte disk because 535,000,000 / 1,048,576 = 510. So, a "535 Mbyte" disk would not match a size_range equal to 530-550. |