Browse Source

Don't print anything by default if the checksum fails. There are many more

EEPROMs in modern computers than just SPD EEPROMs, and there's no reason
to include them in the output of decode-dimms.pl.


git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5087 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.0.1
Jean Delvare 18 years ago
parent
commit
726895ced3
  1. 1
      CHANGES
  2. 19
      eeprom/decode-dimms.pl

1
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

19
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 "<b><u>" 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 "</table>\n" if $opt_html;
next;
}
$dimm_count++;
# Simple heuristic to detect Rambus
my $is_rambus = $bytes[0] < 4;
my $temp;

Loading…
Cancel
Save