Willing Minds Willing Minds
 
Overview | Presentations | Downloads
Home
Services
Products
Resources
About
Contact
UUASC Jumpstart July 2002

UUASC Jumpstart July 2002

Resources


Table of Contents

  1. What is the Jumpstart process?
  2. Install Solaris 8 Jumpstart Software
  3. Add a Solaris 8 client
  4. Create sysidcfg file
  5. Create/Update rules file
  6. BEGIN scripts
  7. PROFILE files
  8. FINISH scripts
  9. Check rules file
  10. Advanced rules file
  11. The bpgetfile Command
  12. Advanced FINISH Scripts

What is the Jumpstart process?

What Happens When You try to Jumpstart a System?

Stage

Description

RARP

System sends out a RARP request to figure out who it is. This is where the /etc/ethers file comes into play.

BOOTPARAM

System sends out a BOOTPARAM request to find its root file system. This is where the /etc/bootparams file comes into play.

KERNEL

System mounts root directory, and loads kernel.

SYSTEM CONFIG

System looks for a sysidcfg file and sets information from this file. If any information is missing, the user is queried.

RULES

System looks for a rules.ok file and a matching rule.

BEGIN

The BEGIN script is run.

PROFILE

The PROFILE file is read.

Solaris Install

Disks are partitioned and Solaris is installed according to the information in the PROFILE file.

FINISH

The FINISH script is run.

REBOOT

The system is rebooted.


Install Solaris 8 Jumpstart Software

The Jumpstart server in this example is named axi. Important directories to define:

  • Jumpstart Root -- This is where the Solaris software is installed. For this example, I will be using the /fs1/js directory.

  • Sysid Config Directory -- This is where the sysidcfg file goes. For this example, I am using the /fs1/js/sysid_config directory.

  • Installation Configuration Directory -- This is where the rules files resides, as well as the BEGIN, PROFILE, and FINISH scripts. For this example, I am using the /fs1/js/config directory.

Detailed instructions for this step are avaialable on the Sun site. Here's what I did for this demonstration:

Installing Solaris Jumpstart Software from CD
(insert Solaris 8 SOFTWARE Disk 1)
# cd /cdrom/sol_8_1001_sparc/s0/Solaris_8/Tools
# ./install_server /fs1/js
# eject cdrom
(insert Solaris 8 SOFTWARE Disk 2)
# cd /cdrom/sol_8_1001_sparc_2/Solaris_8/Tools
# ./add_to_install_server /fs1/js
# cd /fs1/js/Solaris_8/Tools

Add a Solaris 8 client

After installing the Solaris 8 Jumpstart software, you will want to tell the Jumpstart system about a client you wish to install. You do this by the following steps:

  1. Update the /etc/hosts file with the information for the new host. The hostname I'm using for this demonstration is js1.
  2. Gather the MAC address (from th PROM screen) and architecture type (uname -m) of the client.
  3. Run the add_install_client script.

For this demonstration, I ran the following command:

Running the add_install_client Command
# cd /fs1/js/Solaris_8/Tools
# ./add_install_client     -s axi:/fs1/js     -p axi:/fs1/js/sysid_config     -c axi:/fs1/js/config     -i 192.168.1.220 -e 8:0:20:a8:d7:9c js1 sun4u

This script does many things to prepare your Jumpstart server

Results of Running add_install_client script

File Updated

Description

/etc/ethers

This file is updated so that RARP will respond with the proper IP address for the requested MAC address. If rarpd was not configured to run at boot time, it is now.

8:0:20:a8:d7:9c js1.willingminds.com

/etc/bootparams

Updates the file with the information on the command line. If bootparamd was not configured to run at boot time, it is now. The bootparams file listed here has been split for readability:

js1.willingminds.com         root=axi.willingminds.com:/fs1/js/Solaris_8/Tools/Boot         install=axi.willingminds.com:/fs1/js         install_config=axi.willingminds.com:/fs1/js/config         sysid_config=axi.willingminds.com:/fs1/js/sysid_config         boottype=:in         rootopts=:rsize=32768

/tftpboot

Installs a bootstrap file and symlinks in the /tftpboot directory.

The bootstrap file is for the machine type specified on the command line. The symlinks are a HEX representation of the IP address of the client. In this example, the symlink filenames are C0A801DC and C0A801DC.SUN4U.

A "remove" script (rm.192.168.1.220) is also installed to remove the symlinks (and possibly bootstrap file) at a later time.

If tftpd was not configured to run from inetd, it is now:

tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot

/etc/dfs/dfstab

