Skip Navigation Links | |
Exit Print View | |
Oracle Solaris 10 1/13 Installation Guide: JumpStart Installations Oracle Solaris 10 1/13 Information Library |
1. Where to Find Oracle Solaris Installation Planning Information
3. Preparing JumpStart Installations (Tasks)
4. Using Optional JumpStart Features (Tasks)
Creating Derived Profiles With a Begin Script
Tracking Installation Duration With a Begin Script and Finish Script
Adding Files With a Finish Script
Adding Packages or Patches With a Finish Script
Creating a Compressed Configuration File
How to Create a Compressed Configuration File
Creating Disk Configuration Files
SPARC: How to Create a Single-Disk Configuration File
SPARC: How to Create a Multiple-Disk Configuration File
x86: How to Create a Single-Disk Configuration File
x86: How to Create a Multiple-Disk Configuration File
Using a Site-Specific Installation Program
5. Creating Custom Rule and Probe Keywords (Tasks)
6. Performing a JumpStart Installation (Tasks)
7. Installing With JumpStart (Examples)
8. JumpStart Keyword Reference
A finish script is a user-defined Bourne shell script that you specify in the rules file. A finish script performs tasks after the Oracle Solaris software is installed on a system but before the system reboots. You can use finish scripts only when using JumpStart to install Oracle Solaris.
Tasks that you can perform with a finish script include the following:
Adding files
Adding individual packages or patches in addition to the ones that are installed in a particular software group
Customizing the root environment
Installing additional software
The Oracle Solaris installation program mounts the system's file systems on /a. The file systems remain mounted on /a until the system reboots. You can use the finish script to add, change, or remove files from the newly installed file system hierarchy by modifying the file systems that are respective to /a.
During the installation, output from the finish script is deposited in /tmp/finish.log. After the installation is completed, the log file is redirected to /var/sadm/system/logs/finish.log.
Ensure that root owns the finish script and that the permissions are set to 644.
You can use JumpStart environment variables in your finish scripts. For a list of environment variables, see JumpStart Environment Variables.
Save finish scripts in the JumpStart directory.
In the past, the chroot(1M) command was used with the pkgadd and patchadd commands in the finish script environment. In rare instances, some packages or patches do not work with the -R option. You must create a dummy /etc/mnttab file in the /a root path before issuing the chroot command.
To create a dummy /etc/mnttab file, add the following line to your finish script:
cp /etc/mnttab /a/etc/mnttab
Through a finish script, you can add files from the JumpStart directory to an already installed system. You can add the files because the JumpStart directory is mounted on the directory that is specified by the SI_CONFIG_DIR variable. The directory is set to /tmp/install_config by default.
Note - You can also replace files by copying files from the JumpStart directory to already existing files on the installed system.
After you copy all of the files that you are adding to the installed system to the JumpStart directory, insert the following line in the finish script for each file that you want to be copied to the newly installed file system hierarchy:
cp ${SI_CONFIG_DIR}/filename /a/path
Example 4-4 Adding a File With a Finish Script
Assume you have a special application, site_prog, developed for all users at your site. If you place a copy of site_prog into the JumpStart directory, the following line in a finish script copies site_prog from the JumpStart directory into a system's /usr/bin directory:
cp ${SI_CONFIG_DIR}/site_prog /a/usr/bin
You can create a finish script to automatically add packages or patches after the Oracle Solaris software is installed on a system. By adding packages with a finish script, you reduce time and ensure consistency in which packages and patches are installed on different systems at your site.
When you use the pkgadd(1M) or patchadd(1M) commands in finish scripts, use the -R option to specify /a as the root path.
Example 4-5 shows an example of a finish script that adds packages.
Example 4-6 shows an example of a finish script that adds patches.
Example 4-5 Adding Packages With a Finish Script
#!/bin/sh BASE=/a MNT=/a/mnt ADMIN_FILE=/a/tmp/admin mkdir ${MNT} mount -f nfs sherlock:/export/package ${MNT} cat >${ADMIN_FILE} <<DONT_ASK mail=root instance=overwrite partial=nocheck runlevel=nocheck idepend=nocheck rdepend=nocheck space=ask setuid=nocheck conflict=nocheck action=nocheck basedir=default DONT_ASK /usr/sbin/pkgadd -a ${ADMIN_FILE} -d ${MNT} -R ${BASE} SUNWxyz umount ${MNT} rmdir ${MNT}
The commands for this example are as follows:
The following command mounts a directory on a server that contains the package to install.
mount -f nfs sherlock:/export/package ${MNT}
The following command creates a temporary package administration file, admin, to force the pkgadd(1M) command not to perform checks or prompt for questions when installing a package. Use the temporary package administration file to maintain a hands-off installation when you are adding packages.
cat >${ADMIN_FILE} <<DONT_ASK
The following pkgadd command adds the package by using the -a option, specifying the package administration file, and the -R option, specifying the root path.
/usr/sbin/pkgadd -a ${ADMIN_FILE} -d ${MNT} -R ${BASE} SUNWxyz
Example 4-6 Adding Patches With a Finish Script
#!/bin/sh ######## # # USER-CONFIGURABLE OPTIONS # ######## # The location of the patches to add to the system after it's installed. # The OS rev (5.x) and the architecture (`mach`) will be added to the # root. For example, /foo on a 8 SPARC would turn into /foo/5.8/sparc LUPATCHHOST=ins3525-svr LUPATCHPATHROOT=/export/solaris/patchdb ######### # # NO USER-SERVICEABLE PARTS PAST THIS POINT # ######### BASEDIR=/a # Figure out the source and target OS versions echo Determining OS revisions... SRCREV=`uname -r` echo Source $SRCREV LUPATCHPATH=$LUPATCHPATHROOT/$SRCREV/`mach` # # Add the patches needed # echo Adding OS patches mount $LUPATCHHOST:$LUPATCHPATH /mnt >/dev/null 2>&1 if [ $? = 0 ] ; then for patch in `cat /mnt/*Recommended/patch_order` ; do (cd /mnt/*Recommended/$patch ; echo yes | patchadd -u -d -R $BASEDIR .) done cd /tmp umount /mnt else echo "No patches found" if
You can also use finish scripts to customize files that are already installed on a system. For example, the finish script in the following example customizes the root environment by appending information to the .cshrc file in the root (/) directory.
Example 4-7 Customizing the Root Environment With a Finish Script
#!/bin/sh # # Customize root's environment # echo "***adding customizations in /.cshrc" test -f a/.cshrc || { cat >> a/.cshrc <<EOF set history=100 savehist=200 filec ignoreeof prompt="\$user@`uname -n`> " alias cp cp -i alias mv mv -i alias rm rm -i alias ls ls -FC alias h history alias c clear unset autologout EOF }
You can use finish scripts to install additional software after the Oracle Solaris OS is installed. The Oracle Solaris installation program prompts you to enter information during the installation. To maintain a hands-off installation, you can run the Oracle Solaris installation program with the -nodisplay or -noconsole options.
Table 4-1 Oracle Solaris Installation Options
|
For more information, see the installer(1M) man page.