JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 10 1/13 Installation Guide: Flash Archives (Creation and Installation)     Oracle Solaris 10 1/13 Information Library
search filter icon
search icon

Document Information

Preface

1.  Flash Archive Overview

2.  Flash Archive Planning

3.  Creating Flash Archives (Tasks)

Creating a Flash Archive (Task Maps)

Installing the Master System

Creating Customization Scripts

Creating a Precreation Script

Using a Precreation Script to Create a User-Defined Archive Section

Creating a Postdeployment Script

Creating a Reboot Script

Creating a Flash Archive

How to Create a Flash Archive for an Initial Installation

Creating a Flash Archive (Examples)

Examples of Creating a Flash Archive

Examples of Creating a Flash Archive and Customizing Files

Creating a Flash Archive Differential Archive With an Updated Master Image

How to Create a Flash Archive Differential Archive With an Updated Master Image

How to Create a Flash Archive Differential Archive by Using Live Upgrade

4.  Installing and Administering Flash Archives (Tasks)

5.  Creating and Using a Disaster Recovery Image

6.  Flash Archive (Reference)

Glossary

Index

Creating Customization Scripts

Scripts can customize the archive. Use these scripts for the following purposes:

For guidelines about creating scripts, see Guidelines for Creating a Custom Script.

Creating a Precreation Script

This script runs during archive creation. The script has various uses.

For guidelines about creating the precreation script, see Guidelines for Creating a Custom Script. Then store the script in the /etc/flash/precreation directory.

Example 3-1 Excerpts From a Precreation Script

The following examples are excerpts from a precreation script.

Example 3-2 Precreation Script

#!/bin/sh
echo "Test precreation script started" >> $FLASH_DIR/summary
cat /opt/TestApp/critical_file_list | flcheck -
if [ $? != 0 ]; then
        echo "Test precreation script failure" >> $FLASH_DIR/summary
        exit 1
fi
echo "Test precreation script started" >> $FLASH_DIR/summary
/opt/TestApplication/license_cloning
        $FLASH_DIR/predeployment/.TestApplicationLicenceTransfer \
        $FLASH_DIR/custom_sections/TestApplicationLicenceCounter
echo "Test precreation script finished" >> $FLASH_DIR/summary
exit 0

Using a Precreation Script to Create a User-Defined Archive Section

A precreation script can create a user-defined section in the archive to provide specific application information. This section is intended for archive maintenance. The script must be put in the $FLASH_DIR/sections directory. The flash archive does not process a user-defined section. For example, a section could contain a description of the archive or perhaps a script to check the integrity of an application.

A user-defined section requires the following format:

The precreation script is run before the installation of the archive. If the script is meant to validate the archive, it is kept in the archive. If the script is meant to preserve local configurations on the clone system, it is kept on the clone system. This script also can analyze and collect local data necessary for later customization. For example, client-specific information can be saved before being overwritten by files about to be extracted. This information can then be used in the final stage after extraction.

For guidelines about creating the predeployment script, see Guidelines for Creating a Custom Script.

Store the script in one of the following directories:

Example 3-3 Predeployment Script

#!/bin/sh
$FLASH_DIR/TestApplication/check_hardware
if [ $? != 0 ]; then
        echo Unsupported hardware
        exit 1
fi
$FLASH_DIR/TestApplication/check_licence_key
if [ $? != 0 ]; then
    echo No license for this host
    exit 1
fi
        $FLASH_DIR/TestApplication/deploy_license_key \
        $FLASH_DIR/TestApplication/.TestApplicationLicenceTransfer
        $FLASH_DIR/TestApplication/save_data_files $FLASH_DIR/flash
exit 0

Creating a Postdeployment Script

The postdeployment script is kept in the archive or stored in a local directory on the clone system and runs after installation. The script reconfigures a new system image on a clone system. If the script is stored in the archive, the changes affect all the clone systems. If the script is stored in a local directory on the clone system, the changes affect only the clone system. For example, client-specific information that is saved by a predeployment script can be applied to the clone environment, completing the installation.

Postdeployment scripts can also be used to clean up files after the archive is installed. For example, log files such as the files in /var/adm can be cleaned out.


Note - Not all log files need a script for cleanup. Log files in /var/tmp can be excluded when the archive is created.


For guidelines about creating the postdeployment script, see Guidelines for Creating a Custom Script.

Store the script in one of the following directories:

Example 3-4 Postdeployment Script

#!/bin/sh
$FLASH_DIR/TestApplication/clone_reconfiguration
$FLASH_DIR/TestApplication/restore_data $FLASH_DIR/flash

Creating a Reboot Script

The reboot script is kept in the archive and runs after the system is rebooted. The script does any final configuration after system reconfiguration.

After you install the flash archive on a clone system, some host-specific files are deleted and are re-created for the clone machine. The installation program uses the sys-unconfig(1M) command and the sysidtool(1M) programs to delete and re-create host-specific network configuration files. The files that are re-created include, for example, /etc/hosts, /etc/defaultrouter, and /etc/defaultdomain. You can use the reboot script for any final reconfiguration.

Once you create the reboot script, store the script in the /etc/flash/reboot directory.

Example 3-5 Creating a Reboot Script

#!/bin/sh
$FLASH_DIR/TestApplication/finalize_license