| United States-English |
|
|
|
![]() |
Managing HP-UX Software With SD-UX: HP 9000 Computers > Chapter 8 Managing PatchesPatch Operations Summary |
|
This section summarizes how to use SD commands for patch management, including these activities:
Installation of patch products follows the same rules as any other SD installation. The key difference is that patch filtering mechanisms let you select only the patches that meet specified criteria. Filtering mechanisms for patches are:
When you install a patch, SD updates the applied_patches attribute of the fileset that has been patched and updates the INFO file information to include the patched file's attributes. Also (if the patch_save_files option is set to true), files to be altered by a patch are stored to the Installed Products Database (IPD). When a patch is installed, by default it has the patch_state of applied. When the patch is committed (rollback files are removed) or it has been installed without saving rollback files, it has the state of committed. When the patch is superseded, the patch_state is set to superseded, and the superseded_by attribute is set to the software_specification of the superseding patch fileset. If you select a non-patch fileset for installation and patch filesets for that "base" fileset exist in the same source depot, all applicable patches are selected by default as long as the autoselect_patches option is set to its default value of "true." The following rules also apply:
The following examples demonstrate the use of patch options in command lines. Note that the autoselect_patches option defaults to "true". The example below shows the default behavior for patch installation. All patches applying to the software being installed (in this case, X11) are selected by default: swinstall -s sw_server X11 To select all applicable patches that include the category_tag "critical_patch" and install them along with the selected software: swinstall -s sw_server \ -x patch_filter="*.*,c=critical_patch" X11 The following example installs a product and an explicitly defined patch. swinstall -s sw_server \ -x autoselect_patches=false X11 PHSS-12345 When you want to install patches after installation of the base product, you can select the patches explicitly or by matching the installed software using the patch_match_target option, which automatically determines the latest patches for a fileset. To select all patches in the depot that correspond to currently installed software: swinstall -s sw_server -x patch_match_target=true To select all patches in the depot that correspond to currently installed software and that contain the category_tag "critical_patch": swinstall -s sw_server -x patch_match_target=true \ -x patch_filter=" *.*,c=critical_patch" You can repeat a version qualifier (for "AND"
criteria) and use the pipe symbol ("|")
within qualifiers (for "OR" criteria). This is
consistent with the current level-of-expression support in POSIX
You can explicitly specify and install a patch (without autoselection or matching the target) by specifying one or more software_specification operands. To permit patching of kernel files or libraries (e.g. libc.a), SD uses an archive file type of "a". When loading a file of type "a", swinstall temporarily installs the .o file to the target path specified, integrates it into the archive specified by the archive_path attribute of the file, and then removes the .o file. If patch rollback is enabled (see “Patch Removal, Rollback, and Committal”), the original .o file is automatically extracted first and saved so that it can be replaced. Disk Space Analysis is performed as needed to account for these operations. If you install patch filesets and normal filesets in the same session, then each patch fileset is considered to have an "implied prerequisite" on the fileset that it is patching, with respect to ordering. In other words, a product containing the patch fileset is installed (or copied into serial distributions) after installation of the one or more products that contain the patch "ancestors". If a base fileset has the is_kernel attribute set to "true," then the fileset patching it must also have the is_kernel attribute set to "true" to be installed in the kernel phase of the execution. Otherwise, the patch is installed along with other non-kernel filesets. If a bundle contains both normal and patch filesets, the filesets are installed in their normal order except that any base fileset must be installed before its patch or patches. For copying patches, swcopy usage of the autoselect_patches, patch_filter, and patch_match_target options corresponds to the usage in swinstall. The following example copies X11 software from the default depot and copies all patches for this software at the same time. (Note that autoselect_patches is "true" by default.) swcopy X11 @ hostA:/tmp/sw The following example copies all software from the default depot and copies (at the same time and from the same depot) a filtered set of patches (category_tag="critical_patch") for the base software being copied. (Note that autoselect_patches is "true" by default.) swcopy -x patch_filter="*.*,c=critical_patch" \ \* @ hostB:/tmp/newdepot To copy all patches for the base filesets that are already present in the target depot, starting from a depot that contains patch and non-patch software: swcopy -x patch_match_target=true \ @ hostC:/var/spool/sw To copy a filtered set of patches for the base filesets that are already present in the target depot, starting from a depot that contains patches and that may contain non-patch software: swcopy -x patch_match_target=true \ -x patch_filter="*.*,c=critical_patch" \ \* @ hostD:/var/spool/sw/sample.depot The swinstall and swcopy GUIs lets you perform interactive patch installation and copying. (See Chapter 2 “Installing and Copying Software ” for complete details on using the swinstall/swcopy GUIs.) The Manage Patch Selection... option in the Actions menu opens the Manage Patch Selection dialog. This dialog lets you:
The main object list contains a read-only list of available patch categories. The list contains the name of the category and a short description. You can use the list as an aid to selecting and filtering patches. The following options are also available:
You can also set Save Patch Files for Rollback in the Options menu. This sets the patch_save_files option. (The default is "true".) “Default Options” in this chapter for more information on patch options.
To change the default list of patch filters displayed by the swinstall and swcopy GUI read a default list of patch filters that you can use as selection criteria for patch software. The list is stored in:
The list of patch filters is enclosed in braces {} and separated by white space (blank, tab, or newline). For example:
Software objects with the is_patch attribute set to "true" have the built-in, reserved category of patch. This lets you list available patches and patches with a certain name. For example, to list all products and bundles in a depot that have the is_patch attribute set to true: swlist -d -l product -l bundle -a software_spec \ *,c=patch
SD automatically updates the fileset attribute applied_patches to include any applied patches (because it is in the patch fileset's ancestor list).This includes patches that may not share the same product tag as the base filesets (ancestors) that they patch. For example, to show patches to X11 filesets: swlist -l fileset -a applied_patches X11
You can list the products and filesets to which a patch applies by listing the ancestor attribute. Also, you can generate a list of patches that a given patch superseded by listing the supersedes attribute of the patch fileset.
You can use the -l category specification to list the categories of available patches for patches that are defined with category objects. To list the categories defined for patches in the depot mounted at /CD: swlist -d -l category @ /CD
To list a particular attribute of a category object identified by the tag critical_patch: swlist -a description -l category critical_patch To permit future "rollback" of a patch, use the patch_save_files option. This option (set to true by default) automatically saves any files replaced by a patch. You can then restore the original files if you later decide to remove the patch. For example, swinstall -s sw_server -x patch_save_files=true Rollback files are saved to the directory: /var/adm/sw/save/product_name/fileset_name/path where product_name refers to the name of the patch that was applied. The following rules govern patch removal and rollback:
To save disk space when you are certain a patch operates correctly, you may wish to commit the patch by removing the rollback files saved by the patch_save_files option. To commit a patch, invoke swmodify on the patch with the -x patch_commit=true option. (The default value is false.) For example, to commit the patch PHLK_1234 and remove its corresponding rollback files: swmodify -x patch_commit=true PHLK_1234 The verify operation on a normal fileset checks that the latest files are properly installed: when installing a patch, the ancestor fileset is updated to have the correct attributes of the patched files. SD verifies patch filesets by checking that files in a patch are still properly installed (or in the depot correctly). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||