Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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 Switch - Software
Commits
5409bf4a
Commit
5409bf4a
authored
Jul 26, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fede-review' into v3-rc2
parents
fc50e177
14254b30
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
48 deletions
+47
-48
.gitmodules
.gitmodules
+1
-1
flash-wrs
build/flash-wrs
+16
-30
wrs_build-all
build/wrs_build-all
+13
-11
wrs-build.in
doc/wrs-build.in
+17
-6
No files found.
.gitmodules
View file @
5409bf4a
[submodule "userspace/ptp-noposix"]
path = userspace/ptp-noposix
url = git://
gnudd.com
/ptp-noposix.git
url = git://
ohwr.org/white-rabbit/ppsi
/ptp-noposix.git
[submodule "userspace/mini-rpc"]
path = userspace/mini-rpc
url = git://github.com/a-rubini/mini-rpc.git
build/flash-wrs
View file @
5409bf4a
...
...
@@ -27,7 +27,7 @@ showhelp()
printf
" -e
\t\t
Completely erase the memory (Can erase your configuration)
\n
"
printf
" -b|--build
\t
Use file that you have build in the WRS_OUTPUT_DIR
\n
"
printf
" --test
\t
Use file for testing the switch (not available)
\n
"
printf
" --s
kip
\t
Don't ask MAC or S/N and use default 02:0B:AD:C0:FF:EE
\n\n
"
printf
" --s
ilent
\t
Don't ask MAC or S/N and use default 02:0B:AD:C0:FF:EE
\n\n
"
exit
0
}
...
...
@@ -36,10 +36,10 @@ checkExit()
{
err
=
0
;
if
[
$1
]
;
then
if
[
-f
$1
]
;
then
return
0
;
else
echo
"Can't find
$1
"
>
& 2
;
if
[
-f
$1
]
;
then
return
0
;
else
echo
"Can't find
$1
"
>
& 2
;
fi
else
echo
"varname not set"
...
...
@@ -62,28 +62,14 @@ modifyMAC()
new
=
$2
cp
$origin
$new
# check & change mac address
X
=
"[0-9a-fA-F][0-9a-fA-F]"
while
true
;
do
if
echo
$MAC
|
grep
"^
${
X
}
:
${
X
}
:
${
X
}
:
${
X
}
:
${
X
}
:
${
X
}
\$
"
>
/dev/null
;
then
sed
-i
"s/02:0B:AD:C0:FF:EE/
$MAC
/"
$new
echo
"MAC is now:
$MAC
"
return
0
else
if
[
"x
$MAC
"
!=
"x"
]
;
then
echo
"
$0
: Invalid MAC address
\"
$MAC
\"
"
>
&2
;
fi
if
[
$skip
]
;
then
return
1
;
fi
read
-p
"Enter MAC (XX:XX:XX:XX:XX:XX) or press S (Skip): "
MAC
if
(
[
"x
$MAC
"
=
"xS"
]
||
[
"x
$MAC
"
=
"xs"
]
)
;
then
MAC
=
""
return
1
;
fi
fi
done
# MAC address doesn't need any modification
if
[
$silent
]
;
then
return
1
;
fi
# Modify MAC address
sed
-i
"s/02:0B:AD:C0:FF:EE/
$MAC
/"
$new
echo
"MAC is now:
$MAC
"
return
0
}
# Go to the top directory
...
...
@@ -136,12 +122,12 @@ while [ $# -ge 1 ]; do
fi
memmode
=
"
$2
"
shift
;
shift
;;
--s
kip
)
--s
ilent
)
# set default the MAC address if user didn't set a MAC address
if
[
"x
$MAC
"
=
"x"
]
;
then
MAC
=
"02:0B:AD:C0:FF:EE"
fi
s
kip
=
1
;
s
ilent
=
1
;
shift
;;
/
*
)
DEV
=
"-s
$1
"
;
shift
;;
*
:
*
)
MAC
=
"
$1
"
;
shift
;;
...
...
@@ -169,7 +155,7 @@ if [ "x$memmode" = "xdf" ]; then
df
=
1
elif
[
"x
$memmode
"
=
"xnf"
]
;
then
nf
=
1
elif
[
"x
$memmode
"
=
"x
test
"
]
;
then
elif
[
"x
$memmode
"
=
"x
ddr
"
]
;
then
test
=
1
else
df
=
1
...
...
build/wrs_build-all
View file @
5409bf4a
...
...
@@ -4,11 +4,7 @@
# Base dir is forcibly the dirname of this script, as an absolute pathname
dir
=
$(
dirname
$0
)
if
echo
$dir
|
grep
-q
'^/'
;
then
WRS_BASE_DIR
=
"
$dir
"
;
else
WRS_BASE_DIR
=
"
$(
echo
$(
/bin/pwd
)
/
$dir
|
sed
's-/.$--'
)
"
;
fi
WRS_BASE_DIR
=
$(
cd
$dir
&&
/bin/pwd
)
export
WRS_BASE_DIR
.
${
WRS_BASE_DIR
}
/scripts/wrs_functions
...
...
@@ -18,20 +14,26 @@ export WRS_BASE_DIR
wrs_setenv_default WRS_OUTPUT_DIR
$(
/bin/pwd
)
wrs_setenv_default WRS_DOWNLOAD_DIR
${
WRS_OUTPUT_DIR
}
/downloads
# Refuse to build within the directory itself
if
[
"
$WRS_OUTPUT_DIR
"
=
"
$WRS_BASE_DIR
"
]
;
then
wrs_die
"Please run
$(
basename
$0
)
from a different directory"
# Allow only absolute path for WRS_OUTPUT_DIR and WRS_DOWNLOAD_DIR
if
[
"
${
WRS_OUTPUT_DIR
:0:1
}
"
!=
"/"
]
;
then
wrs_die
"Invalid WRS_OUTPUT_DIR, only absolute paths are allowed"
fi
if
[
"
${
WRS_DOWNLOAD_DIR
:0:1
}
"
!=
"/"
]
;
then
wrs_die
"Invalid WRS_DOWNLOAD_DIR, only absolute paths are allowed"
fi
#project is WRS_BASE_DIR path without build directory at the end
project
=
${
WRS_BASE_DIR
:0:
(
${#
WRS_BASE_DIR
}
-6)
}
# Refuse to build within the wr-switch-sw directory
if
echo
$WRS_
BASE_DIR
|
grep
"^
$WRS_OUTPUT_DIR
/./build
\$
"
>
/dev/null
;
then
wrs_die
"Please run
$(
basename
$0
)
from a different directory"
if
echo
$WRS_
OUTPUT_DIR
|
grep
"^
$project
.*
\$
"
>
/dev/null
;
then
wrs_die
"Please run
$(
basename
$0
)
from a different directory
outside the wr-switch-sw project
"
fi
# Check the tools
WRS_TOOLS
=
"curl svn git gcc g++ ar as m4 libtool gettext md5sum make"
WRS_TOOLS
=
"
$WRS_TOOLS
awk unzip patch bison flex ncursesw5-config"
WRS_TOOLS
=
"
$WRS_TOOLS
lua fakeroot gettext"
WRS_TOOLS
=
"
$WRS_TOOLS
lua fakeroot gettext
mkfs.jffs2 makeinfo
"
wrs_check_tools
$WRS_TOOLS
...
...
doc/wrs-build.in
View file @
5409bf4a
...
...
@@ -194,18 +194,20 @@ have a similar prefix for the same reason).
@table @code
@item WRS_BASE_DIR
The pathname of the build directory (i.e., the @code{build/}
The
absolute
pathname of the build directory (i.e., the @code{build/}
subdirectory of @code{wr-switch-sw}).
The variable is internally set to the directory
name of the main script. Note that the script cannot
be run from the same directory (i.e.: @code{./wrs_build-all}
is not allowed), you must call it from your output directory
be run from the same directory or from the wr-switch-sw project
directory (i.e.: @code{./wrs_build-all} @code{./build/wrs_build-all}
are not allowed), you must call it from your output directory
using a pathname to invoke it. This variable cannot be
overridden in the main script, but must be pre-set if you run
a sub-script to rebuild only part of the software suite.
@item WRS_OUTPUT_DIR
The pathname of the directory where output is placed. It defaults
The absolute pathname of the directory where output is placed. It
defaults
to the current directory whence you invoke the script (i.e., you
can invoke @code{/path/to/wrs_build-all} to have all output
in the current directory). Compilation
...
...
@@ -214,7 +216,8 @@ have a similar prefix for the same reason).
and final images are placed in a @i{images} subdirectory.
@item WRS_DOWNLOAD_DIR
The directory where downloaded files are placed. If unset
The absolute pathname of the directory where downloaded files
are placed. If unset
it defaults to @code{$WRS_OUTPUT_DIR/downloads}, which is
created if needed. By pre-setting this variable you can
simply recursively delete
...
...
@@ -345,7 +348,7 @@ to generate the terse output shown above:
@example
/path/to/wr-switch-sw/build/wrs_build-all 2>&1 | tee logfile \
| grep
'
^
20.
.-..-..
..:
'
| grep
"^20..-..-.. ..:"
@end example
If you are lucky, everything completes by itself. The time taken
...
...
@@ -1467,6 +1470,14 @@ that should be renamed to @code{g45memtest}.
@c ##########################################################################
@node Schematics
@appendix Schematics
The switch schematics version: 3.0, 3.1 and 3.2 are available on the
OpenHardware repository of the white-rabbit project at the following link:
@uref{http://www.ohwr.org/documents/180}
@c ##########################################################################
@bye
...
...
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