# For finer control over subsystems to install, use a selections file.
# Also shows how to handle the oddball O2/R10k system disk

version 1

# This is the IP address of the host to send syslog info
# to about the progress of the RoboInst session.
# commonly, this is the server host. Only one address allowed.
loghost  10.62.51.110



# WARNING: Preparing to wipe the disk!
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

# the poor-man's miniroot nameserver
init echo "appending to miniroot hosts file..."
init cat /custom/hosts >> /etc/hosts 2>/dev/null

# Create the selections file in one of 2 ways. Both start by
# installing a system with the same configuration that you want the
# targets to have. You can be very selective which subsystems that
# you want to have installed. When you are satisfied that you have
# the correct set, then either:
#
#   start up inst/swmgr and `install same` and `admin save /path/selfile`
#
#   run the ../base/hist2selfile script.
#     the "-n" option will force the exact same version of each subsystem
#     as installed on the master, otherwise inst will accept the most
#     recent version of each subsystem in the distribution(s)

# load the selections file
inst admin load /custom/selfile
#  the following could make it more robust when installing multiple 
#  system types (to get mach-specific subsystems, for example)
#inst install prereqs
#  but note that just "keep conflicting" can keep far more than you expect!
#inst keep conflicting prod1 prod2
#inst install required
inst go

postinst echo "additional non-inst software installation could have been done here!"

# configure the machine!
postinst /custom/mypostinst
