Next | Prev | Up | Top | Contents | Index
Writing an inst.init Script
You can write inst.init as a shell script, a tcl script, or a binary program. The output of inst.init is a set of commands that Inst or Software Manager executes. These commands are supported as output from inst.init.
- from [distribution]
-
specifies the location of the distribution. The from command is always executed first.
- admin load [selections file]
-
specifies a selections file to be used for the installation (see "The save and load Commands" in Chapter 5 and the -F option of inst(1M)). You may use multiple selections files; in this case, all commands are buffered and executed in the order that they are read.
Note: Any from commands in selections files are ignored.
- set [preference] [value]
-
sets preferences for Inst or Software Manager operation. Preferences are always set after the from command is executed.
- install [software.subsystem]...
-
marks for installation the software products or product components that are specified as arguments.
- keep [software.subsystem]...
-
maintains the current status of software products or product components that are specified as arguments
- remove [software.subsystem]...
-
marks software products or product components for removal.
Additional inst.init Script Rules
Keep these additional points in mind when creating an inst.init script:
- The from command executes first--the last from command returned by the script sets the distribution. All other commands are executed in the order in which the script sends them to inst for execution.
- All from commands in selections files are ignored.
- Lines written to the command descriptor must not begin with a space or tab character.
- Abbreviations and wildcards are supported in install, keep, and remove commands.
- Abbreviations of from, set, and admin load commands are not supported.
Sample inst.init Scripts
This sample inst.init script resets the distribution directory and notifies users of the change. Then the script retains all currently installed software in its current state, except InPerson; it installs all Inperson subsystems from the distribution except the man pages.
#!/sbin/sh
OLDPATH= $2
NEWPATH= yankee:/usr/dist
echo "$OLDPATH is unavailable"
echo "installing from $NEWPATH"
echo "from $NEWPATH" >&$3
echo "k *" >&$3
echo "i InPerson" >&$3
echo "k InPerson.man" >&$3
exit 0
Example 8-1 : Sample inst.init Script
This sample script determines the release and sets the distribution directory accordingly:
#!/sbin/sh
#
# Run uname to determine the release and set the distribution directory
REL='uname -r'
case $REL in
6.1*) echo "from $2/dist/6.1" >&$3 ;;
6.2*) echo "from $2/dist/6.2" >&$3 ;;
esac
Next | Prev | Up | Top | Contents | Index