Thx sfzhi, I just did the test on my SheevaPlug with the following (odd) result:
My U-Boot version is: U-Boot 1.1.4 (Dec 27 2009 - 22:03:21) Marvell version: 3.4.27 - pingtoo patch.01
During my first attempt I "deleted" the arguement for the ethaddr environment variable, saved the settings and booted the system. Hence it came up with the right address. My first guess was: "Hurray, it's working", but found this to be the wrong conclusion later, because:
When I did a second reboot, the system came up with no eth interface at all, just the loopback!?
So I went into U-Boot again to see what happened and was surprised to find (printenv) the ethaddr env-var set as
ethaddr=00:50:43:a6:0c:23
So I started the system over and again, but again no eth int.
Back in U-Boot the ethaddr arg was different again and seems to be changing randomly from reboot/reset to reset.
ethaddr=00:50:43:98:04:26
ethaddr=00:50:43:b6:36:29
ethaddr=00:50:43:79:23:2f
So my guess what happened: during my first attempt I just altered the U-Boot settings after the system had already been initialized and as I just issued a boot rather than reset command it came up with the expected MAC addr.
However something is still odd with the U-Boot:
i) though the ethaddr is null in the saved config(?) the u-boot printenv command delivers a random result.
ii) however the u-boot is not using that random MAC address to initialize the interface and thus the OS shows no eth int!?
Only after I set the ethaddr again the plug comes up with that interface enabled.
This can be very misleading as printenv gives you an address though none is set.
Now finding this it reminded me of that strange behavior I run in before, but which gets a _bit_ clearer, now. (
http://plugcomputer.org/plugforum/index.php?topic=1304.msg8181#msg8181)
PS: Update in short how it "works"
Marvell>> setenv ethaddr
Marvell>> printenv ethaddr
## Error: "ethaddr" not defined
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Marvell>> reset
[...]
Marvell>> printenv ethaddr
ethaddr=00:50:43:42:34:37
Marvell>> printenv ethaddr
ethaddr=00:50:43:42:34:37
Marvell>> reset
[...]
Marvell>> printenv ethaddr
ethaddr=00:50:43:ea:2d:38
and so on ...
PS2: I only have an eth0 if I set the "right" MAC address in u-boot.