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
84
Issues
84
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
72a303be
Commit
72a303be
authored
Jul 16, 2012
by
Benoit Rat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: corect merging bug from v3-sevensols to v3-seevnsols-rc2
parent
6f7b8afd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
86 deletions
+3
-86
flash-wrs
build/flash-wrs
+3
-86
No files found.
build/flash-wrs
View file @
72a303be
...
...
@@ -64,7 +64,7 @@ modifyMAC()
if
[
"x
$MAC
"
!=
"x"
]
;
then
echo
"
$0
: Invalid MAC address
\"
$MAC
\"
"
>
&2
;
fi
if
[
$s
ilent
]
;
then
if
[
$s
kip
]
;
then
return
1
;
fi
read
-p
"Enter MAC (XX:XX:XX:XX:XX:XX) or press S (Skip): "
MAC
...
...
@@ -77,65 +77,6 @@ modifyMAC()
}
showhelp
()
{
echo
"Usage:
$0
[options] MAC [DEV]
\n
"
echo
"MAC:
\t
MAC address in hexadecimal seperated by ':' (i.e, AB:CD:EF:01:23:45)"
echo
"DEV:
\t
The usb device (by default it is /dev/ttyACM0)"
echo
"Options: "
echo
"
\t
-h|--help
\t\t
Show this help message"
echo
"
\t
-m|--memmode
\t\t
can be: default, df (dataflash), nf (nandflash), test."
echo
"
\t
-e
\t\t\t
Completely erase the memory (Can erase your configuration)"
echo
"
\t
--build
\t\t\t
Use file that you have build in the WRS_OUTPUT_DIR"
echo
"
\t
--test
\t\t\t
Use file for testing the switch (not available)"
echo
"
\t
--silent
\t\t
Don't ask MAC or S/N and use default 02:0B:AD:C0:FF:EE"
echo
""
exit
0
}
checkExit
()
{
err
=
0
;
if
[
$1
]
;
then
if
[
-f
$1
]
;
then
return
0
;
else
echo
"Can't find
$1
"
>
& 2
;
fi
else
echo
"varname not set"
fi
exit
1
}
modifyMAC
()
{
origin
=
$1
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
[
$silent
]
;
then
return
1
;
fi
read
-p
"Enter MAC (XX:XX:XX:XX:XX:XX): "
MAC
fi
done
}
# Go to the top directory
topdir
=
$(
dirname
$0
)
/..
...
...
@@ -178,7 +119,7 @@ while [ $# -ge 1 ]; do
shift
;;
-h
|
--help
)
showhelp
;
shift
;;
-m
|
--memmode
)
memmode
=
"
$2
"
;
shift
;
shift
;;
--s
ilent
)
silent
=
1
;
shift
;;
--s
kip
)
skip
=
1
;
shift
;;
/
*
)
DEV
=
"-s
$1
"
;
shift
;;
*
:
*
)
MAC
=
"
$1
"
;
shift
;;
...
...
@@ -216,7 +157,7 @@ while true; do
done
if
[
-z
"
$msg
"
]
;
then
printf
"
\t
OK
\n
"
read
-
t
5
-p
"Remove the Dataflash jumper (5s timeout
)"
read
-
p
"Remove the Dataflash jumper (Press any key
)"
fi
## Flashing DataFlash
...
...
@@ -231,30 +172,6 @@ if [ $df ]; then
${
topdir
}
/usb-loader/mch_flasher
-m
df
$FLAGS
$DEV
${
at91bs
}
0
${
Tbarebox
}
33792
fi
## Selecting the running memmode
if
[
"x
$memmode
"
=
"xdf"
]
;
then
df
=
1
elif
[
"x
$memmode
"
=
"xnf"
]
;
then
nf
=
1
elif
[
"x
$memmode
"
=
"xtest"
]
;
then
test
=
1
else
df
=
1
nf
=
1
fi
## Flashing DataFlash
if
[
$df
]
;
then
checkExit
$at91bs
checkExit
$barebox
Tbarebox
=
$(
mktemp
/tmp/barebox.XXXXXX
)
modifyMAC
${
barebox
}
${
Tbarebox
}
./usb-loader/mch_flasher
-m
df
$FLAGS
$DEV
${
at91bs
}
0
${
Tbarebox
}
33792
fi
## Flashing NANDFlash
if
[
$nf
]
;
then
...
...
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