Approach

The request script determines where the administrator wants the driver
objects to be installed, by questioning the administrator and assigning the
answer to the $KERNDIR parameter.

The script
ends with a routine to make the two parameters CLASSES and KERNDIR available to the installation environment and the postinstall script.

Create a postinstall script.

The postinstall script actually performs the driver installation. It
is executed after the two files buffer and buffer.conf have been installed. The postinstall file
shown for this example performs the following actions:

Uses the add_drv command to load the driver
into the system.

Creates a link for the device using the installf command.

Finalizes the installation using the installf -f command.

Creates a preremove script.

The preremove script uses the rem_drv command to
unload the driver from the system, and then removes the link /dev/buffer0.