Specifications
Driver Installation and Tuning
14-1
7
When writing a postinstall script, you should make liberal use of echo and
message commands to tell the user what is going on. You should also make sure to exit
with the appropriate return value based on a successful or unsuccessful installation.
Following is an example postinstall script for a driver add-on package.
preremove 14
The following steps should be performed in a preremove script to remove a DSP:
1. Use idcheck to make sure the DSP to be removed exists on the system. If
not, the script should exit and display an error message.
2. Run idinstall -d and pass it the DSP name. This removes the DSP
module from /etc/conf.
NOTE
DSPs should always use the idinstall -P option. This way
all the files installed are recorded in the contents file.
do_install () {
${CONFBIN}/idinstall -P ${pkgname} -a ${1} > ${ERR} 2>&1
RET=$?
if [ ${RET} != 0 ]
then
${CONFBIN}/idinstall -P $pkgname} -u ${1} > ${ERR} 2>&1
RET=$?
fi
if [ ${RET} != 0 ]
then
message “The installation cannot be completed due to an error in \
the driver installation during the installation of the ${1} module \
of the ${NAME}. The file ${ERR} contains the errors.”
exit ${FAILURE}
fi
cp disk.cfg /etc/conf/pack.d/${1}
}
FAILURE=1# fatal error
DRIVER=xyzzy
CONFDIR=/etc/conf
CONFBIN=${CONFDIR}/bin
ERR=/tmp/err.out
for MODULE in ${DRIVER}
do
cd /tmp/${MODULE}
do_install ${MODULE}
done
cat /tmp/loadmods >> /etc/loadmods /* HBA only */
${CONFBIN}/idbuild >/dev/null 2>&1
installf -f $PKGINST
removef ${PKGINST} /tmp/loadmods /tmp/${DRIVER} >/dev/null 2>&1
removef -f ${PKGINST} >/dev/null 2>&1