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
2fa9d915
Commit
2fa9d915
authored
Oct 16, 2014
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace: allow hwinfo to be created before loading FPGA
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
16d93070
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
S90hwinfo
userspace/rootfs_override/etc/init.d/S90hwinfo
+13
-1
No files found.
userspace/rootfs_override/etc/init.d/S90hwinfo
View file @
2fa9d915
...
...
@@ -19,13 +19,25 @@ if ! grep -q hwinfo /proc/mtd; then exit 0; fi
# Is there sdb in there? If so, nothing to do.
if
/wr/bin/sdb-read /dev/mtd5ro
>
/dev/null
;
then
exit
0
;
fi
echo
"Creating SDB filesystem in /dev/mtd5"
# So, we must create an sdb file, we need the template
cp
/wr/etc/sdb-for-dataflash /tmp
||
exit
1
#
and
we need the eth addresses
# we need the eth addresses
ethaddr
=
$(
ifconfig eth0 |
grep
HWaddr |
awk
'{print $5}'
)
wraddr
=
$(
ifconfig wr0 |
grep
HWaddr |
awk
'{print $5}'
)
# if we run this early (upgrade mess from v4.0) there is no wr0,
# so pick if from the command line:
if
[
"x
$wraddr
"
=
"x"
]
;
then
wraddr
=
$(
awk
'BEGIN {FS="="; RS=" "} /wr_nic.macaddr/ {print $2}'
\
/proc/cmdline
)
fi
# and, to be super-pedantic, if empty use default and don't corrupt hwinfo
if
[
"x
$ethaddr
"
=
"x"
]
;
then
ethaddr
=
"02:34:56:78:9A:BC"
;
fi
if
[
"x
$wraddr
"
=
"x"
]
;
then
wraddr
=
"02:34:56:78:9A:00"
;
fi
# we lack sdb-write...
sed
-i
s,02:34:56:78:9A:BC,
$ethaddr
, /tmp/sdb-for-dataflash
sed
-i
s,02:34:56:78:9A:00,
$wraddr
, /tmp/sdb-for-dataflash
...
...
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