From MAILER-DAEMON Mon May 01 07:40:31 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1d59gt-0002ii-0m
	for mharc-dmidecode-devel@gnu.org; Mon, 01 May 2017 07:40:31 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41214)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1d59gq-0002ia-6z
	for dmidecode-devel@nongnu.org; Mon, 01 May 2017 07:40:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1d59gn-0001aT-3G
	for dmidecode-devel@nongnu.org; Mon, 01 May 2017 07:40:28 -0400
Received: from mx2.suse.de ([195.135.220.15]:51277 helo=mx1.suse.de)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1d59gm-0001aL-P4
	for dmidecode-devel@nongnu.org; Mon, 01 May 2017 07:40:25 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx1.suse.de (Postfix) with ESMTP id 9415AAC3B
	for <dmidecode-devel@nongnu.org>; Mon,  1 May 2017 11:40:21 +0000 (UTC)
Date: Mon, 1 May 2017 13:40:20 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170501134020.2242c683@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH v2] dmidecode: New option --oem-string
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 01 May 2017 11:40:29 -0000

Add a new option to extract OEM strings, like we already have for
many other strings.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
Changes since v1:
 * Document the new option in --help and man page.
 * Return an error message if index is out of range.
 * Special value "count" returns the number of OEM strings.

 dmidecode.c     |   15 +++++++++++++++
 dmiopt.c        |   40 ++++++++++++++++++++++++++++++++++++++++
 man/dmidecode.8 |    7 ++++++-
 3 files changed, 61 insertions(+), 1 deletion(-)

--- dmidecode.orig/dmiopt.c	2017-04-04 10:03:43.885412547 +0200
+++ dmidecode/dmiopt.c	2017-05-01 12:23:44.207581011 +0200
@@ -20,6 +20,7 @@
  */
 
 #include <stdio.h>
+#include <string.h>
 #include <strings.h>
 #include <stdlib.h>
 #include <getopt.h>
@@ -171,6 +172,10 @@ static const struct string_keyword opt_s
 	{ "processor-frequency", 4, 0x16 },     /* dmi_processor_frequency() */
 };
 
