A patch is defined as software packaged with the is_patch attribute set to true. As with non-patch software, patches are structured into products and filesets . By convention, patch products are given unique names , but their fileset names match the corresponding base filesets that they patch. In general, patches are intended to be managed (that is, installed, copied , or removed) at the product level. Each patch fileset has associated with it an ancestor fileset, which is the base software that it patches. A patch fileset may not be installed on a target system unless its ancestor fileset is also being installed or is already present on the system. Similarly, an ancestor fileset cannot be removed without also removing all of its patches. A patch filesets ancestor is identified by its ancestor attribute. Patches that have been applied to an ancestor fileset are listed in the ancestor's applied_patches attribute. HP patches are required to completely replace earlier patches. A newer version of a patch is said to supersede an earlier version. A patch fileset's supersedes attribute lists all previous patch filesets that it supersedes. All these attributes can make simply listing patches a little confusing. Here are some variants of the swlist command that will list patches, but in some cases the command lists not only the patch but also products without patches. # swlist l patch This will list all products and any patches applied to them. That's not what I am looking for. # swlist l product a is_patch This will list all the products installed and display whether the is_patch attribute is true or false for that particular product. No, I don't really want that either. Finally, root@hpeos004[tmp] swlist -l product *,c=patch more # Initializing... # Contacting target "hpeos004"... # # Target: hpeos004:/ # PHCO_22958 1.0 set_parms PHCO_22989 1.0 Som2elf Patch PHCO_23004 1.0 cumulative SAM/ObAM patch PHCO_23083 1.0 newgrp(1) patch PHCO_23150 B.11.11.14 HP Array Manager/60 cumulative patch PHCO_23251 1.0 libc manpage cumulative patch PHCO_23263 B.11.11.15 HP AutoRAID Manager cumulative patch PHCO_23333 1.0 LVM Virtual Array support PHCO_23370 1.0 lint(1) library patch PHCO_23376 1.0 pipcs(1) and pipcrm(1) patch PHCO_23463 1.0 sysdef(1) patch PHCO_23464 1.0 Locales Y2K patch PHCO_23492 1.0 Kernsymtab Patch PHCO_23510 1.0 gsp parser & dimm labels PHCO_23702 1.0 cumulative header file patch for Standard input This looks a bit more like it. There is also a contributed command called show_patches . On HP-UX 11i, there is a patch called PHCO_24630 , which supplies this and additional commands we look at later: root@hpeos004[tmp] swlist -l file PHCO_24630 # Initializing... # Contacting target "hpeos004"... # # Target: hpeos004:/ # # PHCO_24630 1.0 HP-UX Patch Tools # PHCO_24630.CMDS-AUX 1.0 OS-Core.CMDS-AUX /usr/contrib/bin/check_patches /usr/contrib/bin/show_patches /usr/contrib/man/man1/show_patches.1 /usr/contrib/man/man1m/check_patches.1m /usr/sbin/cleanup /usr/share/man/man1m.Z/cleanup.1m root@hpeos004[tmp] root@hpeos004[tmp] /usr/contrib/bin/show_patches more Active Patch Patch Description ---------- ----------------------------------------- PHCO_22958 set_parms PHCO_22989 Som2elf Patch PHCO_23004 cumulative SAM/ObAM patch PHCO_23083 newgrp(1) patch PHCO_23150 HP Array Manager/60 cumulative patch PHCO_23251 libc manpage cumulative patch PHCO_23263 HP AutoRAID Manager cumulative patch PHCO_23333 LVM Virtual Array support PHCO_23370 lint(1) library patch PHCO_23376 pipcs(1) and pipcrm(1) patch PHCO_23463 sysdef(1) patch PHCO_23464 Locales Y2K patch PHCO_23492 Kernsymtab Patch PHCO_23510 gsp parser & dimm labels PHCO_23702 cumulative header file patch for prot.h PHCO_23774 Partition Commands cumulative patch PHCO_23871 sh-posix(1) patch PHCO_23909 cu(1) patch PHCO_23914 Enhancement support to Ultrium tape Standard input Okay, so we can list patches. The next attribute we need to consider concerns the state of the patch ”whether it has been properly installed and configured yet. 12.8.1 Is a patch applied or configured? The state attribute for a fileset or a product provides useful information about the installation state of software. Software Distributor commands automatically keep track of software management operations by creating an Installed Products Database (IPD). A Software Distributor operation leaves a fileset in one of the following states and records it in the fileset's state attribute. A product or fileset can be in the following states: Installed (IPD only) : The software was successfully installed but not configured. Although not every patch requires configuration, HP recommends that you move all patches left in the installed state to the configured state with the swconfig command. Configured (IPD only) : The product was successfully installed and configured. No further operations are required. Available (depot only) : The software is ready for access. It can be used by a swinstall or swcopy session using the depot as the source. Corrupt : This indicates that errors detected in the execution phase of an swcopy or swinstall process left the software in an unknown state and that the software should not be used. Transient : This indicates that swinstall or swcopy was killed or aborted during the execution phase, leaving the software in an unknown and incomplete state. The transient state differs from the corrupt state in that SD did not detect the failure when it initially occurred. This all sounds fine to me. However, because a patch is a special entity in the world of Software Distributor, there are special attributes specific to patches. This attribute is known as the patch_state . It can take one of the following values: Applied : An applied patch contains the software that is currently active on the system and is the most recent member of its supersession chain (of one or more patches) to have been loaded. A patch in the applied state has not been committed or superseded . Committed : A committed patch cannot be directly removed from the system. A committed fileset is also in either the applied or superseded state. Common practice is to use the superseded_by field as a check for active patches. Superseded : A patch in the superseded state has been replaced by a newer member of its supersession chain. A patch in the superseded state may or may not have been committed . Using the patch_state is good practice when trying to determine the true state of a patch, especially when considering situations such as patch committal and patch supersession order. Here, we can see the true state for the patches on my system: root@hpeos004[tmp] swlist -l fileset -a patch_state -x show_superseded_patches=true * ,c=patch more # Initializing... # Contacting target "hpeos004"... # # Target: hpeos004:/ # # PHCO_22958 PHCO_22958.FIRST-BOOT applied # PHCO_22989 PHCO_22989.CORE-KRN applied # PHCO_23004 PHCO_23004.SAM superseded PHCO_23004.SAM-HELP superseded # PHCO_23083 PHCO_23083.CMDS-AUX superseded # PHCO_23150 PHCO_23150.ADMN-ENG-A-MAN applied PHCO_23150.ARRAY-MGMT applied # PHCO_23251 PHCO_23251.CAUX-ENG-A-MAN applied PHCO_23251.INET-ENG-A-MAN applied PHCO_23251.NW-ENG-A-MAN applied PHCO_23251.PAUX-ENG-A-MAN applied Standard input Notice the use of the option show_superseded_patches . This option normally defaults to false , which means we normally see only the most recent revision of a patch. This can be useful when we come to remove old patches without removing the ancestor fileset. The patch_state attribute is the key to identifying the true status of a patch. In the majority of cases, patches should be applied . 12.8.2 Patch ancestry Patch ancestry is one of the basic concepts of patch operations. The ancestor of a patch is defined as the pre-existing software that is being modified or replaced. A patch delivers a new version of a file; the ancestor delivered the original version of the file. While the concept of ancestry can be applied to a single file, in practice ancestors are managed between filesets. Working with filesets, it is possible for several patches to modify a single product or for a single patch to modify several products. Patches for HP-UX products are required to be cumulative. This means that any individual patch supplied by HP must completely contain all aspects of any preceding patch. The newer patch is said to supersede all earlier patches. A series of patches, each replacing the previous patch, forms a supersession chain. In general, the patch numbers will increase along a patch supersession chain . An example is shown in Figure 12-1. Figure 12-1. Patch ancestry. The Software Distributor packaged product FooProd , is initially patched by PHCO_1000 . This patch is superseded by PHCO_2000 . When a patch is superseded , it remains on the system but is not active. Only the top patch of the chain is in the active (applied) state. Since patches are designed to be cumulative, it is not required to have all patches in a supersession chain installed. In fact, the presence of a superseding patch will prevent the installation of any preceding patch. If this were not the case, an older patch could replace files with older versions. Looking at a live system, we can extract the complete patch ancestry by displaying both attributes supersedes and ancestor with swlist : root@hpeos004[] swlist -l fileset -a ancestor -a supersedes PHCO_26385 # Initializing... # Contacting target "hpeos004"... # # Target: hpeos004:/ # # PHCO_26385 PHCO_26385.CAUX-ENG-A-MAN PHCO_23083.CAUX-ENG-A-MAN,fr=* OS-Core.CAUX-ENG-A-MAN,fr=B .11.11,v=HP PHCO_26385.CMDS-AUX PHCO_23083.CMDS-AUX,fr=* OS-Core.CMDS-AUX,fr=B.11.11,v=HP root@hpeos004[] Here, we can see that filesets OS-Core.CAUX-ENG-A-MAN and OS-Core.CMDS-AUX are the ancestors . The patch PHCO_23083 was installed but has subsequently been superseded by PHCO_26385 . Look at it from the aspect of the individual filesets themselves : root@hpeos004[] swlist -l patch -x show_superseded_patches=true OS-Core.CMDS-AUX # Initializing... # Contacting target "hpeos004"... # # Target: hpeos004:/ # # OS-Core.CMDS-AUX B.11.11 CMDS-AUX PHCO_23083.CMDS-AUX 1.0 OS-Core.CMDS-AUX superseded PHCO_23376.CMDS-AUX 1.0 OS-Core.CMDS-AUX applied PHCO_24481.CMDS-AUX 1.0 OS-Core.CMDS-AUX applied PHCO_24589.CMDS-AUX 1.0 OS-Core.CMDS-AUX applied PHCO_24630.CMDS-AUX 1.0 OS-Core.CMDS-AUX applied PHSS_26263.CMDS-AUX 1.0 B.11.11 applied PHCO_26385.CMDS-AUX 1.0 OS-Core.CMDS-AUX applied We can see that PHCO_23083 and PHCO_26385 are not the only patches that apply to this fileset. |