If the Jumpstart Root directory (-s flag) was not exported via NFS, it is now:

share -F nfs -o ro,anon=0 /fs1/js


Create sysidcfg file

The sysidcfg contains system information about a host. During a normal install, these are the questions asked before the disk/software configuration questions are asked.

The filename containing the answers to these questions MUST be named sysidcfg and must reside in the Sysid Config Directory defined above. Here is the file being used in this demonstration:

/fs1/js/sysid_config/sysidcfg File
name_service=NONE
root_password=vbqQSJcaVttvU
system_locale=C
timeserver=localhost
terminal=xterms
timezone=US/Pacific
network_interface=primary {protocol_ipv6=no netmask=255.255.255.0}
security_policy=NONE

Create/Update rules file

The rules file is located in the Installation Configuration Directory defined above (/fs1/js/config). The rules file tells the Jumpstart software which BEGIN script to run, which PROFILE file is appropriate for the client, and which FINISH script to run after software installation. A simple file looks like this:

/fs1/js/config/rules file
# keyword       value           begin-script    profile finish-script
#=============================================================================
any               -                  -         any_machine   -

BEGIN scripts

A BEGIN script is run before anything else. Some possibilities for BEGIN scripts include:

  • do a backup before an upgrade

  • check bootparams entries

  • dd an image onto the hard drive and reboot

We have specified no BEGIN script in our example above.


PROFILE files

The syntax of the PROFILE file is detailed on the Sun doc site. Here is the file used for this demonstration:

/fs1/js/config/any_machine file
install_type    initial_install
system_type     standalone
partitioning    default
cluster         SUNWreq
filesys         any 40 swap

FINISH scripts

The FINISH script is run after the main Solaris installation. Examples of what might go into a FINISH script include:

  • code to install patches

  • code to install third-party software

  • code to update root password


Note -

