Hello community,

here is the log from the commit of package hwinfo for openSUSE:Factory checked 
in at 2017-10-28 14:21:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hwinfo (Old)
 and      /work/SRC/openSUSE:Factory/.hwinfo.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hwinfo"

Sat Oct 28 14:21:12 2017 rev:156 rq:536908 version:21.50

Changes:
--------
--- /work/SRC/openSUSE:Factory/hwinfo/hwinfo.changes    2017-09-13 
21:36:20.203528842 +0200
+++ /work/SRC/openSUSE:Factory/.hwinfo.new/hwinfo.changes       2017-10-28 
14:21:13.192570896 +0200
@@ -1,0 +2,7 @@
+Thu Oct 26 14:22:24 UTC 2017 - wfe...@opensuse.org
+
+- merge gh#openSUSE/hwinfo#54
+- support SMBIOS 3.0 spec (bsc#1062562)
+- 21.50
+
+--------------------------------------------------------------------

Old:
----
  hwinfo-21.49.tar.xz

New:
----
  hwinfo-21.50.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ hwinfo.spec ++++++
--- /var/tmp/diff_new_pack.5crT6X/_old  2017-10-28 14:21:14.368527904 +0200
+++ /var/tmp/diff_new_pack.5crT6X/_new  2017-10-28 14:21:14.372527757 +0200
@@ -36,7 +36,7 @@
 License:        GPL-2.0+
 Group:          Hardware/Other
 Url:            http://gitorious.org/opensuse/hwinfo
-Version:        21.49
+Version:        21.50
 Release:        0
 Source:         %{name}-%{version}.tar.xz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ hwinfo-21.49.tar.xz -> hwinfo-21.50.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.49/VERSION new/hwinfo-21.50/VERSION
--- old/hwinfo-21.49/VERSION    2017-09-12 10:48:46.000000000 +0200
+++ new/hwinfo-21.50/VERSION    2017-10-26 16:22:24.000000000 +0200
@@ -1 +1 @@
-21.49
+21.50
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.49/changelog new/hwinfo-21.50/changelog
--- old/hwinfo-21.49/changelog  2017-09-12 10:48:46.000000000 +0200
+++ new/hwinfo-21.50/changelog  2017-10-26 16:22:24.000000000 +0200
@@ -1,3 +1,6 @@
+2017-10-26:    21.50
+       - support SMBIOS 3.0 spec (bsc #1062562)
+
 2017-06-21:    21.49
        - Ensure /var/lib/hardware/udi exists and with 755 permissions
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.49/src/hd/bios.c 
new/hwinfo-21.50/src/hd/bios.c
--- old/hwinfo-21.49/src/hd/bios.c      2017-09-12 10:48:46.000000000 +0200
+++ new/hwinfo-21.50/src/hd/bios.c      2017-10-26 16:22:24.000000000 +0200
@@ -610,7 +610,8 @@
 void smbios_get_info(hd_data_t *hd_data, memory_range_t *mem, bios_info_t *bt)
 {
   unsigned u, u1, u2, ok, hlen = 0, ofs;
-  unsigned addr = 0, len = 0, scnt;
+  uint64_t addr = 0;
+  unsigned len = 0, scnt;
   unsigned structs = 0, type, slen;
   unsigned use_sysfs = 0;
   char *s;
@@ -657,6 +658,18 @@
   if(!mem->data || mem->size < 0x10) return;
 
   for(u = ok = 0; u <= mem->size - 0x10; u += 0x10) {
+    if(memcmp(mem->data + u, "_SM3_", 5) == 0) {
+      hlen = mem->data[u + 6];
+      if(hlen < 0x18 || u + hlen > mem->size) continue;
+      addr = *(uint64_t *) (mem->data + u + 0x10);
+      len = *(unsigned *) (mem->data + u + 0x0c);      /* Maximum length */
+      structs = 0;                                     /* Unknown */
+      ok = crc(mem->data + u, hlen) == 0 && len;
+      if(ok) {
+        bt->smbios_ver = (mem->data[u + 7] << 8) + mem->data[u + 8];
+        break;
+      }
+    }
     if(*(unsigned *) (mem->data + u) == 0x5f4d535f) {  /* "_SM_" */
       hlen = mem->data[u + 5];
       if(hlen < 0x1e || u + hlen > mem->size) continue;
@@ -687,7 +700,11 @@
 
   hd_data->smbios = smbios_free(hd_data->smbios);
 
-  ADD2LOG("  Found DMI table at 0x%08x (0x%04x bytes)\n", addr, len);
+  // Starting with SMBIOS 3.0, exact table length is not known
+  ADD2LOG(
+    "  Found DMI table at 0x%08llx (0x%04x bytes%s)\n",
+    (unsigned long long) addr, len, structs ? "" : " max"
+  );
 
   memory.start = mem->start + u;
   memory.size = hlen;
@@ -695,6 +712,10 @@
   if(!use_sysfs) dump_memory(hd_data, &memory, 0, "SMBIOS Entry Point");
 
   memory.data = NULL;
+  /*
+   * Note: memory.start is only 32 bit but this will only matter if we have
+   * to read the memory ourself and not via /sys/firmware/dmi/tables.
+   */
   memory.start = addr;
 
   if(use_sysfs) {
@@ -705,7 +726,8 @@
       memory.data = new_mem(memory.size);
       memcpy(memory.data, buf, memory.size);
       ADD2LOG("  Got DMI table from sysfs (0x%04x bytes)\n", memory.size);
-      if(memory.size != len) {
+      // Starting with SMBIOS 3.0, exact table length is not known
+      if(structs && memory.size != len) {
         ADD2LOG("  Oops: DMI table size mismatch; expected 0x%04x bytes!\n", 
len);
       }
     }
@@ -717,16 +739,17 @@
   }
 
   if(len >= 0x4000) {
+    // Starting with SMBIOS 3.0, exact table length is not known
     ADD2LOG(
-      "  SMBIOS Structure Table at 0x%05x (size 0x%x)\n",
-      addr, len
+      "  SMBIOS Structure Table at 0x%08llx (%ssize 0x%x)\n",
+      (unsigned long long) addr, structs ? "" : "maximum ", len
     );
   }
   else {
     dump_memory(hd_data, &memory, 0, "SMBIOS Structure Table");
   }
 
-  for(type = 0, u = 0, ofs = 0; u < structs && ofs + 3 < len; u++) {
+  for(type = 0, u = 0, ofs = 0; (!structs || u < structs) && ofs + 3 < len; 
u++) {
     type = memory.data[ofs];
     slen = memory.data[ofs + 1];
     if(ofs + slen > len || slen < 4) break;
@@ -764,7 +787,8 @@
     }
   }
 
-  if(u != structs) {
+  // Starting with SMBIOS 3.0, structure count is not announced
+  if(structs && u != structs) {
     if(type == sm_end) {
       ADD2LOG("  smbios: stopped at end tag\n");
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.49/src/hd/hd.h new/hwinfo-21.50/src/hd/hd.h
--- old/hwinfo-21.49/src/hd/hd.h        2017-09-12 10:48:46.000000000 +0200
+++ new/hwinfo-21.50/src/hd/hd.h        2017-10-26 16:22:24.000000000 +0200
@@ -20,7 +20,7 @@
 
 /** Interface version */
 #define HD_VERSION     21
-#define HD_MINOR_VERSION       49
+#define HD_MINOR_VERSION       50
 #define HD_FULL_VERSION                (HD_VERSION * 1000 + HD_MINOR_VERSION)
 
 /**


Reply via email to