Operating System - HP-UX
1833760 Members
2601 Online
110063 Solutions
New Discussion

Re: Creating a patch bundle?

 
SOLVED
Go to solution
Fedon Kadifeli
Super Advisor

Creating a patch bundle?

Assume that I have 2 or more patches downloaded from HP's site to the local system's disk. Installation of each of these patches requires reboot of the system. I want to minimize system down time, so I would like to create a "bundle" from these patches (on disk), so that I can install all of them in a single step and reboot the system once. How can I create such a bundle?
6 REPLIES 6
Andy Monks
Honored Contributor
Solution

Re: Creating a patch bundle?

You don't need to put them in a bundle, just into a depot.

So you could do :-

swcopy -s * @ /var/spool/sw

Then just repeat that for each .depot file you have.

You don't have to use /var/spool/sw obviously, but it will already exist (although there may be some stuff in there already, so you may want to choose another directory).

If you choose another directory and you require another machine to be able to access it, you'll have to register it with :-

swreg -l depot /var/spool/sw (or whatever your depot is called).


Then you can installed the patches with in one go.
Fedon Kadifeli
Super Advisor

Re: Creating a patch bundle?

Thank you for your reply. I guess the command should be something like:

swcopy -s /PHNE_21433.depot * @ /var/spool/sw

Note the "" before "*". After the swinstall'ation, can I simply delete the directories under /var/spool/sw ? For example:

rm /var/spool/sw/PH*

Or is there another command?
Andy Monks
Honored Contributor

Re: Creating a patch bundle?

Hi Feldon,

I think this thing removed a character!

The command should be :-

swcopy -s /PHNE_21433.depot * @ /var/spool/sw

or

swcopy -s /PHNE_21433.depot * @ /var/spool/sw

or

swcopy -s /PHNE_21433.depot PHNE_21433 @ /var/spool/sw

whichever you find better to use.

As for removing stuff, you can use :-

swlist -l product -s /var/spool/sw

to see what's there, and then

swremove -d @ /var/spool/sw


You might be better just creating a directory somewhere and using that however.

Andy

Re: Creating a patch bundle?

Hi Fedon,

I find that putting patches into a bundle helps me separate and better manage patches. Creating bundles also allows me add specific configurations to an Ignite-UX installation, (i.e.),I can selectively add the patch bundle to specific machines. To create a bundle do the following:

1) Creat a Patche Depot: Download your specific patches to a /tmp/todaysPatch directory.

2) Unshar the pathces by issuing the following command;
# for i in /tmp/todaysPatch/*
do
sh $i
done

3) Combine all the PH??.depot(s) into one depot:
# mkdir /var/opt/ignite/Patches
# for i in /tmp/todaysPatch/*
do
swcopy -s ${PWD}/$i * @ /var/opt/ignite/Patches
done

4) Verify the contents of the depot by issuing the following command:
# swlist -d @ /var/opt/ignite/Patches

5) Convert the individual patches into a single bundle using the Ignite-UX "make_bundles" command:
# make_bundles -B -n TodaysPatches -t "The latest and greates HP-UX 10.20 Patches" /var/opt/ignite/Patches

Where -n is the name you want to assign to your bundle and -t is the description that will be displayed when you run "swlist -l bundle"

6) Verify the bundle was created by issuing the following command;
# swlist -d @ /var/opt/ignite/Patches

I hope this helps,
Bernie
"Today is a good day"
Tom Danzig
Honored Contributor

Re: Creating a patch bundle?

Put all your patches into a directory and run this script. It'll make a depot for you and add all the patched to it (hope it posts OK):

#!/usr/bin/csh

#
# multipatch - Prepares multiple patches in a depot.
#

if(`whoami` != "root") then
echo "You must be root to run this script"
exit 1
endif

@ count = 0

foreach patch ($*)
if(! -f $patch) then
echo "ERROR: $patch not found. Aborting"
#!/usr/bin/csh
#
# multipatch - Prepares multiple patches in a depot.
#
if(`whoami` != "root") then
echo "You must be root to run this script"
exit 1
endif

@ count = 0

foreach patch ($*)
if(! -f $patch) then
echo "ERROR: $patch not found. Aborting"
exit 1
endif
end

if(-d /tmp/patch_depot) then
echo -n "/tmp/patch_depot exists. OK to remove? [yN] - "
set choice = $<
if($choice != "y") exit
endif

/bin/rm -rf /tmp/patch_depot
if($status != 0) then
echo "Can't delete /tmp/patch_depot. Aborting."
exit 1
endif

mkdir /tmp/patch_depot

foreach patch ($*)
sh $patch
if($status != 0) then
echo "Error unarchiving patch ${patch}. Aborting."
exit 1
endif
swcopy -v -s ${cwd}/${patch}.depot $patch @ /tmp/patch_depot
if($status != 0) then
echo "Error running swcopy for patch ${patch}. Aborting."
exit 1
endif
@ count++
end

if($count == 0) then
echo "No files processed. Aborting."
exit 1
endif

swreg -l depot /tmp/patch_depot

echo ""
echo "`basename $0` completed successfully."
echo ""

exit 0

Tom Danzig
Honored Contributor

Re: Creating a patch bundle?

Oops. Bad paste in firts response:

#!/usr/bin/csh
#
# multipatch - Prepares multiple patches in a depot.
#
if(`whoami` != "root") then
echo "You must be root to run this script"
exit 1
endif

@ count = 0

foreach patch ($*)
if(! -f $patch) then
echo "ERROR: $patch not found. Aborting"
exit 1
endif
end

if(-d /tmp/patch_depot) then
echo -n "/tmp/patch_depot exists. OK to remove? [yN] - "
set choice = $<
if($choice != "y") exit
endif

/bin/rm -rf /tmp/patch_depot
if($status != 0) then
echo "Can't delete /tmp/patch_depot. Aborting."
exit 1
endif

mkdir /tmp/patch_depot

foreach patch ($*)
sh $patch
if($status != 0) then
echo "Error unarchiving patch ${patch}. Aborting."
exit 1
endif
swcopy -v -s ${cwd}/${patch}.depot $patch @ /tmp/patch_depot
if($status != 0) then
echo "Error running swcopy for patch ${patch}. Aborting."
exit 1
endif
@ count++
end

if($count == 0) then
echo "No files processed. Aborting."
exit 1
endif

swreg -l depot /tmp/patch_depot

echo ""
echo "`basename $0` completed successfully."
echo ""

exit 0