The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
commands do not finish Raom UNIX for Advanced & Expert Users 1 04-16-2008 05:45 PM
How to wait for the subprocess to finish in tcl nathgopi214 Shell Programming and Scripting 1 03-26-2008 09:40 AM
how do i finish this last one.. newby2 UNIX for Dummies Questions & Answers 2 01-18-2008 11:52 AM
How can I wait for PID to finish in another shell superdelic UNIX for Advanced & Expert Users 2 01-17-2005 10:17 PM
using tab to finish command line parameter kymberm Shell Programming and Scripting 3 09-20-2002 03:54 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-27-2003
dorilevy dorilevy is offline
Registered User
  
 

Join Date: Aug 2002
Posts: 18
jumpstart - finish scripts

hi,

where i can find some help on how to write finish scripts for jump-start??
i tried sun-blueprints but i couldnt find it...
  #2 (permalink)  
Old 03-27-2003
oombera's Avatar
oombera oombera is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
I saw a small blurb here:

Quote:
4.0 Begin & Finish Scripts

These are the optional features of jumpstart .

A begin script is a shell script which is used to perform the task before Solaris OS is installed. A finish script is used to perform the tasks after the OS is installed but before reboot.

Output of these scripts goes to /var/adm/begin.log and finish.log.
These should be owned by the root with permission 644
Also, check out http://www.blacksheepnetworks.com/security/resources/ and search for the phrase "SOLARIS JUMPSTART" - there's gotta be something you can use there.

Here another resource:
http://www.sun.com/solutions/blueprints/0800/jssec2.pdf

Last edited by oombera; 03-27-2003 at 11:12 AM..
  #3 (permalink)  
Old 04-03-2003
hugo_perez hugo_perez is offline
Registered User
  
 

Join Date: Apr 2002
Location: Argentine - that better than to eat meat and to drink wine (both Argentineans)?.
Posts: 132
If you can try

For example:

Look at the following line for your rule file, that is you have a SUN E420R, with between 512 and 1024 RAM size and a hard disk between 8 and 18 GB, use the normal_BE.profile ( in the /jumpstart/Profiles/BE directory) and a Finish script MR_inst_drivers_BE.sh (in /jumpstart/Drivers directory)

model SUNW,Ultra-80 && memsize 512-1024 && disksize c0t0d0 8192-194560 - Profiles/BE/normal_BE.profile Drivers/MR_inst_drivers_BE.sh


The MR_inst_drivers_BE.sh can look like this:
Code:
#!/bin/sh
#
# Basic driver for Enterprise Engineering lab hosts.
#
FINISH_DIR="${SI_CONFIG_DIR}/Finish"
SCRIPT_LIST="install_recommended_patches.sh dns_config.sh cust_prof.sh"

for script in ${SCRIPT_LIST}
do
    if [ -f "${FINISH_DIR}/${script}" ]; then
        echo "Starting finish script: ${script}"
        echo ""
        . ${FINISH_DIR}/${script}
    else
        echo "ERROR: File not found: ${script}"
    fi
done
This Finish script look in the /jumpstart/Finish Directory and run
3 scripts:

install_recommended_patches.sh

dns_config.sh

cust_prof.sh



For example install_recommended_patches.sh looks like:
Code:
#!/bin/sh
#
#ident "@(#)install-recommended-patches.fin  1.6  00/10/19 SMI"
#
# This script is responsible for installing a Sun Recommended
# and Security Patch Cluster from ${BASEDIR}/${PATCH_DIR}.
set -x

errorCondition=0
mountedProc=0

BASEDIR="/a"
PATCH_SERV_DIR=""
PATCH_DIR="/mnt"
MNTTAB="${BASEDIR}/etc/mnttab"
OE_VER="`ps -ef |grep agregar |grep -v grep |awk '{print $13}'`"

mount -F nfs -o ro 192.168.215.183:/jumpstart/Patches ${BASEDIR}${PATCH_DIR}
case ${OE_VER} in

   5.8)
      PATCH_SERV_DIR=8_Recommended
      ;;

   5.7)
      PATCH_SERV_DIR=7_Recommended
      ;;

   5.6)
      PATCH_SERV_DIR=2.6_Recommended
      ;;

   5.5.1)
      PATCH_SERV_DIR=2.5.1_Recommended
      ;;

   *)
      errorCondition=1
      ;;

esac


