diff --git a/CHANGES b/CHANGES index 66cddbe..07f846d 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,7 @@ i2c-tools CHANGES SVN decode-dimms: Fix DDR2 SDRAM module speed decoding Update manufacturer IDs. + Don't print anything by default if checksum fails decode-vaio: Private data might not be readable by non-root users Print the asset tag Fix the timestamp decoding diff --git a/eeprom/decode-dimms.pl b/eeprom/decode-dimms.pl index 2e9ccfe..642caf6 100755 --- a/eeprom/decode-dimms.pl +++ b/eeprom/decode-dimms.pl @@ -1111,6 +1111,14 @@ for my $i ( 0 .. $#dimm_list ) { $_=$dimm_list[$i]; if (($use_sysfs && /^\d+-\d+$/) || (!$use_sysfs && /^eeprom-/)) { + my @bytes = readspd64(0, $dimm_list[$i]); + my $dimm_checksum = 0; + $dimm_checksum += $bytes[$_] foreach (0 .. 62); + $dimm_checksum &= 0xff; + + next unless $bytes[63] == $dimm_checksum || $opt_igncheck; + $dimm_count++; + print "" if $opt_html; printl2 "\n\nDecoding EEPROM", ($use_sysfs ? "/sys/bus/i2c/drivers/eeprom/$dimm_list[$i]" : @@ -1126,23 +1134,12 @@ for my $i ( 0 .. $#dimm_list ) { # Decode first 3 bytes (0-2) prints "SPD EEPROM Information"; - my @bytes = readspd64(0, $dimm_list[$i]); - my $dimm_checksum = 0; - $dimm_checksum += $bytes[$_] foreach (0 .. 62); - $dimm_checksum &= 0xff; - my $l = "EEPROM Checksum of bytes 0-62"; printl $l, ($bytes[63] == $dimm_checksum ? sprintf("OK (0x%.2X)", $bytes[63]): sprintf("Bad\n(found 0x%.2X, calculated 0x%.2X)\n", $bytes[63], $dimm_checksum)); - unless ($bytes[63] == $dimm_checksum or $opt_igncheck) { - print "\n" if $opt_html; - next; - } - - $dimm_count++; # Simple heuristic to detect Rambus my $is_rambus = $bytes[0] < 4; my $temp;