• Aucun résultat trouvé

Determine if the target numbers in the disk device names are unique in the multiple-disk configuration file that you created in the previous step

PART II Using Custom JumpStart

6. Determine if the target numbers in the disk device names are unique in the multiple-disk configuration file that you created in the previous step

If yes, stop. You are finished.

If no, open the file with a text editor and make the target numbers unique.

For example, the file might contain the same target number,t0, for different disk device names as shown here:

* /dev/rdsk/c0t0d0s2 partition map ...

* /dev/rdsk/c0t0d0s2 partition map

Change the second target number tot2, as shown here:

* /dev/rdsk/c0t0d0s2 partition map ...

* /dev/rdsk/c0t2d0s2 partition map

x86: Disk Configuration File Example

The following example shows how to create a single-disk configuration file, 500_test, on an x86 based system that contains a 500-Mbyte disk.

EXAMPLE 5–9x86: Creating a Disk Configuration File

First, you save the output of thefdiskcommand to a file that is named500_test:

# fdisk -R -W 500_test -h /dev/rdsk/c0t0d0p0

The500_testfile looks like the following:

* /dev/rdsk/c0t0d0p0 default fdisk table

* Dimensions:

* 512 bytes/sector

* 94 sectors/track

* 15 tracks/cylinder

* 1455 cylinders

*

* HBA Dimensions:

* 512 bytes/sector

* 94 sectors/track

* 15 tracks/cylinder

* 1455 cylinders

*

* systid:

* 1: DOSOS12

* 2: PCIXOS

* 4: DOSOS16

* 5: EXTDOS

* 6: DOSBIG

* 86: DOSDATA

* 98: OTHEROS

* 99: UNIXOS

* 130: SUNIXOS

*

* Id Act Bhead Bsect Bcyl Ehead Esect Ecyl Rsect Numsect

130 128 44 3 0 46 30 1001 1410 2050140

Second, you append the output of theprtvtoccommand to the500_testfile:

# prtvtoc /dev/rdsk/c0t0d0s2 >>500_test

The500_testfile is now a complete disk configuration file:

* /dev/rdsk/c0t0d0p0 default fdisk table

* Dimensions:

* 512 bytes/sector

* 94 sectors/track

* 15 tracks/cylinder

* 1455 cylinders

*

EXAMPLE 5–9x86: Creating a Disk Configuration File (Continued)

* 512 bytes/sector

* 94 sectors/track

* 15 tracks/cylinder

* 1455 cylinders

*

* systid:

* 1: DOSOS12

* 2: PCIXOS

* 4: DOSOS16

* 5: EXTDOS

* 6: DOSBIG

* 86: DOSDATA

* 98: OTHEROS

* 99: UNIXOS

* 130: SUNIXOS

*

* Id Act Bhead Bsect Bcyl Ehead Esec Ecyl Rsect Numsect

130 128 44 3 0 46 30 1001 1410 2050140

* /dev/rdsk/c0t0d0s2 partition map

*

* Dimensions:

* 512 bytes/sector

* 94 sectors/track

* 15 tracks/cylinder

* 1110 sectors/cylinder

* 1454 cylinders

* 1452 accessible cylinders

*

* Flags:

* 1: unmountable

* 10: read-only

* First Sector Last

* Partition Tag Flags Sector Count Sector Mount Directory

2 5 01 1410 2045910 2047319

7 6 00 4230 2043090 2047319 /space

8 1 01 0 1410 1409

9 9 01 1410 2820 422987

You have created disk configuration files for an x86 based system.“Testing a Profile”

on page 70contains information about using disk configuration files to test profiles.

Using a Site-Specific Installation Program

You can also use begin and finish scripts to create your own installation program to install Solaris software.

When you specify a minus sign (-) in the profile field, begin and finish scripts control how Solaris software is installed on a system instead of the profile and the Solaris installation program.

For example, if the following rule matches a system, thex_install.begbegin script and thex_install.finfinish script install Solaris software on the system that is namedclover:

hostname clover x_install.beg - x_install.fin

CHAPTER

6

Creating Custom Rule and Probe Keywords (Tasks)

This chapter provides information and procedures for creating your own custom rule and probe keywords.

“Probe Keywords” on page 93

“Creating acustom_probesFile” on page 94

“Validating thecustom_probesFile” on page 97

Probe Keywords

To understand what a probe keyword is, you first need to recall what a rule keyword is. A rule keyword is a predefined lexical unit or word that describes a general system attribute, such as host name,hostname, or memory size,memsize. Rule keywords and the values that are associated with them enable you to match a system that has the same attribute to a profile. This match of a system’s attributes defines how the Solaris software is to be installed on each system in the group.

Custom JumpStart environment variables, which you use in begin and finish scripts, are set on demand. For example, information about which operating system is already installed on a system is only available inSI_INSTALLEDafter theinstalledrule keyword is used.

In some situations, you might need to extract the same information in a begin or finish script for a purpose other than to match a system and run a profile. Probe keywords provide the solution. Probe keywords extract attribute information and remove the need for you to set up a matching condition and run a profile.

For a list of probe keywords and values, see“Probe Keywords and Values” on page

Creating a custom_probes File

The rule and probe keywords that are described in“Rule Keywords and Values”

on page 121and“Probe Keywords and Values” on page 167might not be precise enough for your needs. You can define your own custom rule or probe keywords by creating acustom_probesfile.

Thecustom_probesfile is a Bourne shell script that contains two types of functions.

You must save thecustom_probesfile in the same JumpStart directory where you saved therulesfile. The two types of functions that you can define in a

custom_probesfile are as follows:

Probe – Gathers the information you want or does the actual work and sets a correspondingSI_environment variable that you define. Probe functions become probe keywords.

Comparison – Calls a corresponding probe function, compares the output of the probe function, and returns 0 if the keyword matches or 1 if the keyword does not match. Comparison functions become rule keywords.

Syntax of the custom_probes File

Thecustom_probesfile can contain any valid Bourne shell command, variable, or algorithm.

Note –You can define probe and comparison functions that require a single argument in thecustom_probesfile. When you use the corresponding custom probe keyword in therulesfile, the argument after the keyword is interpreted (as $1).

When you use the corresponding custom rule keyword in therulesfile, the arguments are interpreted in sequence. The sequence starts after the keyword and ends before the next&&or begin script, whichever comes first.

Thecustom_probesfile must meet the following requirements:

Have the namecustom_probes

Haverootas its owner

Be executable and have permissions set to 755

Contain at least one probe function and one corresponding comparison function To improve clarity and organization, define all probe functions first, at the top of the

Syntax of Function Names in custom_probes

The name of a probe function must begin withprobe_. The name of a comparison function must begin withcmp_.

Functions that begin withprobe_define new probe keywords. For example, the functionprobe_tcxdefines the new probe keywordtcx. Functions that begin with cmp_define new rule keywords. For example,cmp_tcxdefines the new rule keyword tcx.

▼ To Create a custom_probes File

1. Use a text editor to create a Bourne shell script text file. Name the file