Solaris 8 Advanced Installation Guide

Creating the rules File

What Is a rules File?

The rules file is a text file that contains a rule for each group of systems (on a single system) on which you want to install the Solaris operating environment. Each rule distinguishes a group of systems based on one or more system attributes and links each group to a profile, which is a text file that defines how the Solaris software is to be installed on each system in the group. For example, the rule:

karch i86pc - basic_prof -

specifies that JumpStart is to automatically install any system with the i86pc 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.


Note -

If you set up the JumpStart directory using the procedures in "Creating a Profile Diskette" or "Creating a Profile Server", an example rules file is already located in the JumpStart directory. The sample rules file contains documentation and some example rules. If you use the sample rules file, make sure you comment out the example rules you do not intend to use.


Syntax of the rules File

The rules file must:

The rules file can contain:

Syntax of a Rule

A rule must contain at least a:

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

[[!]]rule_keyword rule_value [[&& [[!]]rule_keyword rule_value]] ... begin  profile  finish
Table 6-2 Syntax Elements of a Rule

Element 

Description 

!

Is a symbol used before a keyword to indicate negation. 

rule_keyword

Is a predefined lexical unit or word 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 6-3 for the list of rule keywords.

rule_value

Is a value that provides the specific system attribute for the corresponding rule keyword. Rule values are described in Table 6-3.

&&

Is a symbol you must use 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. 

begin

Is the 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 be located in the JumpStart directory.

Information about how to create begin scripts is presented in "Creating Begin Scripts".

profile

Is 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. 


Note -

Optional ways to use the profile field are described in "Using a Site-Specific Installation Program" and "Creating Derived Profiles With a Begin Script".


finish

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 be located in the JumpStart directory.  

Information about how to create finish scripts is presented in "Creating Finish Scripts".

Rule Keywords and Values

Table 6-3 describes the keywords and values that you can use in the rules file.

Table 6-3 Descriptions of Rule Keywords and Values

Keyword 

Value 

Matches 

any

minus sign (-)

Anything (this keyword always succeeds). 

arch

processor_type

Valid values for processor_type are:

  • SPARC: sparc

  • IA: i386

A system's processor type. 

The uname -p command reports the system's processor type.

disksize

actual_disk_name size_range

actual_disk_name - A disk name in the form cxtydz, such as c0t3d0 or c0d0, or the special word rootdisk. If rootdisk is used, the disk to be matched is determined in the following order:

  • SPARC: The disk that contains the preinstalled boot image (a new SPARC based system with factory JumpStart installed)

  • The c0t3d0s0 disk, if it exists

  • The first available disk (searched in kernel probe order)

size_range - The size of the disk, which must be specified as a range of Mbytes (x-x).

The name and size of a system's disk (in Mbytes). 

Example:

disksize c0t3d0 250-300

In this example, JumpStart attempts to match a system disk named c0t3d0 that can hold between 250 to 300 Mbytes of information.

Example:

disksize rootdisk 750-1000

In this example, JumpStart attempts to match first, a system disk that contains a preinstalled boot image, next the c0t3d0s0 disk, if it exists, and finally the first available disk that can hold between 750 Mbytes to 1 Gbyte of information.


Note -

When calculating size_range, remember that a Mbyte equals 1,048,576 bytes. A disk might be advertised as a "535 Mbyte" disk, but it might contain only 510 million bytes of disk space. JumpStart actually views 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.


domainname

actual_domain_name

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.

hostaddress

actual_IP_address

A system's IP address. 

hostname

actual_host_name

A system's host name.  

If you have a system already installed, the uname -n command reports the system's host name.

installed

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, JumpStart attempts to match all of the system's disks (in kernel probe order). If rootdisk is used, the disk to be matched is determined in the following order:

  • SPARC: The disk that contains the preinstalled boot image (new SPARC based system with factory JumpStart installed)

  • The c0t3d0s0 disk, if it exists

  • The first available disk (searched in kernel probe 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 Solaris 2.1 or later release that can be upgraded is matched.

If JumpStart finds a Solaris release but is unable to determine the version, the version returned is SystemV.

A disk that has a root (/) file system corresponding to a particular version of Solaris software.

Example:

installed c0t3d0s1 Solaris_8

In the example, JumpStart attempts to match a system that has a Solaris 8 root (/) file system on c0t3d0s1.

karch

actual_platform_group

Valid values are: sun4d, sun4m, sun4u, i86pc. (A list of systems and their corresponding platform group is presented in Appendix A, Platform Names and Groups.)

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.

memsize

physical_mem

The value must be a range of Mbytes (x-x) or a single Mbyte value.

A system's physical memory size (in Mbytes).  

Example:

memsize 16-32

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.

model

actual_platform_name

A system's platform name. See Appendix A, 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).

network

network_num

A system's network number, which JumpStart determines by performing a logical AND between the system's IP address and the subnet mask.  

Example:

network 193.144.2.8

The example tries to match a system with a 193.144.2.8 IP address (if the subnet mask is 255.255.255.0). 

osname

Solaris_2.x

A version of Solaris software already installed on a system.  

Example:

osname Solaris_7

In this example, custom JumpStart attempts to match a system with Solaris 7 already installed. 

probe

probe_keyword

A valid probe or custom probe keyword. 

Example:

probe disks

The example returns the size of a system's disks (in Mbytes) in kernel probe order (c0t3d0s0, c0t3d0s1, c0t4d0s0, on a SPARC based system, for example) and sets the SI_DISKLIST, SI_DISKSIZES, SI_NUMDISKS, and SI_TOTALDISK environment variables.


Note -

The probe keyword is unique in that it doesn't attempt to match an attribute and consequently run a profile; it simply returns a value. Consequently, you cannot specify begin scripts, profiles, and finish scripts with the probe rule keyword.


Probe keywords are described in Chapter 8, Creating Custom Rule and Probe Keywords.

totaldisk

size_range

The value must be specified as a range of Mbytes (x-x).

The total disk space on a system (in Mbytes). The total disk space includes all the operational disks attached to a system. 

Example:

totaldisk 300-500

In this example, JumpStart tries to match a system with a total disk space between 300 and 500 Mbytes. 


Note -

When calculating size_range, remember that one Mbyte equals 1,048,576 bytes. A disk might be advertised as a "535 Mbyte" disk, but it might have only 510 million bytes of disk space. JumpStart actually views the "535 Mbyte" disk as a 510 Mbyte disk because 535,000,000 / 1,048,576 = 510. So, a "535 Mbyte" disk does not match a size_range equal to 530-550.


Sample rules File Contents

The following sample shows several example rules in a rules file. Each line has a rule keyword and a valid value for that keyword. JumpStart scans the rules file from top to bottom.


Note -

Do not insert the numbers shown in the left column. They are footnotes that appear after the sample.


When JumpStart 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 SPARCstationTM 20 (SUNW,SPARCstation-20). The net_prof profile is 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 "Syntax of the rules File".]  network 192.43.34.0 && !model \
 'SUNW,SPARCstation-20'                -                  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.]  model SUNW,SPARCstation-LX          -                  lx_prof       complete
  [This rule matches if the system is on subnet 193.144.2.0 and is an IA based system. The setup begin script, the IA_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              IA_prof       done
  [This rule matches if the system has between 16 and 32 Mbytes of memory and is an IA based 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 the last rule in the rules file.]  any  -                              -                  generic_prof  -

To Create a rules File

  1. Using a text editor of your choice, create a text file named rules or open the sample rules file in the JumpStart directory you created.

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

  3. Save the rules file in the JumpStart directory.

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