+/* This is a template, 3rd field is set at runtime. */
+static struct string_keyword opt_oem_string_keyword =
+	{ NULL, 11, 0x00 };
+
 static void print_opt_string_list(void)
 {
 	unsigned int i;
@@ -206,6 +211,34 @@ static int parse_opt_string(const char *
 	return -1;
 }
 
+static int parse_opt_oem_string(const char *arg)
+{
+	unsigned long val;
+	char *next;
+
+	if (opt.string)
+	{
+		fprintf(stderr, "Only one string can be specified\n");
+		return -1;
+	}
+
+	/* Return the number of OEM strings */
+	if (strcmp(arg, "count") == 0)
+		goto done;
+
+	val = strtoul(arg, &next, 10);
+	if (next == arg || val == 0x00 || val > 0xff)
+	{
+		fprintf(stderr, "Invalid OEM string number: %s\n", arg);
+		return -1;
+	}
+
+	opt_oem_string_keyword.offset = val;
+done:
+	opt.string = &opt_oem_string_keyword;
+	return 0;
+}
+
 
 /*
  * Command line options handling
@@ -225,6 +258,7 @@ int parse_command_line(int argc, char *
 		{ "dump", no_argument, NULL, 'u' },
 		{ "dump-bin", required_argument, NULL, 'B' },
 		{ "from-dump", required_argument, NULL, 'F' },
+		{ "oem-string", required_argument, NULL, 'O' },
 		{ "no-sysfs", no_argument, NULL, 'S' },
 		{ "version", no_argument, NULL, 'V' },
 		{ NULL, 0, NULL, 0 }
@@ -255,6 +289,11 @@ int parse_command_line(int argc, char *
 					return -1;
 				opt.flags |= FLAG_QUIET;
 				break;
+			case 'O':
+				if (parse_opt_oem_string(optarg) < 0)
+					return -1;
+				opt.flags |= FLAG_QUIET;
+				break;
 			case 't':
 				opt.type = parse_opt_type(opt.type, optarg);
 				if (opt.type == NULL)
@@ -315,6 +354,7 @@ void print_help(void)
 		"     --dump-bin FILE    Dump the DMI data to a binary file\n"
 		"     --from-dump FILE   Read the DMI data from a binary file\n"
 		"     --no-sysfs         Do not attempt to read DMI data from sysfs files\n"
+		"     --oem-string N     Only display the value of the given OEM string\n"
 		" -V, --version          Display the version and exit\n";
 
 	printf("%s", help);
--- dmidecode.orig/dmidecode.c	2017-04-27 16:55:26.011215158 +0200
+++ dmidecode/dmidecode.c	2017-05-01 12:25:35.269804990 +0200
@@ -4555,6 +4555,21 @@ static void dmi_table_string(const struc
 	int key;
 	u8 offset = opt.string->offset;
 
+	if (opt.string->type == 11) /* OEM strings */
+	{
+		if (h->length < 5 || offset > data[4])
+		{
+			fprintf(stderr, "No OEM string number %u\n", offset);
+			return;
+		}
+
+		if (offset)
+			printf("%s\n", dmi_string(h, offset));
+		else
+			printf("%u\n", data[4]);	/* count */
+		return;
+	}
+
 	if (offset >= h->length)
 		return;
 
--- dmidecode.orig/man/dmidecode.8	2015-08-06 12:49:52.339237585 +0200
+++ dmidecode/man/dmidecode.8	2017-05-01 12:07:26.188735324 +0200
@@ -134,13 +134,18 @@ Read the DMI data from a binary file pre
 Do not attempt to read DMI data from sysfs files. This is mainly useful for
 debugging.
 .TP
+.BR "  " "  " "--oem-string N"
+Only display the value of the \s-1OEM\s0 string number \fBN\fR. The first
+\s-1OEM\s0 string has number 1. With special value "count", return the
+number of OEM strings instead.
+.TP
 .BR "-h" ", " "--help"
 Display usage information and exit
 .TP
 .BR "-V" ", " "--version"
 Display the version and exit
 .P
-Options --string, --type and --dump-bin
+Options --string, --type, --dump-bin and --oem-string
 determine the output format and are mutually exclusive.
 .P
 Please note in case of


-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Tue May 09 02:25:18 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1d7yaE-0001nv-Ol
	for mharc-dmidecode-devel@gnu.org; Tue, 09 May 2017 02:25:18 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50566)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1d7yaC-0001nc-9i
	for dmidecode-devel@nongnu.org; Tue, 09 May 2017 02:25:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1d7ya9-0001rX-1N
	for dmidecode-devel@nongnu.org; Tue, 09 May 2017 02:25:16 -0400
Received: from mx2.suse.de ([195.135.220.15]:60676 helo=mx1.suse.de)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1d7ya8-0001qB-RB
	for dmidecode-devel@nongnu.org; Tue, 09 May 2017 02:25:12 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx1.suse.de (Postfix) with ESMTP id 6F8E3AAB9
	for <dmidecode-devel@nongnu.org>; Tue,  9 May 2017 06:25:10 +0000 (UTC)
Message-ID: <1494311108.29333.20.camel@suse.de>
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel <dmidecode-devel@nongnu.org>
Date: Tue, 09 May 2017 08:25:08 +0200
Organization: Suse Linux
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.20.5 
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] dmidecode 3.1 to be released soon
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 09 May 2017 06:25:17 -0000

Hi all,

Version 3.0 of dmidecode was released over one year and a half ago.
Since then a number of bugs have been fixed, and support for SMBIOS
3.1.0 and 3.1.1 has been added. I believe it would be the right time
for a new release. My plans are to release dmidecode 3.1 by the end of
the month (May 2017.)

So I would like to ask everyone to give good testing to the latest git
version [1], especially if you have a very recent machine or are
running a non-Linux operating system, and report any problem found.
Reports that everything works fine are welcome too ;-)

[1]=C2=A0git://git.savannah.gnu.org/dmidecode.git

Thanks,
--=20
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Wed May 24 05:55:57 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dDT1J-0008QQ-Fs
	for mharc-dmidecode-devel@gnu.org; Wed, 24 May 2017 05:55:57 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58698)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1dDT1H-0008Ns-AY
	for dmidecode-devel@nongnu.org; Wed, 24 May 2017 05:55:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1dDT1C-0007bu-Fq
	for dmidecode-devel@nongnu.org; Wed, 24 May 2017 05:55:55 -0400
Received: from mx2.suse.de ([195.135.220.15]:60449 helo=mx1.suse.de)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1dDT1C-0007ax-9a
	for dmidecode-devel@nongnu.org; Wed, 24 May 2017 05:55:50 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx1.suse.de (Postfix) with ESMTP id 04F96ADA9
	for <dmidecode-devel@nongnu.org>; Wed, 24 May 2017 09:55:47 +0000 (UTC)
Date: Wed, 24 May 2017 11:55:46 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170524115546.7412bf77@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] Dmidecode 3.1 has been released
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 24 May 2017 09:55:56 -0000

Hi all,

Dmidecode 3.1 was released yesterday. The changes from 3.0 are as follows:

* Support for SMBIOS 3.1.0 and 3.1.1. This includes new chassis types, new
  processor family names, new processor family upgrade names, and new slot
  types, as well as support of larger BIOS ROM sizes and cache sizes, and a
  new structure type (43, TPM Device.)
* A new command line option to query OEM strings.
* All error messages are now printed on stderr (#47274, #48158.)
* Several bug fixes related to 64-bit entry points (#50037 and more.)
* Important bug fixes:
  #46176 (Unexpected end of file error)
  #46066 (Crash with SIGBUS)
* Various minor fixes, improvements and cleanups.

This new release is available for download from the usual place:
  http://download.savannah.gnu.org/releases/dmidecode/dmidecode-3.1.tar.gz
  http://download.savannah.gnu.org/releases/dmidecode/dmidecode-3.1.tar.gz.sig
  http://download.savannah.gnu.org/releases/dmidecode/dmidecode-3.1.tar.xz
  http://download.savannah.gnu.org/releases/dmidecode/dmidecode-3.1.tar.xz.sig

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Wed May 24 10:04:15 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dDWtb-0007JO-2f
	for mharc-dmidecode-devel@gnu.org; Wed, 24 May 2017 10:04:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38547)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <erwanaliasr1@gmail.com>) id 1dDWtT-0007EP-J0
	for dmidecode-devel@nongnu.org; Wed, 24 May 2017 10:04:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <erwanaliasr1@gmail.com>) id 1dDWtS-0002jx-Ct
	for dmidecode-devel@nongnu.org; Wed, 24 May 2017 10:04:07 -0400
Received: from mail-oi0-x22d.google.com ([2607:f8b0:4003:c06::22d]:36299)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <erwanaliasr1@gmail.com>)
	id 1dDWtS-0002hY-7t
	for dmidecode-devel@nongnu.org; Wed, 24 May 2017 10:04:06 -0400
Received: by mail-oi0-x22d.google.com with SMTP id h4so242477031oib.3
	for <dmidecode-devel@nongnu.org>; Wed, 24 May 2017 07:04:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to; 
	bh=KPktIQBkq8lgP+37ZUWmnETrH/ZrsSqr9cI7IVzTj/M=;
	b=PUedla7vtzgKB8m3eEDpA5T4tPmfxDHYpMDuv/adD0wZe5besZ+OUx98kANrRYaSps
	0/Z8Tn0J6hU0jMv2jxAVUK/RrusE6YJhN/0ybKmHOymtZqylS8CNdH6CI7TZUM+PCZnk
	AS1zm52NCjV80ayMYhKumHDeAPn68kZPLW1SmLOIbbWr/mQuV4hb+leMBUdAu7T7t36z
	rg/aTFkr9mcxY7P/yBdG+L3MFytiQ71w87noaxDIYoTS21cc1Z4mFB/Z5ZqTjnHTIdhL
	/dPqlumJu52PRI0z5ESQRCoYKb9+Mg/i3ZZF4FyWJtC2U9dYqXdQuDV73oMHuk80LQMz
	g5sg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to;
	bh=KPktIQBkq8lgP+37ZUWmnETrH/ZrsSqr9cI7IVzTj/M=;
	b=Bzv3oTXDc/4UfOeN4wxxmLUaQz3f6t7zd8T7pIwp2uSM6/NA0Ybud4tVxbCq09rzOZ
	A1W7Ws4gG/BhQnittDBy44EstzkLaCLcwutN0hVerYGfKneB9JhxP/zEWiDnuiDuncL4
	/V/bbp2tuP++WVnT4zmMzCM28oLAkuGEUJ69+RQgFZYnPJkyf+RPOkJqcwq50twSJeX3
	OtC5DKepkc5YPk7vr/cgmAApOy0nwst6sAOYSzP8grJrj+lihI5CQ28/XTnLZ+IdmrYg
	B1VpkbMs0lvYWWjW0z3t0WkvasGZfXSdohn9eAoo6hPUoheTQBd44hc3Mw4euROv7QQU
	M3Kw==
X-Gm-Message-State: AODbwcCUjiI74uK6IslmCIHk6G3z89OtCfhpmmWDWnBUfhESYDf7w+S6
	Nh/oVivs6RpYBZnlJxeMdYtpkz74TQ==
X-Received: by 10.202.72.17 with SMTP id v17mr17704805oia.78.1495634644515;
	Wed, 24 May 2017 07:04:04 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.157.61.163 with HTTP; Wed, 24 May 2017 07:04:03 -0700 (PDT)
Received: by 10.157.61.163 with HTTP; Wed, 24 May 2017 07:04:03 -0700 (PDT)
In-Reply-To: <20170524115546.7412bf77@endymion>
References: <20170524115546.7412bf77@endymion>
From: Erwan Velu <erwanaliasr1@gmail.com>
Date: Wed, 24 May 2017 16:04:03 +0200
Message-ID: <CAL2JzuxPz6u1tTZ8Q-ZtgGyO5NPG=9YS3qEbGxsyZ3V8ff=C3g@mail.gmail.com>
To: dmidecode-devel@nongnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4003:c06::22d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.21
Subject: Re: [dmidecode] Dmidecode 3.1 has been released
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 24 May 2017 14:04:13 -0000

Thanks for the release !

Le 24 mai 2017 11:55 AM, "Jean Delvare" <jdelvare@suse.de> a =C3=A9crit :

> Hi all,
>
> Dmidecode 3.1 was released yesterday. The changes from 3.0 are as follows=
:
>
> * Support for SMBIOS 3.1.0 and 3.1.1. This includes new chassis types, ne=
w
>   processor family names, new processor family upgrade names, and new slo=
t
>   types, as well as support of larger BIOS ROM sizes and cache sizes, and=
 a
>   new structure type (43, TPM Device.)
> * A new command line option to query OEM strings.
> * All error messages are now printed on stderr (#47274, #48158.)
> * Several bug fixes related to 64-bit entry points (#50037 and more.)
> * Important bug fixes:
>   #46176 (Unexpected end of file error)
>   #46066 (Crash with SIGBUS)
> * Various minor fixes, improvements and cleanups.
>
> This new release is available for download from the usual place:
>   http://download.savannah.gnu.org/releases/dmidecode/dmidecode-3.1.tar.g=
z
>   http://download.savannah.gnu.org/releases/dmidecode/
> dmidecode-3.1.tar.gz.sig
>   http://download.savannah.gnu.org/releases/dmidecode/dmidecode-3.1.tar.x=
z
>   http://download.savannah.gnu.org/releases/dmidecode/
> dmidecode-3.1.tar.xz.sig
>
> --
> Jean Delvare
> SUSE L3 Support
>
> _______________________________________________
> https://lists.nongnu.org/mailman/listinfo/dmidecode-devel
>

