]> git.zerfleddert.de Git - usb-driver/blame_incremental - setup_pcusb
typo
[usb-driver] / setup_pcusb
... / ...
CommitLineData
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