Building different types of software depots in HPUX

Learn to build directory and tape software depots in HPUX. Package software or patch bundles according to the environment need to facilitate installation.

HPUX patch management is an important aspect of HPUX server administration which includes downloads, distribution for installation, and final patch installation. In this post, we will be concentrating on the patch distribution part. HPUX patches can be in two forms: directory depots and tape depots (i.e. single *.depot file)

Directory depots are those which you normally get by expanding downloaded files from the HP software portal. This is good for local and network installs. Network installs can be done using: swinstall -s hostname:/some/place/directorydepotBut they are not useful for movement. If you want to move these software depots from one location to another with FTP then it’s a bit slow since there are plenty of files to copy.

Tape depots  (i.e. single *.depot file) is just like single RPM packages in the case of Linux. These are easy to copy, move, FTP. But these depots can’t be used for network installs as we saw earlier.

In this post, we will see how to create a tape depot using a directory depot and vice versa.

Create directory depot from tape depot:

You need to use swcopy command to transfer files in tape depot to directory depot. The command should be supplied with -s as source depot and turn off checking dependencies while copying using -x option.

# /usr/sbin/swcopy -x enforce_dependencies=false -s /tmp/PACPTHP_00001.depot \* @ /tmp/depot

=======  01/07/17 02:58:58 EDT  BEGIN swcopy SESSION (non-interactive)
         (jobid=testsrv2-0397)

       * Session started for user "root@testsrv2".

       * Beginning Selection
       * "testsrv2:/tmp/depot":  This target does not exist and
         will be created.
       * Source:                 /tmp/PACPTHP_00001.depot
       * Targets:                testsrv2:/tmp/depot
       * Software selections:
             HPOvLcore.HPOVBBC,r=6.00.000,a=HP-UX_B.11.00_32/64,v=HP,fr=6.10.050,fa=HP-UX_B.11.00_32/64
             HPOvLcore.HPOVCTRL,r=6.00.000,a=HP-UX_B.11.00_32/64,v=HP,fr=6.00.060,fa=HP-UX_B.11.00_32/64
             HPOvLcore.HPOVSECCO,r=6.00.000,a=HP-UX_B.11.00_32/64,v=HP,fr=6.00.040,fa=HP-UX_B.11.00_32/64
             HPOvLcore.HPOVXPL,r=6.00.000,a=HP-UX_B.11.00_32/64,v=HP,fr=6.00.070,fa=HP-UX_B.11.00_32/64
             HPOvLcore.HPOVBBC,r=6.00.000,a=HP-UX_B.11.22_IA,v=HP,fr=6.10.050,fa=HP-UX_B.11.22_IA
             HPOvLcore.HPOVCTRL,r=6.00.000,a=HP-UX_B.11.22_IA,v=HP,fr=6.00.060,fa=HP-UX_B.11.22_IA
             HPOvLcore.HPOVSECCO,r=6.00.000,a=HP-UX_B.11.22_IA,v=HP,fr=6.00.040,fa=HP-UX_B.11.22_IA
             HPOvLcore.HPOVXPL,r=6.00.000,a=HP-UX_B.11.22_IA,v=HP,fr=6.00.070,fa=HP-UX_B.11.22_IA
             HPOvPerf.HPOVPACC,r=4.70.000,a=HP-UX_B.11.00_32/64,v=HP,fr=10.50.060,fa=HP-UX_B.11.00_32/64
             HPOvPerf.HPOVPCO,r=4.70.000,a=HP-UX_B.11.00_32/64,v=HP,fr=10.50.060,fa=HP-UX_B.11.00_32/64
             HPOvPerf.HPOVPACC,r=4.70.000,a=HP-UX_B.11.22_IA,v=HP,fr=10.50.060,fa=HP-UX_B.11.22_IA
             HPOvPerf.HPOVPCO,r=4.70.000,a=HP-UX_B.11.22_IA,v=HP,fr=10.50.060,fa=HP-UX_B.11.22_IA
       * Selection succeeded.


       * Beginning Analysis and Execution
       * Session selections have been saved in the file
         "/home/sladmin/.sw/sessions/swcopy.last".
       * The analysis phase succeeded for "testsrv2:/tmp/depot".
       * The execution phase succeeded for "testsrv2:/tmp/depot".
       * Analysis and Execution succeeded.


NOTE:    More information may be found in the agent logfile using the
         command "swjob -a log testsrv2-0397 @
         testsrv2:/tmp/depot".

=======  01/07/17 02:59:02 EDT  END swcopy SESSION (non-interactive)
         (jobid=testsrv2-0397)

NOTE: you must escape or quote the asterisk (as above) because you don’t want the shell to replace it with a list of file names.

