Installing from a multi-platform depot to an alternate root on HP-UX

Some depots from HP (notably the Java packages from http://software.hp.com/) contain filesets for multiple OS versions or even processor architectures. Installing them normally works fine, as the appropriate filesets are automatically selected and the others ignored. However, problems can arise when installing to an alternate root directory. The key is to pull only the filesets you need from the supplied depot and create a custom depot.

For instance, suppose we have a depot with one bundle:

[0]testserver:/var/adm/crash> swlist -d -l bundle -s /var/adm/crash/jdk15_15021_pa.depot
# Initializing...
# Contacting target "testserver"...
#
# Target:  testserver:/var/adm/crash/jdk15_15021_pa.depot
#

  Java15JDK     1.5.0.21.00    Java 1.5 JDK for HP-UX

And that bundle has two products:

[0]testserver:/var/adm/crash> swlist -d -l product -s /var/adm/crash/jdk15_15021_pa.depot
# Initializing...
# Contacting target "testserver"...
#
# Target:  testserver:/var/adm/crash/jdk15_15021_pa.depot
#

  Jdk15         1.5.0.21.00    Java 1.5 JDK
  Jre15         1.5.0.21.00    Java 1.5 JRE

And those products are made up of filesets; some for HP-UX 11.11, some for HP-UX 11.23, and some for HP-UX 11.31:

[0]testserver:/var/adm/crash> swlist -d -a software_spec -l fileset -s /var/adm/crash/jdk15_15021_pa.depot
# Initializing...
# Contacting target "testserver"...
#
# Target:  testserver:/var/adm/crash/jdk15_15021_pa.depot
#

# Jdk15                 Jdk15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP
  Jdk15.JDK15           Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jdk15.JDK15           Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.23_PA
  Jdk15.JDK15           Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.31_PA
  Jdk15.JDK15-COM       Jdk15.JDK15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jdk15.JDK15-DEMO      Jdk15.JDK15-DEMO,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jdk15.JDK15-PA20      Jdk15.JDK15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jdk15.JDK15-PA20W     Jdk15.JDK15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
# Jre15                 Jre15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP
  Jre15.JRE15           Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15           Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.23_PA
  Jre15.JRE15           Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.31_PA
  Jre15.JRE15-COM       Jre15.JRE15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15-COM-DOC   Jre15.JRE15-COM-DOC,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15-PA20      Jre15.JRE15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15-PA20-HS   Jre15.JRE15-PA20-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15-PA20W     Jre15.JRE15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15-PA20W-HS  Jre15.JRE15-PA20W-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64

(hint, check the “fa=” part of the line for the intended OS version. “fa” means fileset architecture.)

We can construct a swcopy command to select and copy only the filesets we need to a new depot. The easiest way I’ve found for the Java depots is to first select the JRE version we need and then the JDK version as such:

[0]testserver:/var/adm/crash> sudo swcopy -p -s /var/adm/crash/jdk15_15021_pa.depot \
Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64 \
Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64 \
@ /var/adm/crash/jdk15_15021_11.11

=======  01/26/11 10:56:33 CST  BEGIN swcopy SESSION (non-interactive)
         (jobid=testserver-0286)

       * Session started for user "root@testserver".

       * Beginning Selection
       * Target connection succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * Source:                 /var/adm/crash/jdk15_15021_pa.depot
       * Targets:                testserver:/var/adm/crash/jdk15_15021_11.11
       * Software selections:
           + Java15JDK,r=1.5.0.21.00,a=HP-UX_B.11.00_32/64,v=HP
             Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-COM-DOC,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20W-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
       * A "+" indicates an automatic selection due to dependency or
         the automatic selection of a patch or reference bundle.
       * Selection succeeded.


       * Beginning Analysis
       * Session selections have been saved in the file
         "/home/kris/.sw/sessions/swcopy.last".
       * The analysis phase succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * Analysis succeeded.


NOTE:    More information may be found in the agent logfile using the
         command "swjob -a log testserver-0286 @
         testserver:/var/adm/crash/jdk15_15021_11.11".

=======  01/26/11 10:56:37 CST  END swcopy SESSION (non-interactive)
         (jobid=testserver-0286)

As we can see, just by specifying those two filesets the rest of the ones needed due to dependencies were automatically selected. We can go ahead and rerun that without the -p (preview) flag to create the new depot that contains only filesets for HP-UX 11.11.

[0]testserver:/var/adm/crash> sudo swcopy -s /var/adm/crash/jdk15_15021_pa.depot \
Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64 \
Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64 \
@ /var/adm/crash/jdk15_15021_11.11

=======  01/26/11 11:06:53 CST  BEGIN swcopy SESSION (non-interactive)
         (jobid=testserver-0288)

       * Session started for user "root@testserver".

       * Beginning Selection
       * Target connection succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * Source:                 /var/adm/crash/jdk15_15021_pa.depot
       * Targets:                testserver:/var/adm/crash/jdk15_15021_11.11
       * Software selections:
           + Java15JDK,r=1.5.0.21.00,a=HP-UX_B.11.00_32/64,v=HP
             Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-COM-DOC,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20W-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
       * A "+" indicates an automatic selection due to dependency or
         the automatic selection of a patch or reference bundle.
       * Selection succeeded.


       * Beginning Analysis and Execution
       * Session selections have been saved in the file
         "/home/kris/.sw/sessions/swcopy.last".
       * The analysis phase succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * The execution phase succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * Analysis and Execution succeeded.


NOTE:    More information may be found in the agent logfile using the
         command "swjob -a log testserver-0288 @
         testserver:/var/adm/crash/jdk15_15021_11.11".

=======  01/26/11 11:07:13 CST  END swcopy SESSION (non-interactive)
         (jobid=testserver-0288)

[0]testserver:/var/adm/crash> swlist -d -l bundle -l product -l fileset -a software_spec -s /var/adm/crash/jdk15_15021_11.11
# Initializing...
# Contacting target "testserver"...
#
# Target:  testserver:/var/adm/crash/jdk15_15021_11.11
#

#
# Bundle(s):
#

# Java15JDK                             Java15JDK,r=1.5.0.21.00,a=HP-UX_B.11.00_32/64,v=HP
# Java15JDK.Jdk15                       Jdk15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP
  Java15JDK.Jdk15.JDK15                 Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jdk15.JDK15-COM             Jdk15.JDK15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jdk15.JDK15-PA20            Jdk15.JDK15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jdk15.JDK15-PA20W           Jdk15.JDK15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
# Java15JDK.Jre15                       Jre15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP
  Java15JDK.Jre15.JRE15                 Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-COM             Jre15.JRE15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-COM-DOC         Jre15.JRE15-COM-DOC,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-PA20            Jre15.JRE15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-PA20-HS         Jre15.JRE15-PA20-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-PA20W           Jre15.JRE15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-PA20W-HS        Jre15.JRE15-PA20W-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64

At this point installing from the new depot to the alternate root directory will work just fine.

[0]testserver:/var/adm/crash> sudo swinstall -x mount_all_filesystems=false \
-s /var/adm/crash/jdk15_15021_11.11 Jdk15 Jre15 \
@ /apps/java/java150/jdk150_21

=======  01/26/11 12:01:20 CST  BEGIN swinstall SESSION
         (non-interactive) (jobid=testserver-0290)

       * Session started for user "root@testserver".

       * Beginning Selection
       * "testserver:/apps/java/java150/jdk150_21":  This target does not
         exist and will be created.
       * Source connection succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * Source:                 /var/adm/crash/jdk15_15021_11.11
       * Targets:                testserver:/apps/java/java150/jdk150_21
       * Software selections:
           + Java15JDK,r=1.5.0.21.00,a=HP-UX_B.11.00_32/64,v=HP
             Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jdk15.JDK15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jdk15.JDK15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jdk15.JDK15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-COM-DOC,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-PA20-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-PA20W-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
       * A "+" indicates an automatic selection due to dependency or
         the automatic selection of a patch or reference bundle.
       * Selection succeeded.


       * Beginning Analysis and Execution
       * Session selections have been saved in the file
         "/home/kris/.sw/sessions/swinstall.last".
       * "testserver:/apps/java/java150/jdk150_21":  There will be no
         attempt to mount filesystems that appear in the filesystem
         table.
WARNING: "testserver:/apps/java/java150/jdk150_21":  1 postinstall or
         postremove scripts had warnings.
       * Analysis and Execution succeeded.


NOTE:    More information may be found in the agent logfile using the
         command "swjob -a log testserver-0290 @
         testserver:/apps/java/java150/jdk150_21".

=======  01/26/11 12:02:21 CST  END swinstall SESSION (non-interactive)
         (jobid=testserver-0290)

[0]testserver:/var/adm/crash> ll /apps/java/java150/jdk150_21
total 0
drwxr-xr-x   4 root       sys             96 Jan 26 12:01 .
drwxr-xr-x   6 root       sys             96 Jan 26 12:00 ..
dr-xr-xr-x   3 bin        bin             96 Jan 26 12:01 opt
drwxr-xr-x   3 root       sys             96 Jan 26 12:00 var

[0]testserver:/var/adm/crash> /apps/java/java150/jdk150_21/opt/java1.5/bin/java -version
java version "1.5.0.21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0.21-_09_nov_2010_08_03)
Java HotSpot(TM) Server VM (build 1.5.0.21 jinteg:11.09.10-10:26 PA2.0 (aCC_AP), mixed mode) 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: