IMPORTANT:
    Due to a bug in older versions of fastpatch (2.7 - 2.13), it would
    not correctly backout new-style patches when this happened as part
    of a multiple patch installation, the PATCHLIST= information could
    get lost as fastpatch didn't update its internal patchlist
    information.  This can later lead to partial backouts and corrupted
    systems, however, since fastpatch only usually does this when
    installing new patches, the problem won't usually lead to
    instable/unbootable systems, as newer versions will overwite the
    previous installed patches.

    THIS ONLY HAPPENS ON SYSTEMS WHERE PATCHES ARE INSTALLED SO THEY
    CAN BE BACKED OUT.  This is atypical fastpatch usage.
    I found this bug myself as I do use "fastpatch -s" a lot

    To work around this problem, and still have the PATCHLIST= behave
    as intended, I have implemented a workaround in fastpatch.
    When fastpatch detects the situation, it will print a message saying:

	Old fastpatch dropped <patchid> from SUNWxxx (fixed)

    In a departure from in previous releases, fastpatch no longer looks in /tmp
    and /var/tmp for patches to install.  This was a potential security
    problem.  Use "fastpatch -p /tmp -p /var/tmp ..." if you want the
    old behaviour back.

The fastpatch script is an experimental script written out
of frustration of the lack of speed of installpatch.

fastpatch has brought our patch installation times at the initial
install of Solaris 2.x (this case 2.3 w/ 27 patches) back from
(75 minutes to 25 minutes (12 minutes of which is not used for
the installation of patches).

Typical invocation of fastpatch is:

	fastpatch -p /dir/with/patch patch-id ...

e.g.,

	fastpatch -p 2.5.1_Recommended `cat 2.5.1_Recommended/patch_order`

Options:
	-d 	debug (show what it would do).
	-r	remove outdated patchdata that existed before the
		current patches are installed from the system.
	-R dir  Use dir as root directory
	-C	Use chroot to implement -R
	-c	Don't use chroot to implement -R (default)
	-D dir	Use patch info from dir (directory *must* end in valid
		patchid), used to obsolete old patches before new ones
		are installed.
		NOTE: this will NOT install a patch.
	-p dir	Look for patch.tar.Z files or unpacked patches in dir.
	-o	Don't install patches, only remove obsoleted patches.
	-i	Install patches w/ installpatch.
	-s	Save old files (works only on new patches or when you specify
		-i)
	-I	Ignore backoutpatch failures.
	-b	Don't use backoutpatch when applicable, but fastpatch will
		still backout patches if it can do it by itself)
	-B	Don't use fastpatch's internal backout mechanism
	-n	Never call installpatch
	-O	Remove patch data from patches listed on the command line;
		This option can be used to down grade a patch revisions:

			fastpatch -obO 103640-12
		    and then add an older revision:
			fastpatch 103640-09

		or backout a patch:

		fastpatch -O 103640-12

Fastpatch is a outgrowth of rm-patchdata and can do much more.
The remainder of the rm-patchdata functionality will be added
to fastpatch in future.

What can fastpatch do for you?

	- install patches 5-10 times faster than install patch can.
	- find which patches are obsolete and can be removed.
	- optionally use backoutpatch/installpatch.

Fastpatch attempts to emulate parts of installpatch but not emulates all
of them:

    Emulates:
	+ won't install obsolete patches
	+ won't install patches with mismatched versions/kernel archs
	+ won't patch packages that aren't installed on the system
	+ installs /var/sadm/patch/<patch-id>/README.<patch-id>
	+ installs the /var/sadm/pkg/* files (side effect of using pkgadd)
	+ patches client kvm architectures in /export/exec/kvm*
	+ fails when required patches haven't been installed

    Doesn't emulate:
	- patching clients on servers
	- saving files for later backoutpatch
	- check file integrity before install
	- post/pre patch script (does the package post/preinstall scripts
	  though)
	- doesn't fail on incompatible patches.

How does fastpatch work?

Fastpatch has a number op phases:

First fastpatch will scan /var/sadm/pkg for info about packages installed
and it will note the versions, architecture, patchids etc associated with
the packages.  It will the compute the obsoleteness of packages and
print it (with -r it will remove these packages).  After this
phase, it will scan the pkg files of each patch and will again note
which old patches have been obsoleted and this time it will
remove the old packages. [[ Some pkginfo files are badly constructed and
would cause packages to be removed, e.g., the SunPRO patches are often
offenders because they have wrong OBSOLETE fields and broken patchid
field ]]

It will select the packages applicable to the system and add the
packages with pkgadd.

When fastpatch backs out patches installed the new way, you will
get messages of the form:

	This appears to be an attempt to install the same architecture
	and version of a package which is already installed.  This
	installation will attempt to overwrite this package.

This is normal.


Occasionally, you see a message like this when a patch is uninstalled:

WARNING: /usr/ccs/bin/strip <no longer a linked file>

This is an error in the backoutpatch procedure and is not a problem
with fastpatch.

The latest version of fastpatch works around a bug in pkgadd that would
report preposterous usage requirements:

WARNING:
    The / filesystem has 270564 free blocks. The current installation
    requires 278242927 blocks, which includes a required 150 block
    buffer for open deleted files. 277972363 more blocks are needed.
WARNING:
    The / filesystem has 824045 free file nodes. The current
    installation requires 278242805 file nodes, which includes a
    required 25 file node buffer for temporary files. 277418760 more
    file nodes are needed.

Instead, you'll now get a message saying:

/var/sadm/pkg/SUNWpkg/install/space: 1 empty line(s) ignored

Thanks to Fischer Jens <jefi@kat.ina.de> for pointing out this problem
and the fact that installpatch works around this problem too.

Some people didn't pay close attention to fastpatch output, so it's
now fixed to complain loudly and abort if a patch is only partially installed.


Send bug reports to Casper.Dik@Holland.Sun.COM

Casper
