getyn()
{
while echo "$* (y/n)? \c" >&2
do
read yn rest
case $yn in
[yY]) return 0;;
[nN]) return 1;;
*) echo "Please answer y or n" >&2;;
esac
done
}
if [ ! -f /etc/conf/pack.d/wd/Driver.OLD ]
then
cp /etc/conf/pack.d/wd/Driver.o /etc/conf/pack.d/wd/Driver.OLD
cp /etc/conf/pack.d/wd0/Driver.o /etc/conf/pack.d/wd0/Driver.OLD
cp /etc/conf/pack.d/wd1/Driver.o /etc/conf/pack.d/wd1/Driver.OLD
fi
cp wd.o /etc/conf/pack.d/wd/Driver.o
cp wd0.o /etc/conf/pack.d/wd0/Driver.o
cp wd1.o /etc/conf/pack.d/wd1/Driver.o
cp space.c.wd /etc/conf/pack.d/wd/space.c
cp um8672 /usr/lib/mkdev
cp umioctl /usr/lib/mkdev
dir=`pwd`
cd /etc/conf/cf.d
maj=`./configure -j NEXTMAJOR`
./configure -a uminit umopen umclose umioctl -c -m $maj
mknod /dev/umdev c $maj 0
cd $dir
if [ ! -d /etc/conf/pack.d/um ]
then mkdir /etc/conf/pack.d/um
fi
if [ ! -d /etc/conf/pack.d/um ]
then echo "Can't make directory /etc/conf/pack.d/um"
exit
fi
cp um.o /etc/conf/pack.d/um/Driver.o
cp space.c.um /etc/conf/pack.d/um/space.c
if getyn "\n\
A new kernel must be built and rebooted. \n\
Would you like to relink at this time?"
then
( cd /etc/conf/cf.d; ./link_unix )
else
echo "\n\
You must build a new kernel for the driver."
fi
echo "\n\
****************\n\
* Notice *\n\
****************\n\
After the system is rebooted with the new kernel,\n\
invoke >>> mkdev um8672 <<< to specify the UM8672 timing setting utility.\n"
exit $?