Sample jumpstart "begin" script

Surprisingly, i couldnt find any example of a Solaris jumpstart "begin" script on the net, that is used to preserve old files, even though that is one of the purposes for them explicitly mentioned in the Sun docs. So I thought I should put one out there.

"begin" script, suitable for use in a "rules" file

format /tmp/disk.list
ROOTDISK=`head -1 /tmp/disk.list`
        cd /a
        echo Preserving ssh/kerb keys
        tar cvf /tmp/preserve.tar etc/ssh/*key* etc/krb5.keytab 2>/dev/null
        # If some or all files dont exist, tar will exit 1. thats ok.
        # if it creates an "empty" tarfile... thats ok too.
        cd /

if [ "`fstyp ${ROOTFS}`" = "ufs" ] ; then
        mount -F ufs -o ro ${ROOTFS} /a
        umount /a

Things of note

It would be really nice to take advantage of something like $SI_ROOTDISK. Except for the fact that the variable does not seem to be defined (at least on Solaris 10 x86). Sigh. So that's why the hacky call to "format".

Matching "finish" script


if test -f /tmp/preserve.tar ; then
        echo Extracting preserve.tar from old system
        (cd /a && tar xvfp - /tmp/preserve.tar)

Written by: Philip Brown
Bolthole Top - Bolthole Solaris Top - Search