forked from jpietari/mrf-linux-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule_load
More file actions
executable file
·62 lines (51 loc) · 2.01 KB
/
module_load
File metadata and controls
executable file
·62 lines (51 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
# sh /home/jpietari/mrf/event/sw/linux-multi/module_load
# sh /home/jpietari/mrf/event/sw/linux-multi/module_unload
# cd /home/jpietari/mrf/event/sw/linux-multi
#make modules_install
#/sbin/depmod -a
udev_rules_file="`dirname "$0"`/60-mrf-pci.rules"
if [ -f "$udev_rules_file" -a ! -e "/etc/udev/rules.d/60-mrf-pci.rules" ]; then
cp "$udev_rules_file" "/etc/udev/rules.d/60-mrf-pci.rules"
fi
/sbin/modprobe pci_mrfevg || exit 1
/sbin/modprobe pci_mrfevr || exit 1
majors=$(awk "\$2==\"mrfevg\" {print \$1}" /proc/devices)
echo "Found" $(echo $majors | wc -w) "Event Generators."
#echo "Creating device nodes..."
#
#device=1
#for major in $majors; do
# dev=$(echo $device | awk '{ printf "%c", 96+ $1}')
# device=$((++device))
# rm -f /dev/eg$dev[0-3]
# echo -n "Creating nodes /dev/eg"$dev"[0-3] for major" $major
# mknod '/dev/eg'$dev'0' c $major 0
# mknod '/dev/eg'$dev'1' c $major 1
# mknod '/dev/eg'$dev'2' c $major 2
# mknod '/dev/eg'$dev'3' c $major 3
# chgrp mrf '/dev/eg'$dev[0-3]
# chmod g+w '/dev/eg'$dev'1'
# chmod g+w '/dev/eg'$dev'3'
#done
majors=$(awk "\$2==\"mrfevr\" {print \$1}" /proc/devices)
echo "Found" $(echo $majors | wc -w) "Event Receivers."
#echo "Creating device nodes..."
#device=1
#for major in $majors; do
# dev=$(echo $device | awk '{ printf "%c", 96+ $1}')
# device=$((++device))
# rm -f /dev/er$dev[0-3]
# echo -n "Creating nodes /dev/er"$dev"[0-3] for major" $major
# mknod '/dev/er'$dev'0' c $major 0
# mknod '/dev/er'$dev'1' c $major 1
# mknod '/dev/er'$dev'2' c $major 2
# mknod '/dev/er'$dev'3' c $major 3
# chgrp mrf '/dev/er'$dev[0-3]
# chmod g+w '/dev/er'$dev'1'
# chmod g+w '/dev/er'$dev'3'
#done
# dd if=/home/jpietari/mrf/event/fw/Evr/opb_pci9030/pxievr230.eep of=/dev/era0
# dd if=/home/jpietari/mrf/event/fw/Evr/opb_pci9030/pxievg230.eep of=/dev/ega0
# dd if=/home/jpietari/mrf/event/fw/Evr/build/cpcievr230/cpcievr230.bit of=/dev/era2
# dd if=/home/jpietari/mrf/event/fw/Evg/build/cpcievg230/cpcievg230.bit of=/dev/ega2