Specifications
D
evice Driver Programming
14-18
3. Invoke idbuild without any options to cause the kernel to be rebuilt
when the system is rebooted.
Following is an example preremove script for a driver add-on package.
Installing a Package 14
A user installing a package containing a DSP usually finds the process very simple. From
the user perspective, a typical installation proceeds as follows:
1. The user searches for tape1 in the /etc/device.tab file. If it is miss-
ing, the user defines tape1 in the device database. See putdev(1M) for
information about how to add a device entry to the device database.
2. The user runs the pkgadd command with the -d device option, where
device specifies the tape drive from which the package is to be installed; for
example, device could be tape1.
3. A prompt asks the user to insert the tape in the drive.
4. A second prompt displays, asking the user which package is to be installed
or whether to install all packages on the installation media.
5. The package is installed, a process which can take several minutes or
longer, depending on the package. This process usually does not require
any user intervention.
6. A message is displayed signaling success or failure of the installation.
7. A prompt asks the user whether another package is to be installed. If so,
this process is repeated.
8. When all desired packages have been installed, a message is displayed, tell-
ing the user to reboot the system to complete the installation process.
CONFDIR=/etc/conf
CONFBIN=${CONFDIR}/bin
DRIVER=xyzzy
for MODULE in ${DRIVER}
do
${CONFBIN}/idcheck -p ${MODULE}
RES=“$?“
if
[ “${RES}“ -ne “100” -a “${RES}“ -ne “0” ]
then
${CONFBIN}/idinstall -P ${pkgname} -d ${MODULE} 2>> /tmp/${MODULE}.err
fi
done
${CONFBIN}/idbuild >/dev/null 2>&1
exit 0