# ll /tmp/depot
total 32
dr-x------   6 root       sys             96 Jan  7 02:59 HPOvLcore
dr-x------   6 root       sys             96 Jan  7 02:59 HPOvLcore.2
dr-x------   4 root       sys             96 Jan  7 02:59 HPOvPerf
dr-x------   4 root       sys             96 Jan  7 02:59 HPOvPerf.2
dr-x------   7 root       sys           8192 Jan  7 02:59 catalog
-rw-r--r--   1 root       sys           1999 Jan  7 02:59 swagent.log

Resulting directory depot is ready to install locally (swinstall -s /tmp/depot) or over network (swinstall -s testsrv2:/tmp/depot)!

Create tape depot from directory depot:

Here swpackage command does the work of packaging all directory depot files into one single software depot file. Same command options as described above works here. Along with them, you need to specify media type as tape so that a single depot file will be generated.

# /usr/sbin/swpackage -x media_type=tape -s /tmp/depot \* @ /tmp/output.depot

=======  01/07/17 03:03:10 EDT  BEGIN swpackage SESSION

       * Session started for user "root@testsrv2".

       * Source:        testsrv2:/tmp/depot
       * Target:        testsrv2:/tmp/output.depot
       * Software selections:
             *


       * Beginning Selection Phase.
       * Reading the source depot "/tmp/depot".
       * Reading the contained files information for each selected
         product.

NOTE:    The temporary target depot "/var/tmp/pkgAAA005349" has been
         created.
       * Selection Phase succeeded.


       * Beginning Analysis Phase.
       * Analysis Phase succeeded.


       * Beginning Package Phase.
       * Packaging the product "HPOvLcore".
       * Packaging the fileset "HPOvLcore.HPOVBBC".
       * Packaging the fileset "HPOvLcore.HPOVCTRL".
       * Packaging the fileset "HPOvLcore.HPOVSECCO".
       * Packaging the fileset "HPOvLcore.HPOVXPL".

       * Packaging the product "HPOvLcore".
       * Packaging the fileset "HPOvLcore.HPOVBBC".
       * Packaging the fileset "HPOvLcore.HPOVCTRL".
       * Packaging the fileset "HPOvLcore.HPOVSECCO".
       * Packaging the fileset "HPOvLcore.HPOVXPL".

       * Packaging the product "HPOvPerf".
       * Packaging the fileset "HPOvPerf.HPOVPACC".
       * Packaging the fileset "HPOvPerf.HPOVPCO".

       * Packaging the product "HPOvPerf".
       * Packaging the fileset "HPOvPerf.HPOVPACC".
       * Packaging the fileset "HPOvPerf.HPOVPCO".
       * Package Phase succeeded.


       * Beginning Tapemaker Phase.
       * Copying the temporary depot to the tape
         "/tmp/output.depot".
       * Calculating the tape blocks required to copy the temporary
         depot to the tape "/tmp/output.depot".
NOTE:    The temporary depot requires 40540 Kbytes on the tape
         "/tmp/output.depot".
       * Writing the tape "/tmp/output.depot" (tape 1 of 1).
       * Writing the fileset "HPOvLcore.HPOVXPL" (1 of 12)
       * Writing the fileset "HPOvLcore.HPOVSECCO" (2 of 12)
       * Writing the fileset "HPOvLcore.HPOVBBC" (3 of 12)
       * Writing the fileset "HPOvLcore.HPOVCTRL" (4 of 12)
       * Writing the fileset "HPOvLcore.HPOVXPL" (5 of 12)
       * Writing the fileset "HPOvLcore.HPOVSECCO" (6 of 12)
       * Writing the fileset "HPOvLcore.HPOVBBC" (7 of 12)
       * Writing the fileset "HPOvLcore.HPOVCTRL" (8 of 12)
       * Writing the fileset "HPOvPerf.HPOVPACC" (9 of 12)
       * Writing the fileset "HPOvPerf.HPOVPCO" (10 of 12)
       * Writing the fileset "HPOvPerf.HPOVPACC" (11 of 12)
       * Writing the fileset "HPOvPerf.HPOVPCO" (12 of 12)
       * Tape #1: CRC-32 checksum & size: 684796198 41512960

       * Removing the temporary depot.
       * Tapemaker Phase succeeded.


=======  01/07/17 03:03:12 EDT  END swpackage SESSION

The .depot files are actually images of swinstall tapes, hence media_type=tape. Resulting .depot files can be used with swinstall for installation (swinstall -s /tmp/output.depot).

Merging multiple depots to create single depot:

Even multiple depots can be copied to single one using swcopy command.

# swcopy -x enforce_dependencies=false -s /some/where/thing1.depot \* @ /some/place/directorydepot
# swcopy -x enforce_dependencies=false -s /some/where/thing2.depot \* @ /some/place/directorydepot
# swcopy -x enforce_dependencies=false -s /some/where/thing3.depot \* @ /some/place/directorydepot

In the above example, we copied 3 tape software depots into the same directory depot. Now, this final directory depot contains all 3 tape depots patches/software ready to install. You can even create a single tape depot of this resulting directory depot using swpackage command. So you will have one tape depot which is having all 3 software depots inside!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.