MEDIAD CONFIGURATION FILE

Mediad's configuration file is /etc/config/mediad.config. It allows the user to configure mediad to treat certain devices and filesystems differently from the default behavior.

This file replaces /etc/fsd.auto; it allows everything fsd.auto allowed and more. A perl script will be provided and automatically executed to translate an existing fsd.auto file to the new format.

While mediad is running it will monitor this file through the miracle of fam. When the config file changes, mediad will immediately change its behavior to whatever the config file specifies.

SEMANTICS

The config file may contain four kinds of commands. The commands are:

An "ignore device" command tells mediad not to monitor the given device. Mediad will not to anything to access that device's hardware.

A "monitor device" command lets the user specify insertion check interval and/or removal check interval in seconds. The default inschk interval is 3 seconds; the default rmvchk interval is 45 seconds.

A device is specified by naming one of the special files in /dev that refers to that device. The user can use any of the /dev entries that refers to a device. There's no need to use /dev/scsi for HFS CD-ROMS and /dev/dsk/ for EFS CD-ROMs. These four device specs are all equivalent, because they all refer to (some part of) the device at SCSI controller 0 id 3.

The user may use any of these names to refer to that device, irrespective of the hardware present.

An "ignore filesystem" command tells mediad not to mount the given filesystem if it is detected.

A "mount filesystem" command lets the user specify a directory (mount point) or set of mount options to use when mounting a specific filesystem.

A filesystem is specified by three parts: the device, the filesystem type and the partition number. The device is specified as described above. The type is simply the name of the type (efs, hfs, etc.) The partition number is optional. It may be specified separately or implicitly by a dksc device that includes a partition number. If the partition is not specified, the filesystem specified is one that spans the whole disk. These two filesystem specs are equivalent because they both refer to the fourth HFS partition on the device as SCSI controller 0 id 3.

SYNTAX

The config file's syntax can be described by a grammar. Here it is in yacc. Tokens are uppercase; nonterminals are lowercase. NUMBER, PATH, STRING and '\n' are what you think. All other tokens are keywords in lower case.

The config file may include comments. Anything to the right of a "#" character is a comment.

/* ... */ 

%% 

/* A config file is a sequence of statements. */ 
configfile : /* empty */ | configfile stmt ; 

/* Three kinds of statements: ignore, monitor and mount.
 * Newline terminates statements. */ 
stmt : '\n' | ignore_stmt '\n' | monitor_stmt '\n' | mount_stmt '\n'; 

/* Ignore statement: ignore a device or ignore a filesystem. */ 
ignore_stmt : IGNORE device_spec | IGNORE filesys_spec; 

/* Monitor statement: monitor a device. Optionally specify
 * frequency of insertion check and removal checks. */ 
monitor_stmt : MONITOR device_spec monitor_config;
monitor_config : /* empty */
               | monitor_config INSCHK NUMBER
               | monitor_config RMVCHK NUMBER; 

/* Mount statement: mount a filesystem. Optionally specify
 * mount point and options. */ 
mount_stmt : MOUNT filesys_spec mount_config;
mount_config : /* empty */
             | mount_config DIRECTORY PATH
             | mount_config OPTIONS STRING; 

/* A device spec is the keyword "device", then either the path
 * to the special file (/dev entry) or a wildcard. */ 
device_spec : DEVICE device; 

/* A filesystem spec is the keyword "filesystem", then the
 * device, the filesystem type and partition. The partition
 * may be elided. */ 
filesys_spec : FILESYSTEM device type part_spec;
type : STRING;
part_spec : partition | /* empty */;
device : PATH;
partition : PARTITION NUMBER;
 
%% 

/* ... */ 

EXAMPLES

Here is one example of each statement type.

# ignore a device.
ignore device /dev/scsi/sc0d3l0 

# ignore ISO 9660 filesystems on a device.
ignore filesystem /dev/scsi/sc0d4l0 iso9660 

# monitor a device with insertion check every 10 seconds
# and removal check every 20 seconds.
monitor device /dev/scsi/sc0d5l0 inschk 10 rmvchk 20 

# mount 3rd EFS filesystem on device at /xyzzy;
# disallow set-uid programs.
mount filesystem /dev/rdsk/dks0d6s3 efs directory /xyzzy options nosuid 

STATUS

May 3, 1996

Parsing of the config file is implemented. "ignore device" and "monitor device" commands are implemented, including dynamic updates. "ignore filesystem" and "mount filesystem" commands are not implemented yet. The perl script to tranlate /etc/fsd.auto is not written yet.