if [ ${errorCondition} = 0 ]; then
   if [ ! -d ${BASEDIR}${PATCH_DIR} ]; then
      echo  "The directory, ${PATCH_DIR}, does not exist."
   else

      # Some patches require a loopback filesystem be used when 
      # installing using chroot.

      if [ -d /proc ]; then
         if [ "`df -n /proc | awk '{ print $3 }'`" = "proc" ]; then
            if [ -d ${BASEDIR}/proc ]; then
               if [ "`df -n ${BASEDIR}/proc | \
                  awk '{ print $3 }'`" != "proc" ]; then
                  mount -F lofs /proc ${BASEDIR}/proc
                  mountedProc=1
               fi
            fi
         fi
      fi

      if [ ! -s ${MNTTAB} ]; then
         if [ -s /etc/mnttab ]; then

            # First create ${MNTTAB} so patches can read it:

            echo "Copying /etc/mnttab from miniroot to ${MNTTAB}"
            echo ""

            rm -f ${MNTTAB}

            if [ "${OE_VER}" = "5.5.1" ]; then

               # This is necessary for "install_cluster" to get the mount
               # point for /var/sadm/patch from the "real" root filesystem.

               cat /etc/mnttab | sed 's/\/a/\//g' > ${MNTTAB}

               # This is necessary for "df" to execute which is needed by
               # "install_cluster" to determine if enough free disk 
               # space exists on the target system.

               touch           ${BASEDIR}/etc/.mnttab.lock
               chown root:root ${BASEDIR}/etc/.mnttab.lock
               chmod 644       ${BASEDIR}/etc/.mnttab.lock
            else
               cp /etc/mnttab ${MNTTAB}
            fi
         else
            echo  "Could not find a valid /etc/mnttab"
            errorCondition=1
         fi
      fi

      if [ ${errorCondition} = 0 ]; then

         SHOWCOMMAND=""

         if [ -x ${BASEDIR}/usr/sbin/patchadd ]; then
            SHOWCOMMAND="/usr/sbin/patchadd"
         elif [ -x ${BASEDIR}/usr/bin/showrev ]; then
            SHOWCOMMAND="/usr/bin/showrev"
         fi

#         if [ "${SHOWCOMMAND}" != "" ]; then
#            echo "The following patches are currently installed:"
#            echo ""
#            chroot ${BASEDIR} ${SHOWCOMMAND} -p
#            echo ""
#         fi
   
         cd ${BASEDIR}${PATCH_DIR}
   
         if [ -d ${PATCH_SERV_DIR} ]; then
            echo "Installing the ${PATCH_SERV_DIR} patch cluster."
            echo ""
   
            if [ "${SHOWCOMMAND}" = "/usr/sbin/patchadd" ]; then
               chroot ${BASEDIR} /usr/sbin/patchadd -d -u \
                  -M ${PATCH_DIR}/${PATCH_SERV_DIR} patch_order
            elif [ -x ${PATCH_DIR}/${PATCH_SERV_DIR}/install_cluster ]; then
               chroot ${BASEDIR} \
                  ${PATCH_DIR}/${PATCH_SERV_DIR}/install_cluster -q \
                  ${PATCH_DIR}/${PATCH_SERV_DIR}
            else
                  echo  "Cannot find /usr/sbin/patchadd or install_cluster"
            fi
         else 
            echo  "Could not find the ${PATCH_SERV_DIR} patch cluster"
         fi
      fi
cp -p ${BASEDIR}${PATCH_DIR}/nsswitch.conf /a/etc/nsswitch.conf

      umount ${BASEDIR}${PATCH_DIR}
      if [ ${mountedProc} = 1 ]; then
         umount ${BASEDIR}/proc
      fi
   fi
fi
For example dns_config.sh looks like:
Code:
#!/bin/sh
#
#ident "@(#)install-recommended-patches.fin  1.6  00/10/19 SMI"
#
# This script is responsible for installing a Sun Recommended
# and Security Patch Cluster from ${BASEDIR}/${PATCH_DIR}.
set -x

errorCondition=0
mountedProc=0

BASEDIR="/a"
PATCH_SERV_DIR=""
PATCH_DIR="/mnt"
MNTTAB="${BASEDIR}/etc/mnttab"
OE_VER="`uname -r`"
echo "domain labo.mr.com.ar" >> /a/etc/resolv.conf
echo "nameserver 200.149.64.166" >> /a/etc/resolv.conf
echo "nameserver 200.149.64.167" >> /a/etc/resolv.conf
and cust_prof.sh looks like:
Code:
#!/bin/sh
#
#ident "@(#)install-recommended-patches.fin  1.6  00/10/19 SMI"
#
# This script is responsible for installing a Sun Recommended
# and Security Patch Cluster from ${BASEDIR}/${PATCH_DIR}.
set -x

errorCondition=0
mountedProc=0

BASEDIR="/a"
PATCH_SERV_DIR=""
PATCH_DIR="/mnt"
MNTTAB="${BASEDIR}/etc/mnttab"
OE_VER="`uname -r`"
echo "PATH=$PATH:/usr/local/bin:/usr/dt/bin:/usr/openwin/bin" >> /a/etc/profile
echo "export PATH" >> /a/etc/profile
This help you ?

Regards. Hugo.

added code tags for readability --oombera

Last edited by oombera; 02-17-2004 at 03:27 PM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0