#!/bin/sh
#
# install - install a 8255 driver, or kernel device
#
# Copyright (C) 2003-2007 ³ΒαΤ. All rights reserved.
#

relpath=`dirname $0`
relpath=`(cd $relpath; pwd)`

TARGET="$HOME/cvr"

DEV_NAME="i8255"
MAJOR_DEV="62"

if [ "$1" = -d -o "$1" = -devices -o "$1" = --devices ]
then
    echo Creates eight devices /dev/${DEV_NAME}io\[0-7\].
    for n in 0 1 2 3 4 5 6 7; do
	mknod /dev/${DEV_NAME}io$n c $MAJOR_DEV $n
    done
    exit 1
fi

if [ ! -d $TARGET ]; then
    echo "CManager no found."
    exit 1
fi
[ ! -d $TARGET/lib/modules ] && mkdir $TARGET/lib/modules

cp -f ${DEV_NAME}drv.so $TARGET/lib
cp -f ${DEV_NAME}io.o $TARGET/lib/modules
cp -f 8255_install.html $TARGET/doc
if [ ! -f $TARGET/CManagerLicense.xml ]; then
    cp -f $relpath/license_${DEV_NAME}drv.xml $TARGET/CManagerLicense.xml
else
    echo "$TARGET/CManagerLicense.xml existed."
fi
