Skip Navigation Links | |
Exit Print View | |
Oracle Solaris 10 9/10 Installation Guide: Solaris Live Upgrade and Upgrade Planning |
Part I Upgrading With Solaris Live Upgrade
1. Where to Find Solaris Installation Planning Information
2. Solaris Live Upgrade (Overview)
3. Solaris Live Upgrade (Planning)
4. Using Solaris Live Upgrade to Create a Boot Environment (Tasks)
5. Upgrading With Solaris Live Upgrade (Tasks)
6. Failure Recovery: Falling Back to the Original Boot Environment (Tasks)
7. Maintaining Solaris Live Upgrade Boot Environments (Tasks)
8. Upgrading the Solaris OS on a System With Non-Global Zones Installed
9. Solaris Live Upgrade (Examples)
10. Solaris Live Upgrade (Command Reference)
Part II Upgrading and Migrating With Solaris Live Upgrade to a ZFS Root Pool
11. Solaris Live Upgrade and ZFS (Overview)
12. Solaris Live Upgrade for ZFS (Planning)
13. Creating a Boot Environment for ZFS Root Pools
14. Solaris Live Upgrade For ZFS With Non-Global Zones Installed
B. Additional SVR4 Packaging Requirements (Reference)
Preventing Modification of the Current OS
Differences Between $PKG_INSTALL_ROOT and $BASEDIR Overview
Guidelines for Writing Scripts
Preventing User Interaction When Installing or Upgrading
Setting Package Parameters For Zones
Following the requirements in this section keeps the currently running OS unaltered.
For an installation of an operating system to be successful, packages must recognize and correctly respect alternate root (/) file systems, such as a Solaris Live Upgrade inactive boot environment.
Packages can include absolute paths in their pkgmap file (package map). If these files exist, they are written relative to the -R option of the pkgadd command. Packages that contain both absolute and relative (relocatable) paths can be installed to an alternative root (/) file system as well. $PKG_INSTALL_ROOT is prepended to both absolute and relocatable files so all paths are resolved properly when being installed by pkgadd.
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
|
$PKG_INSTALL_ROOT is the location of the root (/) file system of the machine to which you are adding the package. The location is set to the -R argument of the pkgadd command. For example, if the following command is invoked, then $PKG_INSTALL_ROOT becomes /a during the installation of the package.
# pkgadd -R /a SUNWvxvm
$BASEDIR points to the relocatable base directory into which relocatable package objects are installed. Only relocatable objects are installed here. Nonrelocatable objects (those that have absolute paths in the pkgmap file) are always installed relative to the inactive boot environment, but not relative to the $BASEDIR in effect. If a package has no relocatable objects, then the package is said to be an absolute package (or nonrelocatable), and $BASEDIR is undefined and not available to package procedure scripts.
For example, suppose a package's pkgmap file has two entries:
1 f none sbin/ls 0555 root sys 3541 12322 1002918510 1 f none /sbin/ls2 0555 root sys 3541 12322 2342423332
The pkginfo file has a specification for $BASEDIR:
BASEDIR=/opt
If this package is installed with the following command, then ls is installed in /a/opt/sbin/ls, but ls2 is installed as /a/sbin/ls2.
# pkgadd -R /a SUNWtest
Your package procedure scripts must be independent of the currently running OS to prevent modifying the OS. Procedure scripts define actions that occur at particular points during package installation and removal. Four procedure scripts can be created with these predefined names: preinstall, postinstall, preremove, and postremove.
Table B-2 Guidelines For Creating Scripts
|
Packages must not execute commands delivered by the package itself. This is to maintain diskless client compatibility and avoids running commands that might require shared libraries that are not installed yet.
All packages must pass pkgchk validation. After a package is created and before it is installed, it must be checked with the following command.
# pkgchk -d dir_name pkg_name
Specifies the name of the package
Example B-1 Testing a Package
After a package is created, it must be tested by installing it in an alternate root (/) file system location by using the -R dir_name option to pkgadd. After the package is installed, it must be checked for correctness by using pkgchk, as in this example.
# pkgadd -d . -R /a SUNWvxvm # pkgchk -R /a SUNWvxvm
No errors should be displayed.
Example B-2 Testing a Package on /export/SUNWvxvm
If a package exists at /export/SUNWvxvm, then you would issue the following command.
# pkgchk -d /export SUNWvxvm
No errors should be displayed.
Other commands can check the package when you are creating, modifying, and deleting files. The following commands are some examples.
For example, the dircmp or fssnap commands can be used to verify that packages behave properly.
Also, the ps command can be used for testing daemon compliance by making sure daemons are not stopped or started by the package.
The truss, pkgadd -v, and pkgrm commands can test runtime package installation compliance, but might not work in all situations. In the following example, the truss command strips out all read-only, non-$TEMPDIR access and shows only non-read-only access to paths that do not lie within the specified inactive boot environment.
# TEMPDIR=/a; export TEMPDIR # truss -t open /usr/sbin/pkgadd -R ${TEMPDIR} SUNWvxvm \ 2>&1 > /dev/null | grep -v O_RDONLY | grep -v \ 'open("'${TEMPDIR}