]> git.zerfleddert.de Git - usb-driver/blame - setup_pcusb
Add setup script for USB cable which works on modern distributions
[usb-driver] / setup_pcusb
CommitLineData
36f8b271
MG
1#!/bin/bash
2
3if [ "${XILINX}" = "" ]; then
4 if [ "${1}" = "" ]; then
5 echo "Syntax: ${0} /path/to/ISE"
6 exit 1
7 fi
8 root="${1}"
9else
10 root="${XILINX}"
11fi
12
13if [ "`id -u`" != "0" ]; then
14 echo "You are not root, trying sudo..."
15 ASROOT="sudo"
16else
17 ASROOT=""
18fi
19
20echo -n "Looking for USB cable files: "
21
22dir=""
23
24for check in "${root}/bin/lin64" "${root}/bin/lin"; do
25 if [ -e "${check}/xusbdfwu.rules" ]; then
26 dir="${check}"
27 break;
28 fi
29done
30
31if [ "${dir}" != "" ]; then
32 echo "${dir}"
33else
34 echo "NOT FOUND!"
35 exit 1
36fi
37
38echo "Copying formware to /usr/share:"
39for fw in "${dir}/"xusb*.hex; do
40 $ASROOT cp -v "${fw}" "/usr/share/"
41done
42
43echo "Installing udev rules:"
44$ASROOT bash -c "sed -e 's/TEMPNODE/tempnode/' -e 's/SYSFS/ATTRS/g' -e 's/BUS/SUBSYSTEMS/' \"${dir}/xusbdfwu.rules\" >/etc/udev/rules.d/xusbdfwu.rules"
45echo "done"
Impressum, Datenschutz