How to package a SD-UX depot
Sometimes is necesary to create you own SD-UX depots files. This may be needed for example, to provied old versions of software that are not longer available for download, but that may be required on a customer installation. An SD-UX depot is basically a tar file that contains a SD-UX depot filesystem. In this example, a HP-UX 11.0 Fiber ethernet drivers bundle (A4926A). The driver is available on the internal depot server.
1. Check for the remote version of the software component.
# swlist -s swdepot.atl.hp.com:/depot/oscores/11.00/Mar04.ACE A4926A # Initializing... # Contacting target "swdepot.atl.hp.com"... # # Target: swdepot.atl.hp.com:/depot/oscores/11.00/Mar04.ACE # # A4926A B.11.00.22 1000Base-SX PCI Gigabit Ethernet Driver A4926A.GE-DRV B.11.00.22 HP PCI/GSC Gigabit Ethernet Driver
2. Copy the depot to a local directory. The -x enforce_dependecies=false is used to allow copy of software across different HP-UX releases. The -x autoselect_dependencies=false is used to limit copy to the specified components.
# mkdir /depots/A4926A # swcopy -x enforce_dependencies=false -x autoselect_dependencies=false -s \ swdepot.atl.hp.com:/depot/oscores/11.00/Mar04.ACE A4926A @ /depots/A4926A ======= 11/21/07 14:12:17 MST BEGIN swcopy SESSION (non-interactive) (jobid=hostname-0034) * Session started for user "root@hostname". * Beginning Selection * "hostname:/depots/A4926A": This target does not exist and will be created. * Source connection succeeded for "swdepot.atl.hp.com:/depot/oscores/11.00/Mar04.ACE". * Source: swdepot.atl.hp.com:/depot/oscores/11.00/Mar04.ACE * Targets: hostname:/depots/A4926A * Software selections: A4926A,r=B.11.00.22,a=HP-UX_B.11.00_32/64,v=HP GE-DRV.GE-KRN,r=B.11.00.22,a=HP-UX_B.11.00_32/64,v=HP,fr=B.11.00.22,fa=HP-UX_B.11.00_64 GE-DRV.GE-KRN,r=B.11.00.22,a=HP-UX_B.11.00_32/64,v=HP,fr=B.11.00.22,fa=HP-UX_B.11.00_32 GE-DRV.GE-RUN,r=B.11.00.22,a=HP-UX_B.11.00_32/64,v=HP,fr=B.11.00.22,fa=HP-UX_B.11.00_64 GE-DRV.GE-RUN,r=B.11.00.22,a=HP-UX_B.11.00_32/64,v=HP,fr=B.11.00.22,fa=HP-UX_B.11.00_32 * Selection succeeded. * Beginning Analysis and Execution * Session selections have been saved in the file "/.sw/sessions/swcopy.last". * The analysis phase succeeded for "hostname:/depots/A4926A". * The execution phase succeeded for "hostname:/depots/A4926A". * Analysis and Execution succeeded. NOTE: More information may be found in the agent logfile using the command "swjob -a log hostname-0034 @ hostname:/depots/A4926A". ======= 11/21/07 14:12:44 MST END swcopy SESSION (non-interactive) (jobid=hostname-0034)
3. Package the bundle into a depot file.
# swpackage -s /depots/A4926A -x target_type=tape @ /var/tmp/A492A.11.0.22.depot ======= 11/21/07 14:40:07 MST BEGIN swpackage SESSION * Session started for user "root@hostname". * Source: hostname:/depots/A4926A * Target: hostname:/var/tmp/A492A.11.0.22.depot * Software selections: * * Beginning Selection Phase. * Reading the source depot "/depots/A4926A". * Reading the contained files information for each selected product. NOTE: The temporary target depot "/var/tmp/pkgAAA003935" has been created. * Selection Phase succeeded. * Beginning Analysis Phase. * Analysis Phase succeeded. * Beginning Package Phase. * Packaging the bundle "A4926A,r=B.11.00.22,a=HP-UX_B.11.00_32/64,v=HP". * Packaging the product "GE-DRV". * Packaging the fileset "GE-DRV.GE-KRN". * Packaging the fileset "GE-DRV.GE-KRN". * Packaging the fileset "GE-DRV.GE-RUN". * Packaging the fileset "GE-DRV.GE-RUN". * Package Phase succeeded. * Beginning Tapemaker Phase. * Copying the temporary depot to the tape "/var/tmp/A492A.11.0.22.depot". * Calculating the tape blocks required to copy the temporary depot to the tape "/var/tmp/A492A.11.0.22.depot". NOTE: The temporary depot requires 950 Kbytes on the tape "/var/tmp/A492A.11.0.22.depot". * Writing the tape "/var/tmp/A492A.11.0.22.depot" (tape 1 of 1). * Writing the fileset "GE-DRV.GE-KRN" (1 of 4) * Writing the fileset "GE-DRV.GE-KRN" (2 of 4) * Writing the fileset "GE-DRV.GE-RUN" (3 of 4) * Writing the fileset "GE-DRV.GE-RUN" (4 of 4) * Tape #1: CRC-32 checksum & size: 1913857166 972800 * Removing the temporary depot. * Tapemaker Phase succeeded. ======= 11/21/07 14:40:08 MST END swpackage SESSION
4. Verified the status of the depot file.
# # ll /var/tmp/A492A.11.0.22.depot -rw-r--r-- 1 root sys 972800 Nov 21 14:40 /var/tmp/A492A.11.0.22.depot
5. Unregister the copied depot and remove the copied information.
# swreg -u -l depot /depots/A4926A ======= 11/21/07 14:44:15 MST BEGIN swreg SESSION (non-interactive) * Session started for user "root@hostname". * Beginning Selection * Targets: hostname * Objects: /depots/A4926A * Selection succeeded. ======= 11/21/07 14:44:15 MST END swreg SESSION (non-interactive)
# rm -rf /depots/A4926A