Hi Harald,

Great work! I'll test it tomorrow on a v1 board.

On Tue, Mar 31, 2009 at 05:44:50PM +0200, Harald Gutmann wrote:
> +             /* TODO: Check why udev renames eth0 to eth1 at boot time */
> +     PCI_INT(0,sbdn+8,0, 22); /* GBit Ether */

If you check, you'll find your mac address to be different under coreboot.
That's because for mcp55-based nics, the mac address is stored in the bios
rom image.

I have a script that I use to binary patch coreboot rom images with a
different mac address. It's attached.

Thanks,
Ward.

-- 
Ward Vandewege <[email protected]>
Free Software Foundation - Senior Systems Administrator
#!/usr/bin/perl
#
# Binary patch the mac address in a coreboot rom image for an mcp55-based board.
#
# Only tested on Gigabyte m57sli. Will only modify one mac address. Use at your own risk!
#
# GPL v2 or later.
#
# 2009-03-31
# Ward Vandewege <[email protected]>

my $mac = $ARGV[0];
my $file = $ARGV[1];

if (($mac eq '') or ($file eq '')) {
	print "\nSyntax: $0 <mac address> <rom image>\n";
	exit 1;
}

if (! -f $file) {
	print "\nSyntax: $0 <mac address> <rom image>\n";
	print "\nERROR: Could not file file '$file'.\n\n";
	exit 1;
}

if (!($mac =~ /^[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}$/)) {
	print "\nSyntax: $0 <mac address> <rom image>\n";
	print "\nERROR: The mac address you specified ($mac) is not a valid mac address.\n\n";
	exit 1;
}

my @mac = split(/:/,$mac);

my $newmac = '';

for (my $c = 5; $c >= 0; $c--) {
	$newmac .= chr(hex($mac[$c]));
}

open(ROMIMAGE,"+<",$file) or die "Can't open file $file for writing\n";
seek(ROMIMAGE,-48,2);

print ROMIMAGE $newmac;
close(ROMIMAGE);

print "Mac address succesfully updated to $mac in $file\n";
exit 0;


-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to