[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [dmidecode] [PATCH] fix 'No SMBIOS nor DMI entry point found' on SMB
From: |
Xie XiuQi |
Subject: |
Re: [dmidecode] [PATCH] fix 'No SMBIOS nor DMI entry point found' on SMBIOS3 |
Date: |
Wed, 21 Oct 2015 17:56:59 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 2015/10/21 17:47, Jean Delvare wrote:
> Hi Xiu Qi,
>
> On Mon, 19 Oct 2015 15:39:35 +0800, Xie XiuQi wrote:
>> address_from_efi may return a smbios or smbios3 format tables,
>> so add this condition.
>
> Thanks for the report and the patch (one comment below.) I do not have
> access to an UEFI-enabled system implementing SMBIOS 3.0 so I did not
> notice the problem.
>
>> Signed-off-by: Xie XiuQi <address@hidden>
>> ---
>> dmidecode.c | 17 +++++++++++++++--
>> 1 file changed, 15 insertions(+), 2 deletions(-)
>>
>> diff --git a/dmidecode.c b/dmidecode.c
>> index f41c85b..cd51f7a 100644
>> --- a/dmidecode.c
>> +++ b/dmidecode.c
>> @@ -4864,8 +4864,21 @@ int main(int argc, char * const argv[])
>> goto exit_free;
>> }
>>
>> - if (smbios_decode(buf, opt.devmem, 0))
>> - found++;
>> + if (memcmp(buf, "_SM3_", 5) == 0)
>> + {
>> + if (smbios3_decode(buf, opt.devmem, 0))
>> + found++;
>> + }
>> + else if (memcmp(buf, "_SM_", 4) == 0)
>> + {
>> + if (smbios_decode(buf, opt.devmem, 0))
>> + found++;
>> + }
>> + else if (memcmp(buf, "_DMI_", 5) == 0)
>> + {
>> + if (legacy_decode(buf, opt.devmem, 0))
>> + found++;
>> + }
>
> This last block should not be needed? SMBIOS 2.0 was released before
> EFI and I do not think EFI supports legacy DMI at all.
Thanks for you comments, I've remove this block.
---
>From ff99c127447d6e6990468b79263bc1879c05b25e Mon Sep 17 00:00:00 2001
From: Xie XiuQi <address@hidden>
Date: Sat, 10 Oct 2015 05:40:40 -0400
Subject: [PATCH] fix 'No SMBIOS nor DMI entry point found' on SMBIOS3
address_from_efi may return a smbios or smbios3 format tables,
so add this condition.
Signed-off-by: Xie XiuQi <address@hidden>
---
dmidecode.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dmidecode.c b/dmidecode.c
index f41c85b..21da758 100644
--- a/dmidecode.c
+++ b/dmidecode.c
@@ -4864,8 +4864,16 @@ int main(int argc, char * const argv[])
goto exit_free;
}
- if (smbios_decode(buf, opt.devmem, 0))
- found++;
+ if (memcmp(buf, "_SM3_", 5) == 0)
+ {
+ if (smbios3_decode(buf, opt.devmem, 0))
+ found++;
+ }
+ else if (memcmp(buf, "_SM_", 4) == 0)
+ {
+ if (smbios_decode(buf, opt.devmem, 0))
+ found++;
+ }
goto done;
memory_scan:
--
1.8.3.1
>
>> goto done;
>>
>> memory_scan:
>
>