![]() |
![]() |
| ||||
|
Example 21-2 Precreation Script
Using a Precreation Script to Create a User-Defined Archive SectionA 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 Solaris 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.
|
#!/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 |
To Create a Postdeployment ScriptThis 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 those 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.
Create the postdeployment script. Follow the guidelines described in Guidelines for Creating a Custom Script.
Store the script in one of the following directories.
To affect all clone systems, store the script in the /etc/flash/postdeployment directory.
To affect only a local clone system, provide the path to the script that is stored on the clone system with the local_customization keyword in the JumpStart profile.
Example 21-4 Postdeployment Script
#!/bin/sh $FLASH_DIR/TestApplication/clone_reconfiguration $FLASH_DIR/TestApplication/restore_data $FLASH_DIR/flash |
To Create a Reboot ScriptThis 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 Solaris 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.
Example 21-5 Creating a Reboot Script
#!/bin/sh $FLASH_DIR/TestApplication/finalize_license |
You can create an archive with an initial installation that overwrites all the files on the clone system, or you can create a differential archive that only overwrites the changes that are specified. For an overview of a differential archive, see Planning to Create the Solaris Flash Differential Archive for an Update.
Previous Contents Index Next ![]() |