HP9000 非常宝典
HP Confidential - 19 -
路径下并执行即可。例如将当前目录下的所有补丁打包成 Bundle-OBII,描述为
Patches for OBII,可以执行:
#./create_depot.11 –b Bundle-OBII –t “Patches for OBII”
#! /bin/ksh
#
# create_depot.11
#
# modified from ITRC shell by Chen Peng
#
# Copy patches into a depot and bundle them.
#
function Usage
{
echo "Usage: create_depot [-h] [-i] [ -u] [-f]"
echo " [-b <bundle_tag>]"
echo " [-t <bundle_title>]"
echo "where,"
echo " -h = help display "
echo " -i = run in interactive mode"
echo " -u = do not unshar patch files, use existing depots"
echo " -f = write to d epot eve n if it a lready ex ists"
exit
}
#
# List of patches
#
OS="11.00"
#
# Default values
#
typeset -i INTERACTIVE=0
type set -i SKIP _DEPOT =0
UNSHAR=y
DEPOT=$PWD /depot
BUNDLE=BUNDLE
TITLE="Patch Bundle"
#
# Temporary values
#
PID=$$
#PSF=depot$PID.psf
PSF=depot.psf
#
# Upon exit...
#
#trap 'rm -f $PSF; exit' 0 1 2 15
while getopts b:t:hufi OPTION; do
{
case $OPTIO N in
b)
BUNDLE=$OPTARG
;;
t)
TITLE=$OPTARG
;;
h)
Usage
;;
u)
UNSHAR=n
;;
f)
SKIP_DEPOT=1
;;
i)
INTERACTIVE=1
;;
\?)
echo "ERROR: unknown option ($OPTION)"
Usage
;;
esac
}
done
#
# NOTE: Check all the options here a nd see if there are any problems.
#
if [ $INTERACTIVE -eq 1 ]; then
{
echo "Depot name [$DEPOT]: \c"
read ANSWER
if [ -n "$ANSWER" ]; then
{
DEPOT=$ANSWER
}
fi
echo "Bundle name [$BUNDLE]: \c"
read ANSWER
if [ -n "$ANSWER" ]; then
{
BUNDLE=$ANSWER
}
fi
echo "Bund le title [$TIT LE]: \c"
read ANSWER
if [ -n "$ANSWER" ]; then
{
TITLE=$ANSWER
}
fi
echo "Unshar patch files ([$UNSHAR]/n): \c"
read ANSWER
if [ -n "$ANSWER" ]; then
{
UNSHAR=$ANSWE R
}
fi
}
fi
#e ch o "D EP O T: $DE P OT "
echo "BUNDLE: $BUNDLE"
echo "TITLE: $TITLE"
echo "UNSHAR: $UNSHAR"
echo "PSF: $PSF"
type set -i ERRO RS=0
#
# Check for existence of depot
#
if [ -d "$DEPOT" ]; then
{
if [ $SKIP_DEPOT -eq 0 ]; then
echo "ERROR: Depot already exists: ${DEPOT}."
echo " Use -f option to override or delete depot."
exit 1
else
echo "NOTE: Using existing depot."
fi
}
fi
#
# Unshar a ll the patc h file s.
#
if [ "$UNSHA R" = "y" ] ; then
{
echo "Expanding patch shar files..."
for PATC H in . /PH ??_ ?? ???; do
{
if [ ! -f $PATCH ]; then
echo "ERROR: Shar file not found for patch $PATCH. "
ERRORS=1
else
rm -f ${PA TCH}.text ${PATCH}.depot
/bin/sh ${PATCH}
if [ $? -ne 0 ]; then
{
echo "ERROR: Could not unshar ${PATCH}"
ERRORS=1
}
fi
fi
}
done
}
fi
> $PSF
if [ $ERRORS -eq 1 ]; then
echo "Errors were found. Depot was not created."
fi
ERRORS=0
echo "#" >> $PSF
echo "# Temporary product specification file" >> $PSF
echo "#" >> $PSF
echo "# Bundle: $BUNDLE" >> $PSF
echo "# Title: $TITLE" >> $PSF
echo "# Created: `date`" >> $PSF
echo "#" >> $PSF
echo "vendor" >> $PSF
echo " tag HP" >> $PSF
echo " title Hewlett-Packard Company" >> $PSF
echo " description Software Patches from H ewlett-Packard" >> $PSF
echo "end" >> $PSF
echo "bundle" >> $PSF
echo " tag $BUNDLE" >> $PSF
echo " title $TITLE" >> $PSF
echo " description Custom Patch Bundle" >> $PSF
echo " vendor_tag HP" >> $PSF
echo " revision B.11.00" >> $PSF
echo " architecture HP-UX_B.11.00_32/64" >> $PSF
echo " machine_type *" >> $PSF
echo " os_name HP-UX" >> $PSF
echo " os_release B.11.00" >> $PSF
echo " os_version *" >> $PSF
echo " is_reference TRUE" >> $PSF
echo " copyright (c)Copyright 1983-2000 Hewlett-Pac kard Co., All Rights Reserved" >> $PSF
for PATCH in PH??_?????; do
{
SPEC=`swlist -l product -a software_spec -s $PWD/${P ATCH}.depot \
| grep -v "^#" | awk '{print }' -`
SPEC=${SPEC#*,}
echo " contents $PATCH,$SPEC" >> $PSF
}
done
echo "end" >> $PSF
for PATCH in PH??_?????; do
{
echo "Copying $PATCH into depot $DEPOT"
swcopy -x enforce_dependencies=FALSE \
-x mount_all_filesystems=FALSE \
-x reinstall=TRUE \
-x layout_version=1.0 \
-d -s $PWD/$PAT CH.depot \* @ $DEPOT
if [ $? -ne 0 ]; then
{
echo "ERROR: Could not swcopy $PATCH i nto depot."
ERROR=1
}
fi
}
done
echo "Bundling patches in depot"
swpackage -s $PSF @ $DEPOT
if [ $? -ne 0 ]; then
{
echo "ERROR: Could not swpackage ${PSF} int o depot."
ERROR=1
}
fi
echo "Verifying the depot."
swverify -d \* @ $DEPOT
if [ $? -ne 0 ]; then
{
echo "ERROR: swverify of depot failed."
ERROR=1
}
fi
if [ $ERRORS -eq 1 ]; then
echo "ERROR: Errors were found while building depot."
fi
脚本很长,如果有需要,可以到 asogz3.china.hp.com:/home3/chenpeng/patch 下载。
在这里用最小的字体列出来,可以用 C/P 大法拷贝到记事本里保存。
补丁光盘
# mount /dev/dsk/c3t2d0 /cdrom
# swinstall -x patch_match_target=true -x autoreboot=true
-s /cdrom/GOLDQPK11i
验证补丁的安装
和其他软件的安装一样,补丁的安装被记录在几个日志文件中以便查询。
/var/adm/sw/swinstall.log
/var/adm/sw/swagent.log
/var/adm/sw/swagentd.log
标准补丁包-Support Plus
HP-UX Support Plus是一个新的产品,专门用于提高软件更新和增强的可用
性。它取代了扩展软件和独立产品发布(IPR)产品。HP-UX Support Plus包含诊断工
具和经过测试的General Release、Quality Pack和Hardware Enablement补丁套件。