Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Starting Kit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Starting Kit
Commits
98e1e4d9
Commit
98e1e4d9
authored
Dec 17, 2012
by
Benoit Rat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scripts: Add simple scripts to make the use of the starting kit easier
parent
814cc3f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
138 additions
and
0 deletions
+138
-0
wr-modules
scripts/wr-modules
+70
-0
wr-spec-uart
scripts/wr-spec-uart
+68
-0
No files found.
scripts/wr-modules
0 → 100755
View file @
98e1e4d9
#!/bin/bash
###########################################
#
# Ease the way to load and list WR kernel modules.
#
# Copyright (c) 2012, Benoit RAT
# Authors: Benoit RAT <benoit(AT)sevensols.com.
# Licence: GPL v2 or later.
# Website: http://www.sevensols.com
#
###########################################
## Array of kernel modules
modArray[0]
=
"rawrabbit"
modArray[1]
=
"spec"
modArray[2]
=
"wr_nic"
modArray[3]
=
"spec-wr-nic"
modArray[4]
=
"spec-fine-delay"
modArray[5]
=
"fmc-write-eeprom"
modArray[6]
=
"fmc-trivial"
modArray[7]
=
"fmc"
help
()
{
cat
<<
EOF
Usage:
$(
basename
$0
)
<Options>
Options:
-l|--list) list modules
-r|--remove) remove modules
EOF
exit
0
}
list
()
{
lspci |
grep
CERN
for
mod
in
"
${
modArray
[@]
}
"
;
do
lsmod |
grep
${
mod
}
done
}
remove
()
{
for
mod
in
"
${
modArray
[@]
}
"
;
do
lsmod |
grep
${
mod
}
&> /dev/null
if
[
"x
$?
"
=
"x0"
]
;
then
echo
"Removing
${
mod
}
"
sudo
rmmod
${
mod
}
fi
done
}
while
[
$#
-gt
0
]
;
do
# Until you run out of parameters . . .
case
"
$1
"
in
-h
|
--help
)
help
;;
-r
|
--remove
)
remove
;
exit
$?
;;
-l
|
--list
)
list
;
exit
$?
;;
*
)
echo
"Unknown arg
$1
"
;
help
;;
esac
shift
# Check next set of parameters.
done
help
scripts/wr-spec-uart
0 → 100755
View file @
98e1e4d9
#! /bin/bash
# ----------------------------------------------------------------------------
# This program opens uart to connect with spec card.
# Version: 1.0
# Author: Benoit RAT
# Miguel Jimenez Lopez
#
# Note: look at the help() or use --help
# ----------------------------------------------------------------------------
help
()
{
cat
<<
EOF
Usage:
$(
basename
$0
)
<Options> [<#board>]
#board is 1, 2, etc...
Options:
-h|--help) show little help
-p|--physical) Use physical interface (Default)
-v|--virtual) Use virtual UART
-i|--inplace) does not open a new terminal (Only open the first one)
EOF
exit
0
}
while
[
$#
-gt
0
]
;
do
# Until you run out of parameters . . .
case
"
$1
"
in
-h
|
--help
)
help
;;
-p
|
--physical
)
phy
=
1
;;
-v
|
--virtual
)
vir
=
1
;;
-i
|
--inplace
)
inp
=
1
;;
[
1-9]
)
boardnum
=
$1
;;
*
)
echo
"Unknown arg
$1
"
;
help
;;
esac
shift
# Check next set of parameters.
done
## Obtain the terminal to ask
if
[
"x
$vir
"
=
"x1"
]
;
then
res
=
"
$(
lspci |
grep
CERN |
cut
-f1
-d
:
)
"
cmd
=
"sudo /WRProject/Repositorios/spec-sw/tools/spec-vuart -b "
else
res
=
"
$(
ls
/dev/ |
grep
ttyUSB
)
"
cmd
=
"sudo minicom --baudrate=11520 --device=/dev/"
fi
##Select only one board with board num
if
[
-n
$boardnum
]
;
then
res
=
"
$(
echo
"
$res
"
|
sed
-n
${
boardnum
}
p
)
"
fi
##For loop
for
d
in
${
res
}
;
do
sudo echo
"Try to access
$d
(pci spec)"
;
if
[
"x
$inp
"
=
"x1"
]
;
then
${
cmd
}${
d
}
break
;
else
sudo
xterm
-hold
-e
"
${
cmd
}${
d
}
"
&
fi
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment