OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [tags/] [release-0.9/] [utils/] [contributions/] [setup/] [cable-install.sh] - Blame information for rev 42

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 41 rfajardo
#!/bin/bash
2
# Xanthopoulos Constantinos
3
# Installing cable drivers for the impact to work
4
# under Debian Squeeze.
5
 
6
 
7
# ===== CONFIGURATIONS =====
8
# ==========================
9
# Webpack installation directory ex. ISE_PATH=/opt/WebPackISE/12.3/
10
# make sure this directory contains ISE_DS
11
 
12
ISE_PATH=""
13
 
14
 
15
# ===== SCRIPT ======
16
# ===================
17
export DEBUG=0;
18
. conxshlib.sh
19
 
20
ISE_PATH=${ISE_PATH}"/ISE_DS/ISE/";
21
 
22
if [ ! -d $ISE_PATH ];
23
then
24
        errormsg "You must set the configuration variable ISE_PATH of this script";
25
fi
26
 
27
if [ `whoami` != "root" ];
28
then
29
        errormsg "You must be root for this script to run.";
30
fi;
31
 
32
execcmd "Installing make" "aptitude install -y make"
33
 
34
execcmd "Add WebPack binaries to PATH" "echo \"PATH=\\\$PATH:${ISE_PATH}/bin/lin/\" >> /etc/bash.bashrc;";
35
 
36
execcmd "Downloading drivers" "wget -O usb-driver-HEAD.tar.gz http://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver?a=snapshot;h=HEAD;sf=tgz ";
37
 
38
execcmd "Move tar to $ISE_PATH" "mv usb-driver-HEAD.tar.gz $ISE_PATH"
39
 
40
cd $ISE_PATH;
41
 
42
execcmd "Un-tar usb drivers" "tar xf usb-driver-HEAD.tar.gz";
43
 
44
execcmd "Removing tar" "rm usb-driver-HEAD.tar.gz"
45
 
46
cd usb-driver
47
 
48
execcmd "Install libusb" "aptitude install -y libusb-dev";
49
 
50
execcmd "Compile usb-driver" "make"
51
 
52
execcmd "Adding the export line to bashrc" "echo \"export LD_PRELOAD=${ISE_PATH}/usb-driver/libusb-driver.so\" >> /etc/bash.bashrc"
53
 
54
cecho "Unplug the cable if it is plugged and press enter"
55
 
56
read nothing;
57
 
58
execcmd "Creating new udev rule" "echo \"ACTION==\\\"add\\\", SUBSYSTEMS==\\\"usb\\\", ATTRS{idVendor}==\\\"03fd\\\", MODE=\\\"666\\\"\" > /etc/udev/rules.d/libusb-driver.rules";
59
 
60
execcmd "Copy udev rules" "cp ${ISE_PATH}/bin/lin/xusbdfwu.rules /etc/udev/rules.d/";
61
 
62
execcmd "Apply patch for Squeeze" "sed -i -e 's/TEMPNODE/tempnode/' -e 's/SYSFS/ATTRS/g' -e 's/BUS/SUBSYSTEMS/' /etc/udev/rules.d/xusbdfwu.rules";
63
 
64
execcmd "Install fxload" "aptitude install -y fxload";
65
 
66
execcmd "Copy .hex files to /usr/share" "cp ${ISE_PATH}/bin/lin/xusb*.hex /usr/share";
67
 
68
execcmd "Restart udev" "/etc/init.d/udev restart";
69
 
70
cecho "Ready!!!"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.