]> git.zerfleddert.de Git - usb-driver/blob - setup_pcusb
typo
[usb-driver] / setup_pcusb
1 #!/bin/bash
2
3 if [ "${XILINX}" = "" ]; then
4 if [ "${1}" = "" ]; then
5 echo "Syntax: ${0} /path/to/ISE"
6 exit 1
7 fi
8 root="${1}"
9 else
10 root="${XILINX}"
11 fi
12
13 if [ "`id -u`" != "0" ]; then
14 echo "You are not root, trying sudo..."
15 ASROOT="sudo"
16 else
17 ASROOT=""
18 fi
19
20 echo -n "Looking for USB cable files: "
21
22 dir=""
23
24 for check in "${root}/bin/lin64" "${root}/bin/lin"; do
25 if [ -e "${check}/xusbdfwu.rules" ]; then
26 dir="${check}"
27 break;
28 fi
29 done
30
31 if [ "${dir}" != "" ]; then
32 echo "${dir}"
33 else
34 echo "NOT FOUND!"
35 exit 1
36 fi
37
38 echo "Copying formware to /usr/share:"
39 for fw in "${dir}/"xusb*.hex; do
40 $ASROOT cp -v "${fw}" "/usr/share/"
41 done
42
43 echo "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"
45 echo "done"
Impressum, Datenschutz