SUMMARY: jumpstart remote subnet upgrade/install

From: Halverson, Mark (Mhalver@templeton.com)
Date: Fri May 26 2000 - 09:45:41 CDT


wow... sorry this took so long, and that it's not as pretty as most...
lots of tips from dozens of folks... thanks to all....unfortunately, I'm an
airhead,
and I can't locate the individuals who were kind enough to take the time to
help out,
including several second level sun technicians.
Sorry.

I found the book "automating solaris installations, a custome jumpstart
guide" to be marginally useful. There are hooks and switches that are no
longer applicable
(ie: you can't do install_boot_server -b <path> <ARCH>
because the ARCH part is no longer an option, it grabs all arch's - you only
select the arch during add_client!) and it didn't go into the depth I wanted
for remote subnet bootservers (I would like to have seen more examples).

documents that helped alot:
INFODOC ID: 16484 "Handsoff Jumpstart using "sysidcfg" with no Nameservice"
www.sysadminmag.com/current/feature.shtml(may2000)"Building a Jumpstart
Server for Solaris"
SUN Jumpstart Installation FAQ

I've spent the last few weeks setting up this environment, and I've decided
that I'd
simply share the kludgy, poorly built scripts with you in hopes that this
example can be added to the archives of possibilities.

I wont go into the standard install_server part, that is a given.

The setup for my site was only to do a 2.5.1 to 2.6 upgrade, no partitions
were changed,
all data is preserved.

Here are the scripts that I used to set up the REMOTE (read: other side of a
router from the installation server) bootservers, and a verbose script to
add each client.

Realize that these are specialized for my site. I still thought the
culmination of data might prove useful.

##########makebootserver script:

#!/bin/sh
df -lk
ls -d /*/jumpstart
echo choose a mountpoint for jumpstart:
read JS_DIR
if [ -d "$JS_DIR" ]
then
:
else
mkdir $JS_DIR
fi

#this is slop..and if the dns is already in there... it adds a second,
#but none of mine had that... so BEWARE
#echo add the following lines:
echo setting up DNS...
echo domainname foobar.com > /etc/resolv.conf
echo search foobar.com bleck.com >> /etc/resolv.conf
echo nameserver 10.10.1.1 >> /etc/resolv.conf

echo /etc/resolv.conf modified, changing /etc/nsswitch.conf to allow dns

sed 's/hosts: files/hosts: files dns/g' /etc/nsswitch.conf
>/tmp/nsswitch.conf.$$
mv /tmp/nsswitch.conf.$$ /etc/nsswitch.conf
echo nsswitch.conf modified
echo [re]starting inetsvc
 sh /etc/init.d/inetsvc
echo dns enabled!

mount ftlsun1:/export/install /mnt
cd /mnt/Solaris_2.6/Tools
./setup_install_server -b $JS_DIR

exit 0
#end of makebootserver
############################################################################
#

##########mkclient script:

#!/bin/sh
#JS_DIR=`ls -d /*/jumpstart |sed 's|/net/jumpstart ||g' |sed 's/
//g`

#ok, so you have to set the path, I didn't have TIME to make it pretty!!!
#(you don't have to set this if you don't mind answering the question!)
JS_DIR=/opt/jumpstart

#yes, I know the syntax is a kludge, but I'm in a hurry....
if [ -d "$JS_DIR" ]
  then
    :
  else
    echo choose a mountpoint for jumpstart:
    df -lk
    ls -d /*/jumpstart
    read JS_DIR
fi

# move to the directory
cd $JS_DIR/Solaris_2.6/Tools

#see if there was a system given as an arguement
if [ $1 ]
  then
    SYSTEM=$1
  else
#if not, ask who the client is
    echo system to boot-net:
    read SYSTEM
fi

#remove the client if it was preinstalled
$JS_DIR/Solaris_2.6/Tools/rm_install_client $SYSTEM > /dev/null 2>&1

#try to grab the ethernet(mac) address of the system
ETHER=`rsh $SYSTEM ifconfig hme0|grep ether|awk '{print $2}'`
if [ "$ETHER" = "" ]
  then
    echo "unable to parse the ethernet(mac) address of $SYSTEM, please
provide:"
    read ETHER
fi

#see if the profile directory is shared
DFS_ENTRY=`grep $JS_DIR/$SYSTEM /etc/dfs/dfstab`
if [ "$DFS_ENTRY" ]
  then
    :
  else
    echo "share -F nfs -o ro,anon=0 $JS_DIR/$SYSTEM" >>/etc/dfs/dfstab
fi

#try to parce the ip address
#if you have DNS... do this differently!
#and, yes, I know it's slop, and dependant on a solitary instance of the
system name
#in /etc/hosts
IP_ADDRESS=`grep $SYSTEM /etc/hosts | awk '{print $1}'`
if [ "$IP_ADDRESS" ]
  then
    :
  else
    echo "unable to parse ipaddress of $SYSTEM, please provide:"
    read IP_ADDRESS
fi

#we're done asking questions, now do the work
./add_install_client -e $ETHER -s `uname -n`:"$JS_DIR" -c \
jumpstartserver:/export/install -p `uname -n`:"$JS_DIR"/"$SYSTEM" $SYSTEM
sun4u

#make a profile directory if it doesn't exist (on the boot server for easy
access!)
mkdir $JS_DIR/$SYSTEM > /dev/null 2>&1

#move there
cd $JS_DIR/$SYSTEM

#copy clean profile data from the install server
rcp -rp jumpstartserver:/export/jumpstart/proto/ .

#build the customized profile for this client
echo "system_locale=en_US " >$JS_DIR/$SYSTEM/sysidcfg
echo "terminal=sun-cmd " >>$JS_DIR/$SYSTEM/sysidcfg
echo "network_interface=hme0 {hostname=$SYSTEM ip_address=$IP_ADDRESS
netmask=255.255.0.0}" >>$JS_DIR/$SYSTEM/sysidcfg
echo "name_service=NONE {domain_name=foobar.com
name_server=FOOBARDNS(10.10.1.1)}" >>$JS_DIR/$SYSTEM/sysidcfg
echo "timeserver=localhost" >>$JS_DIR/$SYSTEM/sysidcfg
echo "timezone=US/Eastern" >>$JS_DIR/$SYSTEM/sysidcfg
echo "system_locale=C" >>$JS_DIR/$SYSTEM/sysidcfg

echo sysidcfg complete for $SYSTEM

#validate the profile
echo ""
echo "validating the profile"
echo ""
if [ -f check ]
  then
    ./check
  else
    echo profile directory invalid, reconfigure!
fi

echo ""
echo "$SYSTEM is ready to be upgraded."
echo "ON THE CLIENT!!!!!! as root, type the following:"

#this allows remote net boot to the hme0 interface
echo "reboot -- '/sbus@1f,0/SUNW,hme@0,8c00000 - install'"
echo ""
echo "please... don't type that string as root... on the boot server,
ok????"

exit 0
#end of mkclient script
###########################################################

rules jumpstart file:
any - - any_machine -

any_machine jumpstart file:
install_type upgrade
cluster SUNWCall

the rest of the 'proto' directory of the jumpstart installation server is
the defaults.

good luck!
Mark Halverson
mhalver@templeton.com



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:14:08 CDT