pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/decode-dimms Update the patch again to get it...
details: https://anonhg.NetBSD.org/pkgsrc/rev/daf1bd5edee8
branches: trunk
changeset: 310829:daf1bd5edee8
user: pgoyette <pgoyette%pkgsrc.org@localhost>
date: Wed Jul 25 02:40:44 2018 +0000
description:
Update the patch again to get it with the correct from-to files.
diffstat:
sysutils/decode-dimms/distinfo | 4 +-
sysutils/decode-dimms/patches/patch-decode-dimms | 124 +++++++++++-----------
2 files changed, 64 insertions(+), 64 deletions(-)
diffs (213 lines):
diff -r db159c75bbce -r daf1bd5edee8 sysutils/decode-dimms/distinfo
--- a/sysutils/decode-dimms/distinfo Wed Jul 25 02:37:41 2018 +0000
+++ b/sysutils/decode-dimms/distinfo Wed Jul 25 02:40:44 2018 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.7 2018/07/25 02:37:41 pgoyette Exp $
+$NetBSD: distinfo,v 1.8 2018/07/25 02:40:44 pgoyette Exp $
SHA1 (i2c-tools-84da8192c7c409f37c1906b60ef166c58aafc847.tar.gz) = 0765225f1f7ee63d0ebb3a3881ad819fa9d48d9e
RMD160 (i2c-tools-84da8192c7c409f37c1906b60ef166c58aafc847.tar.gz) = 0e1f9c86e5005bf8534789e4dea532bc8dda522a
SHA512 (i2c-tools-84da8192c7c409f37c1906b60ef166c58aafc847.tar.gz) = 4cd57f6cc4424888fe4e7bede28b7a5e15e7f658b57fa4df528cc3636cd5124036a69492de9636d81478e58b660275df2dee239999bd5ea0bec13313b240b352
Size (i2c-tools-84da8192c7c409f37c1906b60ef166c58aafc847.tar.gz) = 95860 bytes
-SHA1 (patch-decode-dimms) = 0d4fe79075394a346c2b7d90ec8b20675ef356d9
+SHA1 (patch-decode-dimms) = 1f2ff213708d127b1afc27a6df2d91b856d543fc
SHA1 (patch-decode-dimms.1) = c1c1444a73fa848eda0223e2c176819d4ded6641
diff -r db159c75bbce -r daf1bd5edee8 sysutils/decode-dimms/patches/patch-decode-dimms
--- a/sysutils/decode-dimms/patches/patch-decode-dimms Wed Jul 25 02:37:41 2018 +0000
+++ b/sysutils/decode-dimms/patches/patch-decode-dimms Wed Jul 25 02:40:44 2018 +0000
@@ -1,133 +1,133 @@
-$NetBSD: patch-decode-dimms,v 1.6 2018/07/25 02:37:11 pgoyette Exp $
+$NetBSD: patch-decode-dimms,v 1.7 2018/07/25 02:40:44 pgoyette Exp $
Add NetBSD-specific ability to use spdmem(4)'s sysctl values as
input.
---- eeprom/decode-dimms.orig 2018-07-25 10:33:01.055537617 +0800
-+++ eeprom/decode-dimms 2018-05-31 13:53:29.771907986 +0800
+--- eeprom/decode-dimms.orig 2018-05-31 13:53:29.771907986 +0800
++++ eeprom/decode-dimms 2018-07-25 10:33:01.055537617 +0800
@@ -1,4 +1,4 @@
--#!/usr/pkg/bin/perl -w
-+#!/usr/bin/perl -w
+-#!/usr/bin/perl -w
++#!/usr/pkg/bin/perl -w
#
# EEPROM data decoder for SDRAM DIMM modules
#
-@@ -42,9 +42,8 @@
+@@ -42,8 +42,9 @@
use Fcntl qw(:DEFAULT :seek);
use File::Basename;
use vars qw($opt_html $opt_bodyonly $opt_side_by_side $opt_merge
-- $opt_igncheck $use_sysfs $use_hexdump $use_sysctl $sbs_col_width
-- @vendors %decode_callback $revision @dimm $current %hexdump_cache
-- %sysctl_cache);
-+ $opt_igncheck $use_sysfs $use_hexdump $sbs_col_width
-+ @vendors %decode_callback $revision @dimm $current %hexdump_cache);
+- $opt_igncheck $use_sysfs $use_hexdump $sbs_col_width
+- @vendors %decode_callback $revision @dimm $current %hexdump_cache);
++ $opt_igncheck $use_sysfs $use_hexdump $use_sysctl $sbs_col_width
++ @vendors %decode_callback $revision @dimm $current %hexdump_cache
++ %sysctl_cache);
use constant LITTLEENDIAN => "little-endian";
use constant BIGENDIAN => "big-endian";
-@@ -342,7 +341,6 @@
+@@ -341,6 +342,7 @@
);
$use_sysfs = -d '/sys/bus';
--$use_sysctl = 0;
++$use_sysctl = 0;
# We consider that no data was written to this area of the SPD EEPROM if
# all bytes read 0x00 or all bytes read 0xff
-@@ -2254,26 +2252,6 @@
+@@ -2252,6 +2254,26 @@
}
}
--# read data from a NetBSD (or equivalent) sysctl variable
--
--sub read_sysctl($)
--{
--
-- # Look in the cache first
-- return @{$sysctl_cache{$_[0]}} if exists $sysctl_cache{$_[0]};
--
-- my $sysctl_var = sprintf("hw.%s.spd_data", $_[0]);
-- open(PIPE, "-|", "sysctl -r $sysctl_var")
-- or die "Cannot read sysctl variable $sysctl_var";
-- sysread(PIPE, my $eeprom, 512); # XXX Assumed maximum size! XXX
-- close PIPE or die "sysctl returned $?";
-- my @bytes = unpack("C*", $eeprom);
--
-- # Cache the data for later use
-- $hexdump_cache{$_[0]} = \@bytes;
-- return @bytes;
--}
--
++# read data from a NetBSD (or equivalent) sysctl variable
++
++sub read_sysctl($)
++{
++
++ # Look in the cache first
++ return @{$sysctl_cache{$_[0]}} if exists $sysctl_cache{$_[0]};
++
++ my $sysctl_var = sprintf("hw.%s.spd_data", $_[0]);
++ open(PIPE, "-|", "sysctl -r $sysctl_var")
++ or die "Cannot read sysctl variable $sysctl_var";
++ sysread(PIPE, my $eeprom, 512); # XXX Assumed maximum size! XXX
++ close PIPE or die "sysctl returned $?";
++ my @bytes = unpack("C*", $eeprom);
++
++ # Cache the data for later use
++ $hexdump_cache{$_[0]} = \@bytes;
++ return @bytes;
++}
++
# Read bytes from SPD-EEPROM
# Note: offset must be a multiple of 16!
sub readspd($$$)
-@@ -2283,9 +2261,6 @@
+@@ -2261,6 +2283,9 @@
if ($use_hexdump) {
@bytes = read_hexdump($dimm_i);
return @bytes[$offset..($offset + $size - 1)];
-- } elsif ($use_sysctl) {
-- @bytes = read_sysctl($dimm_i);
-- return @bytes[$offset..($offset + $size - 1)];
++ } elsif ($use_sysctl) {
++ @bytes = read_sysctl($dimm_i);
++ return @bytes[$offset..($offset + $size - 1)];
} elsif ($use_sysfs) {
# Kernel 2.6 with sysfs
sysopen(HANDLE, "$dimm_i/eeprom", O_RDONLY)
-@@ -2362,7 +2337,7 @@
+@@ -2337,7 +2362,7 @@
# Parse command-line
foreach (@ARGV) {
if ($_ eq '-h' || $_ eq '--help') {
-- print "Usage: $0 [-c] [-f [-b]] [-x|-X|-s file [files..]]\n",
-+ print "Usage: $0 [-c] [-f [-b]] [-x|-X file [files..]]\n",
+- print "Usage: $0 [-c] [-f [-b]] [-x|-X file [files..]]\n",
++ print "Usage: $0 [-c] [-f [-b]] [-x|-X|-s file [files..]]\n",
" $0 -h\n\n",
" -f, --format Print nice html output\n",
" -b, --bodyonly Don't print html header\n",
-@@ -2376,8 +2351,6 @@
+@@ -2351,6 +2376,8 @@
" -x, Read data from hexdump files\n",
" -X, Same as -x except treat multibyte hex\n",
" data as little endian\n",
-- " -s, Use NetBSD-compatible sysctl(8) to obtain\n",
-- " EEPROM data\n",
++ " -s, Use NetBSD-compatible sysctl(8) to obtain\n",
++ " EEPROM data\n",
" -h, --help Display this usage summary\n";
print <<"EOF";
-@@ -2422,20 +2395,13 @@
+@@ -2395,13 +2422,20 @@
$use_hexdump = LITTLEENDIAN;
next;
}
-- if ($_ eq '-s') {
-- if (-x "/sbin/sysctl") {
-- $use_sysctl = 1;
-- } else { die "No /sbin/sysctl available for -s"; }
-- next;
-- }
++ if ($_ eq '-s') {
++ if (-x "/sbin/sysctl") {
++ $use_sysctl = 1;
++ } else { die "No /sbin/sysctl available for -s"; }
++ next;
++ }
if (m/^-/) {
print STDERR "Unrecognized option $_\n";
exit;
}
-- push @dimm, { eeprom => basename($_), file => $_ }
-- if ($use_sysctl || $use_hexdump);
-+ push @dimm, { eeprom => basename($_), file => $_ } if $use_hexdump;
+- push @dimm, { eeprom => basename($_), file => $_ } if $use_hexdump;
++ push @dimm, { eeprom => basename($_), file => $_ }
++ if ($use_sysctl || $use_hexdump);
}
# Default values
-@@ -2513,7 +2479,7 @@
+@@ -2479,7 +2513,7 @@
# * chk_spd: The checksum or CRC value found in the EEPROM
# * chk_calc: The checksum or CRC computed from the EEPROM data
# Keys are added over time.
--@dimm = get_dimm_list() unless ($use_sysctl || $use_hexdump);
-+@dimm = get_dimm_list() unless $use_hexdump;
+-@dimm = get_dimm_list() unless $use_hexdump;
++@dimm = get_dimm_list() unless ($use_sysctl || $use_hexdump);
for my $i (0 .. $#dimm) {
my @bytes = readspd(0, 128, $dimm[$i]->{file});
-@@ -2565,7 +2531,7 @@
+@@ -2531,7 +2565,7 @@
printl("Decoding EEPROM", $dimm[$current]->{eeprom});
}
-- if (!$use_hexdump && !$use_sysctl) {
-+ if (!$use_hexdump) {
+- if (!$use_hexdump) {
++ if (!$use_hexdump && !$use_sysctl) {
if ($dimm[$current]->{file} =~ /-([\da-f]+)$/i) {
my $dimm_num = hex($1) - 0x50 + 1;
if ($dimm_num >= 1 && $dimm_num <= 8) {
-@@ -2771,4 +2737,3 @@
+@@ -2737,3 +2771,4 @@
printl2("\n\nNumber of SDRAM DIMMs detected and decoded", scalar @dimm);
print "</body></html>\n" if ($opt_html && !$opt_bodyonly);
--
++
Home |
Main Index |
Thread Index |
Old Index