public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Allen Hung <allen_hung@Dell.com>
To: "Limonciello, Mario" <Mario_Limonciello@Dell.com>,
	Jean Delvare <jdelvare@suse.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting oem strings to sysfs
Date: Wed, 24 Aug 2016 16:05:43 +0800	[thread overview]
Message-ID: <57BD5557.3040600@dell.com> (raw)
In-Reply-To: <57B19185.40304@dell.com>

On 08/15/2016 05:55 PM, Allen Hung wrote:
> On 08/03/2016 02:56 AM, Limonciello, Mario wrote:
>>> -----Original Message-----
>>> From: Jean Delvare [mailto:jdelvare@suse.de]
>>> Sent: Tuesday, August 2, 2016 8:43 AM
>>> To: Limonciello, Mario <Mario_Limonciello@Dell.com>
>>> Cc: Hung, Allen <Allen_Hung@Dell.com>; linux-kernel@vger.kernel.org
>>> Subject: Re: [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting oem
>>> strings to sysfs
>>>
>>> Hi Mario, Allen,
>>>
>>> On Tue, 19 Jul 2016 14:47:57 +0000, Mario_Limonciello@Dell.com wrote:
>>>> Hi Jean,
>>>>
>>>> I worked with Allen on this concept, so I've got some comments below.
>>>>
>>>>> -----Original Message-----
>>>>> From: Jean Delvare [mailto:jdelvare@suse.de]
>>>>> Sent: Tuesday, July 19, 2016 4:03 AM
>>>>> To: Hung, Allen <Allen_Hung@Dell.com>
>>>>> Cc: Jean Delvare <jdelvare@suse.com>; linux-kernel@vger.kernel.org;
>>>>> Limonciello, Mario <Mario_Limonciello@Dell.com>
>>>>> Subject: Re: [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting
>>> oem
>>>>> strings to sysfs
>>>>>
>>>>> Hello Allen,
>>>>>
>>>>> On Thu, 14 Jul 2016 16:01:23 +0800, Allen Hung wrote:
>>>>>> The oem strings in DMI system identification information of the BIOS
>>> have
>>>>>> been parsed and stored as dmi devices in dmi_scan.c but they are not
>>>>>> exported to userspace via sysfs.
>>>>>
>>>>> They are intended for internal consumption by the kernel drivers.
>>>>>
>>>>>> The patch intends to export oem strings to sysfs device
>>> /sys/class/dmi/id.
>>>>>> As the number of oem strings are dynamic, a group "oem" is added to
>>> the
>>>>>> device and the strings will be added to the group as string1, string2, ...,
>>>>>> and stringN.
>>>>>
>>>>> What is the use case? You can already get these strings easily using
>>>>> dmidecode:
>>>>>
>>>>> # dmidecode -qt 11
>>>>> OEM Strings
>>>>> 	String 1: Dell System
>>>>> 	String 2: 1[05A4]
>>>>> 	String 3: 3[1.0]
>>>>> 	String 4: 12[www.dell.com]
>>>>> 	String 5: 14[1]
>>>>> 	String 6: 15[3]
>>>>> 	String 7:
>>>>>
>>>>> If needed, a dedicated option could be added to dmidecode to extract
>>>>> specific OEM strings. Or existing option -s could be extended for that
>>>>> purpose.
>>>>
>>>> The main purpose was to be able to parse these easily from userspace
>>>> without needing dmidecode installed and handling its output
>>>> (with tools such as grep, sed, and awk).
>>>
>>> As I just stated above: dmidecode could be extended to extract the oem
>>> strings directly if there is a need for it.
>>>
>>>> For example in an initramfs, typically dmidecode isn't included, but there
>>>> is value to being able to make decisions on things related to the values of
>>>> those OEM strings.
>>>
>>> dmidecode is not included because nobody needs it. If you need it, you
>>> can include it. 15 years ago, udev was not included in initramfs
>>> either. But we still decided that this stuff should be done in
>>> user-space and we wrote udev and added it to initramfs. It is in the
>>> nature of initramfs to evolve with new needs, and to only include what
>>> is needed on a given machine. mkinitrd/dracut checks the needs
>>> dynamically. Why would it not work in your case?
>>>
>>> I would appreciate more details than "there is value..." I would like
>>> to hear about an actual use case.
>>>
>>>> Instead this allows userspace to iterate the oem/ directory and directly
>>>> look at the values of these strings.
>>>
>>> At the cost of code which will run at every boot, and kernel memory
>>> which will be used forever, on all systems. This is why I am reluctant.
>>> You don't put things in the kernel because this is the easiest way to
>>> fulfill your immediate need. You put things in the kernel because you
>>> absolutely have to, or at the very least because it is where it makes
>>> the most sense. At this point I am not convinced this is the case here.
>>> I see no reason why the same can't be implemented easily in user-space
>>> (dmidecode and dracut.)
>>
>> Thanks, when you put it this way your reluctance makes a lot more sense.
>> I don't disagree that this could live in several different levels of the software
>> stack.
>>
>> The main reason that we want to have OEM tags exported is to access one
>> particular OEM strings on Dell systems from userspace applications that should
>> run on Dell systems (not just the initramfs).
>>
>> There is string  that indicates that the system is a Dell System.  Normally this
>> would be obvious from other SMBIOS strings (such as System Vendor)
>> but Dell also does "OEM systems", which means that they might have 
>> custom branding applied that has otherwise removed the Vendor and
>> Product information.
>>
>> Other strings indicate information that can be used to determine the
>> original product model number and lots of other details.
>>
>> On a system like this it's not possible to know it's a Dell system and what
>> model it was before rebranding without looking at the OEM strings.
>>
>> So by exporting the OEM strings from sysfs, it's possible to accurately 
>> identify Dell systems regardless of whether they have custom branding
>> applied without needing to rely on calling dmidecode.
>>
> Hi Jean,
> 
> I revised the patch to turn the exporting of OEM strings into a sub-option under 
> config DMIID and is disabled by default. We can turn on this kernel option only on
> the systems Dell is going to ship, and it will not waste any memory on other systems
> unless it is otherwise enabled. We don't disagree this is not a must in kernel but
> the revised patch is meant to retain the value Mario wrote above, and to avoid the
> waste on the systems those don't need it. Also, the file permissions are adjusted 
> as 0400.
> It was sent with the same title with the tag prefix "[PATCH v3 2/2] ..." in prefix.
> 
> Regards,
> Allen
> 
Hi Jean,

Please let us know if you have feedbacks on my patch "[PATCH v3 2/2] dmi-id: add 
dmi/id/oem group for exporting oem strings to sysfs" sent on August 15.

Regards,
Allen

  reply	other threads:[~2016-08-24  8:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14  8:01 [PATCH 0/2] dmi-id: export oem strings to sysfs Allen Hung
2016-07-14  8:01 ` [PATCH 1/2] dmi-id: don't free dev structure after calling device_register Allen Hung
2016-07-18 17:09   ` Jean Delvare
2016-07-14  8:01 ` [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting oem strings to sysfs Allen Hung
2016-07-14  9:16   ` kbuild test robot
2016-07-19  9:03   ` Jean Delvare
2016-07-19 14:47     ` Mario_Limonciello
2016-08-02 13:43       ` Jean Delvare
2016-08-02 18:56         ` Mario_Limonciello
2016-08-15  9:55           ` Allen Hung
2016-08-24  8:05             ` Allen Hung [this message]
2016-07-26 21:03     ` Mario_Limonciello
2016-07-29  9:59       ` Allen Hung
  -- strict thread matches above, loose matches on Subject: below --
2016-07-15  9:42 [PATCH 0/2] dmi-id: export " Allen Hung
2016-07-15  9:42 ` [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting " Allen Hung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57BD5557.3040600@dell.com \
    --to=allen_hung@dell.com \
    --cc=Mario_Limonciello@Dell.com \
    --cc=jdelvare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox