Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
23.  Preparing Custom JumpStart Installations (Tasks) Creating the rules File To Create a rules File  Previous   Contents   Next 
   
 

rules File Example

The following example shows several 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 that is listed in the profile field.


Example 23-1 rule File

 # rule keywords and rule values       begin script       profile       finish script
 # -----------------------------       ------------       --------      -------------
  hostname eng-11                      -                  basic_prof    -
  network 192.43.34.0 && !model \
 'SUNW,SPARCstation-20'2               -                  net_prof      -
  model SUNW,SPARCstation-LX3          -                  lx_prof       complete
  network 193.144.2.0 && karch sun4u  setup4              4u_prof       done
  memsize 64-128 && arch sparc5         -                 prog_prof     -
  any6  -                              -                  generic_prof  -
  1. The 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 the rule.

  2. The rule matches if the system is on subnet 192.43.34.0 and if the system is not a SPARCstation™ 20 (SUNW,SPARCstation-20). The net_prof profile is used to install the Solaris software on systems that match this rule. The rule also provides an example of rule wrap, which is defined in "Syntax of the rules File".

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

  4. The rule matches if the system is on subnet 193.144.2.0 and is a sun4u system. The setup begin script, the 4u_prof profile, and the done finish script are used to install the Solaris software on systems that match the rule.

  5. The rule matches if the system has between 64 and 128 Mbytes of memory. The prog_prof profile is used to install the Solaris software on systems that match the rule.

  6. The 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 the rule. If any is used, it should always be the last rule in the rules file.


Creating a Profile

A profile is a text file that defines how to install the Solaris software on a system. A profile defines elements of the installation, for example, the software group to install. Every rule specifies a profile that defines how a system is to be installed. You can create different profiles for every rule or the same profile can be used in more than one rule.

A profile consists of one or more profile keywords and their values. Each profile keyword is a command that controls one aspect of how the JumpStart program is to install the Solaris software on a system. For example, the following profile keyword and value specify that the JumpStart program install the system as a server:

system_type  server

Note - If you created the JumpStart directory by using the procedures that are presented in "Creating a Profile Server for Networked Systems" or "Creating a Profile Diskette for Standalone Systems", sample profiles are already located in the JumpStart directory.


Syntax of Profiles

A profile must contain the following:

  • The install_type profile keyword as the first entry

  • One keyword per line

  • The root_device keyword if the systems that are being upgraded by the profile contain more than one root (/) file system that can be upgraded

A profile can contain the following:

  • Commented text

    Any text that is included after the # symbol on a line is treated by the JumpStart program as commented text. If a line begins with the # symbol, the entire line is treated as a comment.

  • One or more blank lines

To Create a Profile

  1. Use a text editor to create a text file. Name the file descriptively. Or, open a sample profile in the JumpStart directory that you created.


    Note - Ensure that the name of the profile reflects how you intend to use the profile to install the Solaris software on a system. For example, you might name the profiles basic_install, eng_profile, or user_profile.


  2. Add profile keywords and values to the profile.

    For a list of profile keywords and values, see "Profile Keywords and Values".


    Note - Profile keywords and their values are case sensitive.


  3. Save the profile in the JumpStart directory.

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

  5. Test the profile (optional).

    "Testing a Profile" contains information about testing profiles.

Profile Examples

The following examples of profiles show how to use different profile keywords and profile values to control how the Solaris software is installed on a system. "Profile Keywords and Values" contains a description of profile keywords and values.


Example 23-2 Mounting Remote File Systems and Adding and Deleting Packages

 
# profile keywords        profile values
# -----------------       -----------------
  install_type            initial_install1
  system_type             standalone2
  partitioning            default3
  filesys                 any 512 swap   # specify size of /swap
  cluster                 SUNWCprog4
  package                 SUNWman delete5
  cluster                 SUNWCacc
  1. The install_type keyword is required in every profile.

  2. The system_type keyword defines that the system is to be installed as a standalone system.

  3. The file system slices are determined by the software to be installed with the value default. The size of swap is set to 512 Mbytes and is installed on any disk, value any.

  4. The Developer Solaris Software Group, SUNWCprog, is installed on the system.

  5. The standard man pages are mounted from the file server, s_ref, on the network, the man page packages are not to be installed on the system. The packages that contain the System Accounting utilities are selected to be installed on the system.



Example 23-3 Specifying Where to Install File Systems

# profile keywords        profile values
# ----------------        -------------------
  install_type	            initial_install
  system_type             standalone 
  partitioning            explicit1
  filesys                 c0t0d0s0 auto /
  filesys                 c0t3d0s1 auto swap
  filesys                 any auto usr
  cluster                 SUNWCall2
  1. The file system slices are determined by the filesys keywords, value explicit. The size of root (/) is based on the selected software, value auto, and is installed on c0t0d0s0. The size of swap is set to the necessary size and is installed on c0t3d0s1. usr is based on the selected software and the installation program determines where usr is installed, based on the value any.

  2. The Entire Solaris Software Group, SUNWCall, is installed on the system.



Example 23-4 Reallocating Disk Space for an Upgrade

# profile keywords         profile values
# ----------------         -------------------
  install_type             upgrade1 
  root_device              c0t3d0s22 
  backup_media             remote_filesystem timber:/export/scratch3
  layout_constraint        c0t3d0s2 changeable 1004
  layout_constraint        c0t3d0s4 changeable
  layout_constraint        c0t3d0s5 movable 
  package                  SUNWbcp delete5
  package                  SUNWxwman add6
  cluster                  SUNWCacc add   
  locale                   de7
 
 
 
  Previous   Contents   Next