Solaris 10 10/08 Installation Guide: Custom JumpStart and Advanced Installations

Using the pkgadd -R Command

Packages being installed by using the pkgadd -R option or being removed using the pkgrm -R option must not alter the currently running system. This feature is used by custom JumpStart, Solaris Live Upgrade, non-global zones and diskless client.

Any procedure scripts that are included in the packages being installed with the pkgadd command -R option or being removed by using the pkgrm command -R option must not alter the currently running system. Any installation scripts that you provide must reference any directory or file that is prefixed with the $PKG_INSTALL_ROOT variable. The package must write all directories and files with the $PKG_INSTALL_ROOT prefix. The package must not remove directories without a $PKG_INSTALL_ROOT prefix.

Table B–1 provides examples of script syntax.

Table B–1 Examples of Installation Script Syntax

Script Type 

Correct Syntax 

Incorrect Syntax 

Bourne shell “if” statement fragments 

if [ -f ${PKG_INSTALL_ROOT}\
/etc/myproduct.conf ] ; then
if [ -f /etc/myproduct.conf ] ; \

Removing a file 

/bin/rm -f ${PKG_INSTALL_ROOT}\
/bin/rm -f /etc/myproduct.conf 

Changing a file 

echo "test=no" > ${PKG_INSTALL_ROOT}\
echo "test=no" > \