The root filesystem of the client is mounted under the /a directory. Make sure that all third-party packages you install (via pkgadd -R /a PKGNAME have pre-install or post-install scripts use $PKG_INSTALL_ROOT as the root prefix when updating files.


We have specified no FINISH script in our example above.


Check rules file

Now that the BEGIN, PROFILE, and FINISH files are configured, we need to run the check file to generate the rules.ok file. This script will check the rules file for syntax correctness and will check to make sure that the BEGIN script, PROFILE file, and FINISH scripts are actually available.

The Jumpstart server is now configured and ready to go.


Advanced rules file

There are advanced things you can do in the rules file. Let's examine by column:

  1. Keyword/Value

    Table 28-1 in the Solaris 8 Advanced Installation Guide outlines the keywords and their appropriate values. Some examples of keywords include arch, disksize, and hostname. The hostname keyword is nice, but what if you're setting up 100 web servers all named web00-web99? It would be nice if hostname allowed regular expressions in the Value column. It doesn't, though.

    This is where the custom_probes file comes in. In this file, you can create your own keyword by creating a function called cmp_new_keyword. In this example, I have created a rehostname to be a regular-expression aware version of the hostname keyword:

    custom_probes file
    # purpose:  match using somewhat regular expressions
    #  syntax:  rehostname 
    cmp_rehostname () {
      probe_hostname
      expr "${SI_HOSTNAME}" : "$1" >/dev/null
    }
  2. Begin Script

    This is simply the name of the BEGIN script to run. The BEGIN script can be used to create a DERIVED PROFILE by printing profile information out to the file $SI_PROFILE.

  3. Profile

    There are three possible values for the PROFILE column.

    Values for PROFILE Column

    Value

    Description

    filename

    The name of the file that contains profile information.

    -

    If a single hyphen is used for the profile, then only the BEGIN and FINISH scripts are used to do installation. You would use this if you were doing the dd method of installation.

    =

    If the PROFILE column contains an equals sign, then the BEGIN script is expected to generate a Derived Profile into the file ${SI_PROFILE}.

    Here is an example of a begin script that generates a profile:

    BEGIN file Generating a Derived Profile
    #!/bin/ksh
    #
    # Figure out which jumpstart group we're in by grabbing the name of this script
    JSGRP=`basename ${SI_BEGIN}`
    export JSGRP
    JSMACH=`uname -m`
    JSNODE=`uname -n`
    {
        # every profile needs this
        /bin/ksh ${SI_CONFIG_DIR}/profile/header
        #
        # generate the disk information
        /bin/ksh ${SI_CONFIG_DIR}/profile/$JSGRP.disk
        #
        # generate the software information
        /bin/ksh ${SI_CONFIG_DIR}/profile/$JSGRP.software
        test -f ${SI_CONFIG_DIR}/profile/SOFTWARE.$JSMACH &&         /bin/sh ${SI_CONFIG_DIR}/profile/SOFTWARE.$JSMACH
        #
        # Finally, look for a host-specific file.
        test -f ${SI_CONFIG_DIR}/begin/$JSNODE &&         /bin/sh ${SI_CONFIG_DIR}/begin/$JSNODE
    
    } > ${SI_PROFILE}
    $SI_CONFIG_DIR/profile/header file
    # keywords      values
    # ====================
    echo "install_type      initial_install"
    echo "system_type       standalone"             ;# it has a disk
    $SI_CONFIG_DIR/profile/$JSGRP.disk file
    #!/sbin/sh
    #
    # Disk partitioning for a JSCLIENT system
    #
    echo "usedisk           c0t0d0"
    echo "usedisk           c0t1d0"
    echo "partitioning      explicit"
    #
    echo "filesys           c0t0d0s0        free    /"
    echo "filesys           c0t0d0s1        512     swap"
    echo "filesys           c0t0d0s7        2       unnamed"
    #
    echo "filesys           c0t1d0s0        free    unnamed"
    echo "filesys           c0t1d0s1        512     swap"
    echo "filesys           c0t1d0s7        2       unnamed"
    $SI_CONFIG_DIR/profile/$JSGRP.software file
    #
    # Developer's cluster plus some other stuff
    
    echo "cluster           SUNWreq"                ;# required only
    
    #echo "cluster          SUNWCuser"              ;# developer's cluster
    #echo "cluster          SUNWCnet        add"    ;# UUCP stuff (like tip, cu)
    #echo "cluster          SUNWCown        add"    ;# complete OpenWindows
    #echo "cluster          SUNWCpex        add"    ;# Runtime PEX driver
    #echo "package          SUNWdxlib       add"    ;# Direct XLib
    #echo "cluster  SUNWCffb        add"    ;# Sun Fast Frame Buffer (on Ultra's)
    #echo "cluster  SUNWChmd        add"    ;# Fast Ethernet/FastWide SCSI-2 drivers
    #echo "cluster  SUNWCsx         add"    ;# SX driver (garibaldi only)
    #echo "cluster  SUNWCrtvc       add"    ;# Sun Video
    #echo "package  SUNWabe         add"    ;# Answerbook (25MB)
    #echo "package  SUNWxwman       delete" ;# X11 Man Pages

  4. Finish Script

    The Finish Script column contains the name of the finish script to run.

Our new rules file now looks like:
# keyword       value           begin-script    profile finish-script
#=============================================================================
rehostname      js[0-9]         begin/JSCLIENT  =       fini/JSCLIENT


The bpgetfile Command

The bpgetfile command will retrieve an entry from the bootparams table and print the servername, the server IP, and the path.

A typical bootparam entry takes the following format:

key=[server]:path


Advanced FINISH Scripts

$SI_CONFIG_DIR/fini/JSCLIENT file
#!/bin/ksh
#
# run a KSH version
/bin/ksh ${SI_CONFIG_DIR}/fini/JSCLIENT2
$SI_CONFIG_DIR/fini/JSCLIENT2 file
#!/bin/ksh
/bin/ksh ${SI_CONFIG_DIR}/fini/PATCHES          ;# add patches
/bin/ksh ${SI_CONFIG_DIR}/fini/CATMAN           ;# format manpages
	  
$SI_CONFIG_DIR/fini/PATCHES file
#!/bin/ksh
echo "Installing patches ..."
echo "    - Mounting directory"
set X `/sbin/bpgetfile PATCHDIR`
if test $# -ne 4 ; then
        echo "Could not find PATCHDIR bootparam entry"
        exit 1
fi
        
[ -d /tmp/patches ] || mkdir /tmp/patches || exit 1
mount ${3}:$4 /tmp/patches || exit 1
OLDDIR=$PWD
cd /tmp/patches || exit 1

echo "    - Installing patches"
for p in `cat patch_order` ; do
        echo "      $p ... \c"
        patchadd -R /a -d -u $p
        echo "done ($?)"
done

cd $OLD
echo "    - Unmounting directory"
umount /tmp/patches
echo "done." 
$SI_CONFIG_DIR/fini/CATMAN file
#!/bin/ksh
# Create the man page indexes
echo "    - Man Page Indexes" 
for i in /usr/share/man /usr/openwin/man ; do
  echo "        - $i"
  catman -w -M /a/$i
done


Privacy Policy
Search:  Copyright © 2005 by Willing Minds LLC. All Rights Reserved.