When copying an OS update using the create update command, you can specify an installation script with the installscript attribute. Installation scripts are used to install an OS update and are available for the following scenarios:
A standard OS update that consists of one or more Solaris packages in a tar file, which is known as a package bundle. An installation script can be used in this instance to resolve dependencies. Note that a Solaris package can be delivered in .tar format without the need for an installation script.
A custom OS update that requires an installation script to install the OS update on a managed server.
The following information provides instructions on how to create a successful installation script for either standard or custom OS update installations:
The installation script file must be able to run under the Bourne shell (/bin/sh).
During the installation process with the load update command, both the installation script file and the OS update source file are copied to /tmp directory on the target server. The installation script file is then executed using the Bourne shell with the full path to the source file as the sole argument, instead of the platform's usual native update commands (rpm, pkgadd, or patchadd).
For Solaris packages, N1 System Manager always provides a default admin file if the admin file is not specified. The admin file is copied to /tmp directory on the target server, and the admin file's name will be source-filename.admin, where source-filename is the name of the actual source file used in the create update command. Therefore, you can refer to this admin file in the installation script if needed.
Any output from the installation to stdout or stderr is captured into a single string and displayed in the job detail. If the installation script exits with a non-zero value, it is assumed that the installation failed and the failed status of the task is recorded and displayed.
After the installation of the OS update is complete, the installation script should remove any files that it creates.
If the installation script extracts an OS update, the script should create a new subdirectory (for example, in /tmp) and extract the OS update into that subdirectory. Once the installation completes, the installation script should remove the subdirectory.
By default, the installation script executes in the invoker's home directory.
The installation script should refer to the OS update source files by full path names in order to avoid any confusion.