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
d460c6a8
Commit
d460c6a8
authored
Jul 19, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fede-review' into v3
parents
d0be3bc6
cac71a78
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
208 additions
and
185 deletions
+208
-185
download-info
build/download-info
+1
-1
flash-wrs
build/flash-wrs
+44
-8
wrs_build-all
build/wrs_build-all
+6
-4
wrs-build.in
doc/wrs-build.in
+157
-172
No files found.
build/download-info
View file @
d460c6a8
...
...
@@ -83,7 +83,7 @@ lua-5.1.4.tar.gz d0870f2de55d59c1c8419f36e8fac150 \
http://www.lua.org/ftp/lua-5.1.4.tar.gz
lzo-2.06.tar.gz 95380bd4081f85ef08c5209f4107e9f8 \
http://www.
lzop.org
/download/lzo-2.06.tar.gz
http://www.
oberhumer.com/opensource/lzo
/download/lzo-2.06.tar.gz
m4-1.4.15.tar.bz2 c7c32540bc3842d5550f88d47ef551d8 \
http://ftp.gnu.org/pub/gnu/m4/m4-1.4.15.tar.bz2
...
...
build/flash-wrs
View file @
d460c6a8
...
...
@@ -22,12 +22,12 @@ showhelp()
printf
"<firmware>.tar.gz: Use the file in the firmware to flash the device
\n
"
printf
"DEV:
\t
The usb device (by default it is /dev/ttyACM0)
\n
"
printf
"Options:
\n
"
printf
"
\t
-h|--help
\t
\t
Show this help message
\n
"
printf
"
\t
-m|--mode
\t\t
can be: default, df (dataflash), nf (nandflash), test
.
\n
"
printf
"
\t
-e
\t
\t\t
Completely erase the memory (Can erase your configuration)
\n
"
printf
"
\t
--build
\t\t
\t
Use file that you have build in the WRS_OUTPUT_DIR
\n
"
printf
"
\t
--test
\t\
t\t
Use file for testing the switch (not available)
\n
"
printf
"
\t
--skip
\t
\t
Don't ask MAC or S/N and use default 02:0B:AD:C0:FF:EE
\n\n
"
printf
"
-h|--help
\t
Show this help message
\n
"
printf
"
-m|--mode
\t
can be: default (df and nf), df (dataflash),
\n\t\t
nf (nandflash), ddr (ddr memories)
.
\n
"
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
"
--tes
t
\t
Use file for testing the switch (not available)
\n
"
printf
"
--skip
\t
Don't ask MAC or S/N and use default 02:0B:AD:C0:FF:EE
\n\n
"
exit
0
}
...
...
@@ -47,6 +47,15 @@ checkExit()
exit
1
}
checkMAC
()
{
X
=
"[0-9a-fA-F][0-9a-fA-F]"
if
echo
$1
|
grep
"^
${
X
}
:
${
X
}
:
${
X
}
:
${
X
}
:
${
X
}
:
${
X
}
\$
"
>
/dev/null
;
then
return
0
fi
return
1
}
modifyMAC
()
{
origin
=
$1
...
...
@@ -118,8 +127,22 @@ while [ $# -ge 1 ]; do
rootfs
=
/tmp/wrs-image.jffs2.img
shift
;;
-h
|
--help
)
showhelp
;
shift
;;
-m
|
--memmode
)
memmode
=
"
$2
"
;
shift
;
shift
;;
--skip
)
skip
=
1
;
shift
;;
-m
|
--memmode
)
# verify memory mode
if
[
"
$2
"
!=
"nf"
]
&&
[
"
$2
"
!=
"df"
]
&&
[
"
$2
"
!=
"ddr"
]
&&
[
"
$2
"
!=
"default"
]
;
then
echo
"Error: Invalid memory mode"
showhelp
exit
1
fi
memmode
=
"
$2
"
shift
;
shift
;;
--skip
)
# 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
skip
=
1
;
shift
;;
/
*
)
DEV
=
"-s
$1
"
;
shift
;;
*
:
*
)
MAC
=
"
$1
"
;
shift
;;
...
...
@@ -128,6 +151,19 @@ while [ $# -ge 1 ]; do
esac
done
#MAC address is a mandatory field
if
[
"x
$MAC
"
=
"x"
]
;
then
echo
"Error: MAC address is mandatory"
showhelp
exit
1
else
checkMAC
$MAC
if
[
$?
-eq
1
]
;
then
echo
"Error: MAC address is invalid (
$MAC
)"
exit
1
fi
fi
## Selecting the running memmode
if
[
"x
$memmode
"
=
"xdf"
]
;
then
df
=
1
...
...
build/wrs_build-all
View file @
d460c6a8
...
...
@@ -23,6 +23,11 @@ if [ "$WRS_OUTPUT_DIR" = "$WRS_BASE_DIR" ]; then
wrs_die
"Please run
$(
basename
$0
)
from a different directory"
fi
# 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"
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"
...
...
@@ -47,10 +52,9 @@ showhelp() {
echo
""
echo
"Options:"
echo
" --help Show this little message"
echo
" --pack Create a tar.gz package with the files"
echo
" --clean Remove all the previous configuration"
echo
" --fetch Force fetching the new download files"
echo
" --list List the different building steps"
echo
" --pack Create a tar.gz package with the files in
${
WRS_OUTPUT_DIR
}
/images/"
echo
" --step=[00-09] Perform one specific step"
echo
""
exit
0
;
...
...
@@ -93,7 +97,6 @@ if [ -n "$1" ]; then
case
"
$1
"
in
--help
)
showhelp
;;
--clean
)
clean
;;
--fetch
)
echo
"To be done"
;;
--list
)
cd
$WRS_DONE_DIR
;
ls
0
*
;
exit
0
;;
--pack
)
pack
;
exit
0
;;
--step
=
0[0-9]
)
num
=
`
echo
$1
|
sed
-e
's/--step=//'
`
;
rm
-vf
$WRS_DONE_DIR
/
${
num
}
-
*
;;
...
...
@@ -152,4 +155,3 @@ if $failed_step; then
wrs_die
"One or more build steps failed"
fi
wrs_echo
"Complete build succeeded, apparently"
doc/wrs-build.in
View file @
d460c6a8
This diff is collapsed.
Click to expand it.
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