Skip to content

Commit

Permalink
g-ether-load: fix mac address read
Browse files Browse the repository at this point in the history
hexdump has a feature to replace repeated characters on output with an *,
use -v to disable this feature.

Thus

hexdump -e '1/1 "%02X" ":"' /proc/device-tree/ocp/ethernet@4a100000/slave@4a100200/mac-address
90:59:AF:5C:*
C5:debian@arm:~$

hexdump -v -e '1/1 "%02X" ":"' /proc/device-tree/ocp/ethernet@4a100000/slave@4a100200/mac-address
90:59:AF:5C:5C:C5:debian@arm:~$

Signed-off-by: Robert Nelson <[email protected]>
  • Loading branch information
RobertCNelson committed Sep 5, 2013
1 parent d612f5e commit 468063a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function reverse_bytes()
mac_address="/proc/device-tree/ocp/ethernet@4a100000/slave@4a100300/mac-address"
if [ -f ${mac_address} ] ; then
DEV_ADDR=$(hexdump -e '1/1 "%02X" ":"' ${mac_address} | sed 's/.$//')
DEV_ADDR=$(hexdump -v -e '1/1 "%02X" ":"' ${mac_address} | sed 's/.$//')
else
DEVMEM_ADDR_LO=$(get_devmem 0x44e10638|bc)
DEVMEM_ADDR_LO=$(reverse_bytes ${DEVMEM_ADDR_LO})
Expand Down

0 comments on commit 468063a

Please sign in to comment.