\begindata{text, 268611736}
\textdsversion{11}
\template{help}
\define{notetotypesetter
}

\chapter{Package: Maintain Local Disk Configuration
}
\section{What Package is
}\leftindent{
Package is a configuration control system for VICE II workstations developed at CMU. It provides simple consistent robust software updating and reconfiguration of workstation local disks based on system description files.  Both the number workstations and configurations is limited only by the needs of a given site. The control of workstation configurations may be distributed or fragmented as needed between a number of adminstrators. 
}
\section{Starting Package
}\leftindent{
Package is started with the command:

\example{/etc/package [-vnsky] [-c conf[.cputype]]
}
where

-v	produces "verbose" output, or
-s	suppresses output

-n	suppresses actual work, so you can see what would happen without actually doing it

-y	enables updating files which have no write bits set

-k	(default) suppresses updating files which have no write bits set

-c conf[.cputype]
\leftindent{names the configuration file (default /etc/package); the cputype extension is usually filled in automatically}

}
\section{Format of Configuration File
}\leftindent{
Each line in the configuration file has the format:

\example{type file [proto] [username[groupname]] [mode]}

The type field specifies one of:
\description{\leftindent{
B	block special device
C	character special device

D	directory
DX	directory - lost+found
DR	directory - delete extra files not configured in this directory (use with care!)

F	regular file
FI	.. - copy the file if it is missing, but do not update existing files
FO	.. - rename the old version with suffix of ".old" if updated
FQ	.. - exit with status of 4 if this file is updated (after doing the update)
FA	.. - the proto field specifies an absolute path name (can be combined with others)

L	symbolic link
S	socket
}}
The file field specifies an absolute pathname of the local file. 

The proto field specifies a major and minor device number when used in a block or charactor special device entry or the prefix to used to name the master file (or real file in the case of a symbolic link.)

The username, groupname, and mode specify the file's permissions.  If they are omitted, the permissions of the master file are used. 

Normally the configuration file is named \italic{/etc/package.cpu} where cpu type reflects the actual cputype of the machine.  Other configuration files may be specified by the \italic{c} flag however the actual cpu type will be supplied by \italic{package} and need not be give in name. 

}
\section{Design Goals}
\leftindent{
The goal of package was to build a simple robust mechanism on the already existing VICE II filesystem to maintain a workstations local disk files.  A number of related issues were also addressed in its design. 

Workstations are often located within individual offices to which administrators may not have easy access.  Package had to be very robust so as to minimize the physical access adminstrators would need to workstations. 

The number of both workstations and configurations within ANDREW is increasing rapidy. Package had to handle massive numbers of workstations of varying configuration while sharing as much common configuration information as possible. 

Support and administrative personnel vary widely in expertise and duties.  Package had to permit the simple division of configuration information between different persons. For example /vmunix is generally maintained by system software and is very critical to normal workstation operation, however /etc/hosts.equiv is more likely to be maintained by a departmental adminstrator and much less critical. 

Configurations must be easily documented and verifiable. Technicans lacking software experience must be able to check and verify workstation disk configurations. Similarly software specialists must be able to collect configuration information and intelligently plan changes and testing. 

}\section{Implementation
}\leftindent{
The system was implemented by the construction of two new programs:  package and mpp, and the use of the standard UNIX utility make.

The program \italic{package} is the actual program that does the updating.  It loads a single configuration file that describes the local disk completely in memory. Vice directories that are specified as wildcards are expanded and all vice file modification times are collected.  If any Vice file that is specified is missing or inconsistently specified package aborts.  Package then verifies that local disk partition mount points agree with configuration specifications.  Finally package updates local disk files based on configuration information. 

The program \italic{mpp} is used to construct machine configuration files from prototype files.  Mpp provides macro preprocessor support. Translating macros in the form $\{name\} to their corresponding string values. Macro directives such as "ifdef", "ifndef", "endif", "undef", "define", and "include" are supported by mpp. 

The program \italic{make} is used to group machine configurations by logical groups such as department machines, postoffice machines, public machines, etc... We add the following lines to the header of all Makefiles to simplify this task. 


\example{.SUFFIXES: .vax .sun .sun2 .sun3 .ibm032 .proto
.proto.sun:	; mpp -Dcpu=sun -Dname=$* $*.proto > $@
.proto.sun2:	; mpp -Dcpu=sun2 -Dname=$* $*.proto > $@
.proto.sun3:	; mpp -Dcpu=sun3 -Dname=$* $*.proto > $@
.proto.ibm032:	; mpp -Dcpu=ibm032 -Dname=$* $*.proto > $@
.proto.vax:	; mpp -Dcpu=vax -Dname=$* $*.proto > $@
}

Note that definition of cpu and name on the mpp command line. These are used to define configuration name and cputype as macros to be used in configuration specification. 
}
\section{Configuration Strategies
}\leftindent{
Creating a machine configuration from scratch is large task. Fortunately this is rarely required. Generally one master configuration file may be created that contains all the common information that is constant throughout all configurations and a number of files that specify option items. The liberal use of macros is essential for any but the most simple configurations. 

For example we currently include a file called "cmu.readonly" in most configuration which contains the lines: 


\example{	%define	common		/cmu/unix/common
	%define	machine		/cmu/unix/$\{cpu\}
}

We may include a file call "disk.ra2" which contains information about optional two disk microvax configurations which contains the lines. 


\example{	%define	hasdisk
	%define	bigdisk
	DX /lost+found				 $\{treemode\}
	DX /tmp/lost+found			 $\{treemode\}
	DX /usr/lost+found			 $\{treemode\}
	DX /usr/vice/lost+found			 $\{treemode\}
	FA /etc/fstab	$\{machine\}/etc/fstab.ra2 $\{textmode\}
	FA /etc/vstab	$\{machine\}/etc/vstab.ra2 $\{textmode\}
}

Following that we include a file called "tree.generic" and a section of this file has the lines: 


\example{%ifndef	hasdisk
	DX /lost+found				$\{treemode\}
	DX /usr/lost+found			$\{treemode\}
	F  /etc/fstab		$\{machine\}	$\{textmode\}
	F  /etc/vstab		$\{machine\}	$\{textmode\}
%endif	hasdisk
}

Note how unless disk.ra2 is included before the file tree.generic the default definitions will be used in tree.generic because of the use of the macro name "hasdisk". Similarly that macro name "bigdisk" may be used to inform package that the local disk has enough space for /usr/ucb to reside on local disk and need not be a symbolic link as most configurations have.  For example from file "tree.generic". 


\example{%ifdef bigdisk
	DR			$\{machine\}	$\{treemode\}
%else	bigdisk
	L			$\{machine\}
%endif	bigdisk
}

One very useful trick when dealing with macros in configuration prototype files is shown in the the following lines: 


\example{%define	$\{cpu\}		xxxxxx
%ifdef	vax
F	/etc/chpt	$\{machine\}
%endif	vax
}
In this the macro cpu has the value vax the file /etc/chpt will be added to the configuration. One should, however be very careful with name conflicts when using this approach.  It is best to thoughouly examine and understand configuration files currently in use before changing them or creating new configurations.  The art of developing machine configurations is still very early in its infancy. 
}
\section{Related tools}  

Select (put a box around) one of the italicized names and choose "Get Help on Selected Word" from the pop-up menu to see the help file for:

\leftindent{Names of other programs, in a vertical list, no commas or other punctuation marks}
\enddata{text,268611736}
