
To enable support for USB the device needs to have the right permissions. Either all
users can have access to the device, or access can be restricted to a group. Follow 
the steps below depending on the kernel version.


Linux 2.4 - Hotplug

    If hotplug is installed (it usually is in recent Linux distributions) it can be used 
    to set the permissions when the device is plugged in. The paths below can vary 
    dependingon the Linux distribution.
    
    Open the file
    
    /etc/hotplug/usb.usermap
    and add the line
    
    grusb 0x0003 0x1781 0x0aa0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
    
    Then create the file
    
    /etc/hotplug/usb/grusb
    This is a script that will be run when the USB interface is connected. Add the 
    following to give all users access to the device.
    
    #!/bin/bash
    
    if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
    then
            chown root "${DEVICE}"
            chmod 666 "${DEVICE}"
    fi
    
    To restrict access to members of a special group, e.g. usb, change to this
    
    #!/bin/bash
    
    if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
    then
            chown root "${DEVICE}"
            chgrp usb "${DEVICE]"
            chmod 660 "${DEVICE}"
    fi
    
    The script needs to have exec permission.
    
    chmod 755 /etc/hotplug/usb/grusb
    Restart hotplug with
    
    /etc/rc.d/rc.hotplug restart
    or reboot to have the changes take effect



Linux 2.4 - without Hotplug

    If hotplug is not available the simplest solution is to change permissions for all 
    usbdevices, by changing the options for usbdevfs.
    
    Open the file
    
    /etc/fstab
    and find the line similiar to below
    
    none	/proc/bus/usb/	usbdevfs	defaults	0 0
    Change it to look like below
    
    none	/proc/bus/usb/	usbdevfs  devmode=0666,busmode=0777,listmode=0666,
                     busuid=0,devuid=0,listuid=0,busgid=100,listgid=100,devgid=100 0 0
    
    This will give all users access to USB devices. To restrict access to a group change 
    the options to this
    
    devmode=0660,busmode=0770,listmode=0660,busuid=0,devuid=0,listuid=0,busgid=XXX,
    listgid=XXX,devgid=XXX
    
    Where XXX is the id of the desired group (look in /etc/group). This will give access 
    only to members of that group.
    
    Reboot to have the changes take effect.



Linux 2.6 - udev

    The 2.6 kernel uses a new system called udev. Before connecting the device, follow 
    the instructions below to create the rules that will set the right permissions for 
    the device. The paths below can vary depending on the Linux distribution.
    
    Open
    
    /etc/udev/rules.d/50-udev.rules
    
    and add the following line
    
    BUS=="usb", SYSFS{idVendor}=="xxxx", SYSFS{idProduct}=="xxxx", MODE="0666"
    
    This will give all users access to the device. Access can also be restricted to a 
    group, e.g. usb, with 
    
    BUS=="usb", SYSFS{idVendor}=="xxxx", SYSFS{idProduct}=="xxxx", GROUP="usb"
    
    Reread all the rules with
    
    udevcontrol reload_rules
    
    
    Note: for example
    
    Rockey2 device , add the following line
    
    BUS=="usb", SYSFS{idVendor}=="096e", SYSFS{idProduct}=="0201", MODE="0666"
    
    Rockey4ND device , add the following line
    
    BUS=="usb", SYSFS{idVendor}=="096e", SYSFS{idProduct}=="0006", MODE="0666"
