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
b3f08f42
Commit
b3f08f42
authored
Jul 13, 2012
by
Benoit Rat
Committed by
Alessandro Rubini
Jul 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flasher: script can be called from anywhere and add skip process for MAC input
parent
a3ede2d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
flash-wrs
build/flash-wrs
+17
-10
No files found.
build/flash-wrs
View file @
b3f08f42
...
...
@@ -27,7 +27,7 @@ showhelp()
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
--s
ilent
\t\t
Don't ask MAC or S/N and use default 02:0B:AD:C0:FF:EE
\n\n
"
printf
"
\t
--s
kip
\t\t
Don't ask MAC or S/N and use default 02:0B:AD:C0:FF:EE
\n\n
"
exit
0
}
...
...
@@ -67,7 +67,11 @@ modifyMAC()
if
[
$silent
]
;
then
return
1
;
fi
read
-p
"Enter MAC (XX:XX:XX:XX:XX:XX): "
MAC
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
...
...
@@ -132,15 +136,17 @@ modifyMAC()
}
# Go to the top directory
topdir
=
$(
dirname
$0
)
/..
# Sanity checks
if
[
-d
.
/usb-loader
]
;
then
true
;
else
echo
"
$0
:
Please run me from the top-level wr-switch-sw directory
"
>
& 2
if
[
-d
${
topdir
}
/usb-loader
]
;
then
true
;
else
echo
"
$0
:
usb-loader is not found
"
>
& 2
exit
1
fi
# build flasher itself
if
CC
=
cc make
-s
-C
usb-loader
;
then
true
;
else
if
CC
=
cc make
-s
-C
${
topdir
}
/
usb-loader
;
then
true
;
else
echo
"
$0
: Error compiling usb-loader"
>
&2
;
exit
1
;
fi
...
...
@@ -149,8 +155,8 @@ MAC=""
DEV
=
""
FLAGS
=
""
at91bs
=
"
.
/binaries/at91bootstrap.bin"
barebox
=
"
.
/binaries/barebox.bin"
at91bs
=
"
${
topdir
}
/binaries/at91bootstrap.bin"
barebox
=
"
${
topdir
}
/binaries/barebox.bin"
kernel
=
"
${
WRS_OUTPUT_DIR
}
/images/zImage"
rootfs
=
"
${
WRS_OUTPUT_DIR
}
/images/wrs-image.jffs2.img"
...
...
@@ -210,6 +216,7 @@ while true; do
done
if
[
-z
"
$msg
"
]
;
then
printf
"
\t
OK
\n
"
read
-t
5
-p
"Remove the Dataflash jumper (5s timeout)"
fi
## Flashing DataFlash
...
...
@@ -221,7 +228,7 @@ if [ $df ]; then
Tbarebox
=
$(
mktemp
/tmp/barebox.XXXXXX
)
modifyMAC
${
barebox
}
${
Tbarebox
}
.
/usb-loader/mch_flasher
-m
df
$FLAGS
$DEV
${
at91bs
}
0
${
Tbarebox
}
33792
${
topdir
}
/usb-loader/mch_flasher
-m
df
$FLAGS
$DEV
${
at91bs
}
0
${
Tbarebox
}
33792
fi
## Selecting the running memmode
...
...
@@ -254,7 +261,7 @@ if [ $nf ]; then
checkExit
$kernel
checkExit
$rootfs
.
/usb-loader/mch_flasher
-m
nand
$FLAGS
$DEV
${
kernel
}
0x00100000
${
rootfs
}
0x04000000
${
topdir
}
/usb-loader/mch_flasher
-m
nand
$FLAGS
$DEV
${
kernel
}
0x00100000
${
rootfs
}
0x04000000
fi
## Loading in DDR
...
...
@@ -267,7 +274,7 @@ if [ $test ]; then
Tbarebox
=
$(
mktemp
/tmp/barebox.XXXXXX
)
modifyMAC
${
barebox
}
${
Tbarebox
}
.
/usb-loader/mch_flasher
-m
ddr
$FLAGS
$DEV
${
Tbarebox
}
0x0
${
kernel
}
0x1000000
${
rootfs
}
0x2000000
${
topdir
}
/usb-loader/mch_flasher
-m
ddr
$FLAGS
$DEV
${
Tbarebox
}
0x0
${
kernel
}
0x1000000
${
rootfs
}
0x2000000
fi
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