This page has notes related to creating Solaris patches. Patches are in essence packages with associated scripts to handle standard patch functions (primarily, the ability to back out). The packages include only the files that are to be replaced via application of the patch.
Sun's document, the Application Packaging Developer's Guide [SunDoc:805-6338], contains a section about patches and provides a high level of detail.
Gather the required package scripts. The following scripts are utilized to facilitate generalized patch management - other actions typically performed by post or pre install scripts can be appended to the corresponding scripts here.
These scripts are slightly modified versions of those found in patches distributed by Sun. The only modification made to them was to substitute $SUNW_ variables with $RR_ in order to make the patch ID less misleading in the prototype file.
Create the both the prototype and pkginfo file as you would for a normal package. There are a few differences in these files when compared to a typical package:
0 The pkginfo file should be largely identical to the package it is patching. Specifically, the variables PKG, NAME, VERSION, ARCH, and CLASSES should be the same as the package. 0 Add a variable to pkginfo called RR_PATCHID (if using scripts identical to the ones above). This ID is used by the OS utilities patchadd, patchrm, and showrev. It should be in the format WWWWWW-DD, where W is a word character and D is a digit. 0 The prototype file needs to include all the scripts listed above in addition to the contents of the package. The following lines are required:
i checkinstall=checkinstall i preinstall=preinstall i postinstall=postinstall i patch_checkinstall=patch_checkinstall i patch_postinstall=patch_postinstall i i.none=i.none
After creating valid package files, build the package in a temporary patch directory. Repeat this process for all packages that will be patched. For instance:
mkdir /var/tmp/<patchid> pkgmk <options> -d /var/tmp/<patchid> # creates <pkg1> in /var/tmp/<patchid>/<pkg1> pkgmk <options> -d /var/tmp/<patchid> # creates <pkg2> in /var/tmp/<patchid>/<pkg2> ... repeat as required
In order for a patch to be installable with [=patchadd], a file named .diPatch must exist in the patch directory:
touch /var/tmp/<patchid>/.diPatchAll that remains is making the patch easily distributable. Patches are often distributed by Sun as zip files, but this is arbitrary.
cd /var/tmp zip -r <patchid>.zip <patchid>