Mrconfig File Syntax
Silicon Graphics
 |
Mrconfig File Syntax
|
|
|
The mrconfig file is a text file that specifies what happens
on each client machine during a roboinst installation. Special keywords
are used to specify how the disks are partitioned, what software is
installed, and any custom shell commands to have execute.
This page describes the syntax of the mrconfig file. A set of
examples is provided for you to copy
and modify.
|
Blank lines, and comments between # and newline are ignored.
Other lines are statements comprised of whitespace-separated words.
The first word must be one of the specific keywords
described below.
The ordering of lines is only significant among lines that
have the same initial keyword. For example all lines that
begin with the keyword inst are assumed to contain input
lines for the inst program, and this input is passed to inst
in the same order it appears in the mrconfig file.
This is the order in which statements from your mrconfig
file are processed.
- miniroot booted
- mrconfig file obtained
- init keyword commands executed
- disks partitioned according to partition keywords
- fx keyword commands executed
- filesystems created according to partition keywords
- mkfs keyword commands executed
- filesystems mounted
- preinst keyword commands executed
- inst keyword commands executed
- build new kernel (unless the nokernel
keyword is specified)
- postinst keyword commands executed
- miniroot shutdown, boot to multi-user mode
Except for the /etc/hosts file, that is.
All hostnames in the mrconfig file and custom scripts,
must be specified as IP addresses, except
for the hostname of the bootserver, or unless you have
explicitly made an entry in the miniroot /etc/hosts file
from one of your scripts (eg. mrinit).
| Keyword |
Arguments |
|
|
| version |
number |
Versioning information in case
new keywords are added in the future. If this keyword
is omitted, version 1 is assumed. The RoboInst software
will terminate with an error if it encounters an mrconfig file with a higher
version number.
|
| loghost |
hostname or ip addresses |
The host(s) to which syslog messages will be
forwarded, in addition to being logged on the client. |
| partition |
device size type name mount-options mkfs-options |
Specify partitions to create and
filesystems to mount (see Partitioning below). |
| setenv |
variable value |
Set the named variable in the RoboInst environment. The variable
is also exported to subcommands such as those executed in the preinst,
postinst, etc. phases of the installation.
|
| onerror |
action |
The onerror keyword controls the behavior of inst in
response to an error, such as incompatible product selections,
disk space shortages, etc. If
set to ignore, the default, then inst continues past
errors without stopping (errors are still reported in /root/var/inst/INSTLOG
and in the SYSLOG). If set to wait, inst will stop and wait
in interactive mode whenever an error occurs.
|
| partition |
device size type name options |
Specify partitions to create and
filesystems to mount (see Partitioning below). |
| disksetup |
|
This keyword is required when repartitioning of the root disk drive
is requested, and the drive is in a pre-6.5 format, that is, when swap is
not located just after the volume header at the physical beginning of the
drive. The presence of this keyword will cause the swap partition to be
relocated to the beginning of the drive, when the installation session is
initiated from multi-user mode using roboinst.
Note: if the installation is initiated from the PROM
command monitor, the disksetup keyword will be ignored. You must
also specify disksetup=true on the boot command line when
initiating roboinst from the PROM command monitor (see prom(1M)). See Partitioning below. |
| init |
/bin/sh command |
This keyword is used to specify shell commands to
be executed during the init phase. |
| fx |
/bin/sh command |
This keyword is used to specify shell commands to
be executed during the fx phase. |
| mkfs |
/bin/sh command |
This keyword is used to specify shell commands to
be executed during the mkfs phase. |
| preinst |
/bin/sh command |
This keyword is used to specify shell commands to
be executed during the preinst phase. |
| inst |
inst command |
Inst command to be executed. Multiple inst keywords
may be specified. Commands
are collected in the order they appear in the mrconfig
file, copied into a temporary file, and then fed to inst
with the command:
inst -r /root -c tempfile |
| nokernel |
|
The presence of this keyword causes the autoconfig(1M)
phase
to be skipped, so that a new UNIX kernel will not be automatically
generated. If you use this keyword, you must manually build the UNIX kernel
from your own scripts, if necessary.
Normally, a new kernel named /root/unix.install is generated
by the autoconfig(1M)
command.
If it builds successfully, it is renamed to /root/unix before
the system is booted to multi-user mode, something like this:
if echo y | chroot /root \
/etc/init.d/autoconfig -o -N
then
mv /root/unix.install /root/unix
fi
|
| postinst |
/bin/sh command |
This keyword is used to specify shell commands to
be executed during the postinst phase. |
if
...
elsif
...
else
...
endif |
expr
expr
|
The conditional syntax
is similar to the if syntax in /bin/sh.
The first expr is executed as a /bin/sh statement,
and if it returns a zero exit
status, the statements up to the next else, elsif or
endif are evaluated.
Otherwise, the next expr is executed,
if its value is zero, the statements up to the next else/elsif/endif
are evaluted, and so on. If all the expressions exit non-zero, the
statements following the final else (if present) are evaluated.
NOTE: the elseif keyword is only supported by RoboInst version 1.1
are later. This version of RoboInst is included in the IRIX 6.5.2m release
(versions 8/12/98 and later).
As in /bin/sh, the elsif and else clause(s) are
optional. Multiple elsif clauses are allowed. Nesting
of if statements is permitted.
Conditional statements are useful for performing different
disk partitioning, or software installation instructions,
based on cpu-type, or graphics type, for example:
if [ $SGI_CPUBOARD = IP30 ]; then
init echo This is an Octane
elsif [ $SGI_CPUBOARD = IP22 ]
init echo This is an Indy
else
init echo This is neither an O2 nor an Indy.
endif
NOTE: any trailing "; then" is stripped from if and elsif
expressions before they are evaluated.
A complete list of pre-defined variables
is presented below. |
|
Use the partition keyword to specify disk partitioning,
filesystem creation, and mount points.
For example to create a standard system disk layout:
partition dks0d1s0 standard root /
partition systemdisk standard root /
And to create a standard option disk mounted at /d2:
partition dks0d2s0 standard option /d2
The complete partition syntax is:
|
partition device size type name mount-options ; mkfs-options ; |
The device, size, and type and arguments
are used as input to the fx -s command to perform
the partitioning. Partitions are laid out in the order specified,
unless a start position is given.
NOTE: in order for repartitioning of the system disk to
work properly, the disksetup keyword (described above) must appear in
the mrconfig file, or the disksetup=true argument should be specified on
the boot command line when initiating RoboInst from the PROM command
monitor (see prom(1M)).
| device is one of: |
| |
systemdisk |
a shorthand notation for partition 0 of the disk
on which the miniroot is currently loaded (the current system disk).
The systemdisk keyword, if immediately followed by a number (eg. systemdisk1
refers to a specific partition on the system disk.
NOTE: the systemdisk keyword is only supported by RoboInst 1.1,
available in IRIX 6.5.2 (8/12/98 and later versions).
|
|
| |
a device name |
referring to a disk device in the /dev/rdsk directory,
for example dks0d1s0. See
dks(7M)
for a full description of device names.
|
|
size is one of: |
| |
existing |
keep the same size. |
|
| |
standard |
use a standard layout for the entire disk. Type root
or option must also be specified - see below.
When standard is used, it applies to the entire
disk (the partition component in the device name is
irrelevant), and there must be no other partition
statements for that disk. |
|
| |
all |
the entire disk. |
|
| |
start:size |
start is an integer that specifies
the exact start address of the partition, in 512-byte blocks.
Alternatively, start can be followspart# where
# is the partition-number which this partition is
to immediately follow on the same disk. Note: the volume
header is partition 8, so normally the first usable partition
would use followspart8.
size is an integer that specifies the size of the
partition in 512-byte blocks,
or the word remainder
to use the entire remainder of disk after making all
of its other partitions.
Note: partitions are processed in the order they appear
in the file, so remainder should be used only in the
last partition statement for a particular disk.
|
|
type is one of: |
| |
root |
only valid when standard is
specified (see above).
A standard root disk is created, containing
a swap partition (what size?)
and a root partition of maximum size containing
an XFS filesystem. |
|
| |
option |
only valid when standard is
specified (see above).
A standard option disk is created,
consisting of a single partition of maximum size,
containing an XFS filesystem.
| |
| |
xfs
xfs/blocksize
|
an XFS filesystem is created with
the specified blocksize and mkfs-options,
and mounted at the directory name with the
specified mount-options.
The blocksize must be an integer multiple of 512 and cannot
exceed 65536. If omitted, a blocksize of 4096 is assumed. |
|
| |
efs |
an EFS filesystem is created, and
mounted at the directory name with the
specified options. Caution: EFS filesystems
will not be supported in future IRIX releases.
Use XFS filesystems in nearly all situations. |
|
| |
swap |
a swap partition of the specified size
is created. |
|
| |
preserve |
any existing filesystem
is preserved, and no new one is created. |
|
name is ignored when type is swap.
For other partition types, its value can be: |
| |
pathname |
indicating a local directory where the filesystem is to
be mounted. |
|
| |
nomount |
If nomount is specified, the filesystem is not mounted. |
|
mount-options are: |
| |
mount-options |
This field is optional.
Any options specified are to be passed to the -o option of the
mount(1M) command as a single argument. Multiple options
should be comma-separated with no spaces. If you want to specify
mkfs options (see below) and no mount options, use a single hyphen
character (-) for the mount-options. |
|
mkfs-options are: |
| |
mkfs-options |
This field is optional. Any options specified are passed along to the
mkfs(1M)
command used to create the filesystem. If you want to specify mkfs options
but no mount options (see above), use a single hyphen character (-)
for the mount-options. For example:
partition dks0d1s0 standard root / - -d unwritten=0
|
|
The RoboInst software sets the following variables in the
environment of all shell commands that you define in your
mrconfig file.
- SGI_CPUBOARD
- SGI_CPUARCH
- SGI_GFXBOARD
- SGI_SUBGR
- SGI_MODE
- SGI_MACHINE
- SGI_ABI
These are set to the value of CPUBOARD, CPUARCH, GFXBOARD, SUBGR, MODE and
MACHINE as described in the inst(1M) man page
under the -m option. Some variables can have multiple values. In that
case the values are separated by whitespace. Note: SGI_CPUARCH has the MIPS2,
MIPS3, etc. values removed. The MIPS2, MIPS3, etc. value is contained in the
SGI_ABI variable. For example, if inst says CPUARCH=R4000 and CPUARCH=MIPS2,
then the RoboInst variable SGI_CPUARCH is set to R4000, and SGI_ABI is set to
MIPS2.
- SGI_CAPACITY
- SGI_CAP_dks#d#vol
SGI_CAPACITY is set to the capacity of the root disk drive, in 512-byte blocks.
The variables SGI_CAP_dks#d#vol are also set to correspond to the capacity
of specific scsi disk drives attached to the system. For example, if you have
a 2GB system disk (dks0d1vol) and a 1 GB option disk (dks0d2vol) then the
following variables would be set:
SGI_CAPACITY=4197405
SGI_CAP_dks0d1vol=4197405
SGI_CAP_dks0d2vol=2070235
- SGI_ROOT
SGI_ROOT is set to the pathname of the directory where the actual system
root directory (when the system is booted normally) is mounted on
the miniroot filesystem. This is normally /root.
- SGI_CUSTOM
SGI_CUSTOM is set to the pathname of the directory where your mrconfig files,
and any other custom files, are copied to in RoboInst mode. This is
normally /custom.
- SGI_HOSTNAME
SGI_HOSTNAME is set to the hostname of the client machine, or a NULL
string if the hostname has not been set.
- SGI_IPADDR
SGI_IPADDR is set to the network ip address of the client machine, or a NULL
string if the ip address has not been set.
- SGI_SYSID
SGI_SYSID is set to the system identifier comprised of 12 hexadecimal
characters. For example, 08:00:69:07:73:80.
- SGI_MEMSIZE
SGI_MEMSIZE is set to the amount of memory on the system in megabytes, as
reported by hinv(1M).
- SGI_SYSTEMPART
- SGI_SYSTEMDISK
SGI_SYSTEMPART is set to the pathname of the device file of partition
0 on the disk where the miniroot has been loaded. For live installs,
this is the disk where / is mounted. For example, /dev/dsk/dks1d1s0.
SGI_SYSTEMDISK is the same as SGI_SYSTEMPART, but without the final
partition specifier. For example, /dev/dsk/dks1d1.
See dks(7M)
for a discussion of disk device names.
- SGI_BOOTSERVER
- SGI_BOOTDIR
SGI_BOOTSERVER is set to the name of the machine where the miniroot
was booted from. SGI_BOOTDIR is set to the name of the directory containing
that miniroot.
- SGI_CONFIGSERVER
- SGI_CONFIGDIR
SGI_CONFIGSERVER is set to the name of the machine where your custom
files (mrconfig, .index, etc.) are copied from.
SGI_CONFIGDIR is set to the name of the directory containing
those files.
Consider the job of partitioning a set of
Indy, O2/R5K and O2/R10K clients. The O2/R10K machines
normally have the root drive at dks0d2s0, but on the other
we would like to use dks0d1s0 for the root drive.
This can be handled with a single mrconfig file as follows:
# The following "disksetup" keyword applies to all machines
disksetup
if [ "$SGI_CPUBOARD" = IP32 -a "$SGI_CPUARCH" = R10000 ] then
# On O2/R10K machines use drive 2
init echo This is an O2/R10K
partition dks0d2s0 standard root /
else
# On my other machines put root on drive 1
init echo The machine type is $SGI_MACHINE
partition dks0d1s0 standard root /
endif
Please send us your
comments, questions and bugs so we can improve the product.
Silicon Graphics/
$Date: 1998/03/05 00:13:07 $
|