Hello community,

here is the log from the commit of package hwinfo for openSUSE:Factory checked 
in at 2015-10-14 16:35:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hwinfo (Old)
 and      /work/SRC/openSUSE:Factory/.hwinfo.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hwinfo"

Changes:
--------
--- /work/SRC/openSUSE:Factory/hwinfo/hwinfo.changes    2015-09-24 
07:18:20.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.hwinfo.new/hwinfo.changes       2015-10-14 
16:35:03.000000000 +0200
@@ -1,0 +2,13 @@
+Fri Oct  9 12:43:18 UTC 2015 - [email protected]
+
+- scsi serial id: read vpd page 0x80 from sysfs, if possible (bsc#949287)
+- 21.23
+
+-------------------------------------------------------------------
+Tue Sep 29 09:21:03 UTC 2015 - [email protected]
+
+- Add a general README.md
+- Split README into README-legacy and README-hwprobe
+- 21.22
+
+-------------------------------------------------------------------

Old:
----
  hwinfo-21.21.tar.xz

New:
----
  hwinfo-21.23.tar.xz

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

Other differences:
------------------
++++++ hwinfo.spec ++++++
--- /var/tmp/diff_new_pack.bc47Tc/_old  2015-10-14 16:35:04.000000000 +0200
+++ /var/tmp/diff_new_pack.bc47Tc/_new  2015-10-14 16:35:04.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package hwinfo
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -36,7 +36,7 @@
 Group:          Hardware/Other
 # Until migration to github this should be correct url
 Url:            http://gitorious.org/opensuse/hwinfo
-Version:        21.21
+Version:        21.23
 Release:        0
 Source:         %{name}-%{version}.tar.xz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -107,7 +107,9 @@
 /usr/sbin/mk_isdnhwdb
 /usr/sbin/getsysinfo
 %{_libdir}/libhd.so.*
-%doc README
+%doc README.md
+%doc README-hwprobe.md
+%doc README-legacy.md
 %doc %{_mandir}/man1/getsysinfo.1*
 %doc %{_mandir}/man1/mk_isdnhwdb.1*
 %doc %{_mandir}/man8/hwinfo.8*

++++++ hwinfo-21.21.tar.xz -> hwinfo-21.23.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.21/README new/hwinfo-21.23/README
--- old/hwinfo-21.21/README     2015-09-17 13:20:32.000000000 +0200
+++ new/hwinfo-21.23/README     1970-01-01 01:00:00.000000000 +0100
@@ -1,143 +0,0 @@
-See hwinfo man page for general usage instructions.
-
-This document describes some legacy features and the "hwprobe" environment 
variable.
-
-
-1. Legacy
-=========
-
-***  Note: please do not do this, this is only kept to assist debugging.  ***
-
-Legacy mode is activated when no option starting with "--" is given. In this 
case hwinfo
-works as follows:
-
-  hwinfo [debug=deb_flag] [log=log_file] [list[+]=hw_item] 
[[+|-]probe_option1] [[+|-]probe_option2] ...
-
-Examples:
-
-  hwinfo
-    - probes for nearly everything
-
-  hwinfo +all
-    - probes for everything
-
-  hwinfo log=hw_log
-    - default probing, output is written to hw_log
-      *** Please don't use "hwinfo >some_log 2>&1" to store the output into a
-      log file! ***
-
-  hwinfo -all +pci +int
-    - probe for pci devices
-
-Note that "int" should almost always be active.
-
-Some probing flags do not stand for complete modules but enable additional
-features; e.g. "bios.vesa" or "block.cdrom".
-
-Example:
-  hwinfo -all +block +int
-  gives a list of all block devs
-
-  hwinfo -all +block.cdrom +int
-  additionally reads the iso9660 info
-
-The list of supported flags varies from version to version. To get a list of
-the actual set of probing flags, call "hwinfo -all" and look at the top of
-the log.
-
-
-2. Environment variable/kernel cmdline parameter
-================================================
-
-You can control the hardware probing using the environment variable
-"hwprobe" and the kernel cmdline parameter "hwprobe".
-
-If "hwprobe" is set on the kernel cmdline, the environment variable
-"hwprobe" is ignored. Otherwise, the meaning of both is exactly the same.
-
-  hwprobe
-    - Controls which probing flags should *always* be set/cleared. (These
-      settings *cannot* be overridden by command line switches.)
-
-      Examples:
-        hwprobe=-isapnp
-          o *never* do any isapnp probing
-
-        hwprobe=-braille,-modem
-          o don't look for braille displays & modems
-
-    - Allows you to add and remove hardware from the probing results. In this 
case
-      the syntax is (-: remove, +: add at end of list, <nothing>: add at begin 
of
-      list):
-        hwprobe=[+-]<device_class>:<vendor_id>:<device_id>[:<unix_device_file>]
-
-      <device_class>, <vendor_id> and <device_id> are device ids as used by 
libhd.
-      See the output of hwinfo for examples. In connection with "-", you can 
use
-      "*" as a placeholder that matches every id.
-
-      Note: <unix_device_file> is optional.
-
-      Note2: you cannot usefully *add* hardware that needs more info than that
-      given by the hwprobe entry. Disks & floppies are notable examples.
-      (But you can *remove* them.)
-
-      Here is a typical hwinfo output for a mouse, with the relevant ids
-      underlined (<device_class> is the combined base_class & sub_class),
-      [see 1st example below]:
-
-        14: PS/2 00.0: 10500 PS/2 Mouse
-                       ^^^^^ -->       <device_class>
-          [Created at mouse.110]
-          Vendor: s0200 "Unknown"
-                  ^^^^^  -->           <vendor_id>
-          Model: 0002 "Generic PS/2 Mouse"
-                 ^^^^  -->             <device_id>
-          Device File: /dev/psaux
-                       ^^^^^^^^^^ -->  <unix_device_file>
-          Driver Info #0:
-            XFree86 Protocol: ps/2
-            GPM Protocol: ps2
-          Attached to: #8 (PS/2 Controller)
-
-
-      Examples:
-        hwprobe=+10500:s200:2:/dev/psaux
-          o add a ps/2 mouse [at the end of the hardware list]
-
-        hwprobe=10500:s200:2:/dev/psaux
-          o add a ps/2 mouse [at the start of the hardware list, so it
-            is our default mouse]
-
-        hwprobe=+10b00:s5001:0:/dev/ttyS0
-          o add a braille display connected to /dev/ttyS0
-
-        hwprobe=-10500:s200:2:/dev/psaux
-          o remove ps/2 mice attached to /dev/psaux
-
-        hwprobe=-10500:s200:2
-          o remove all ps/2 mice
-
-        hwprobe=-10500:*:*
-          o remove all ps/2 mice
-
-        hwprobe=-*:*:*:/dev/hdc
-          o remove /dev/hdc
-
-        hwprobe=+401:1274:5000
-          o add an ensoniq sound card
-
-      Grafics cards are are slightly trickier:
-
-        hwprobe=+300:1014:b7
-          o add a Fire GL1 card
-            Note: this way you'll get a multihead config. You'll probably
-            rather want the following example.
-
-        hwprobe=-300:*:*,+300:1014:b7
-          o remove all graphics cards; then add a Fire GL1 card
-
-        hwprobe=+400:121a:1
-          o add a 3fx voodoo card (Note the class "400", not "300"!)
-
-    - for more ids, see "src/ids/names.*" and "src/ids/drivers.*"
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.21/README-hwprobe.md 
new/hwinfo-21.23/README-hwprobe.md
--- old/hwinfo-21.21/README-hwprobe.md  1970-01-01 01:00:00.000000000 +0100
+++ new/hwinfo-21.23/README-hwprobe.md  2015-10-09 14:41:05.000000000 +0200
@@ -0,0 +1,96 @@
+# hwprobe environment variable/kernel cmdline parameter
+
+This document describes the `hwprobe` environment variable/kernel cmdline
+parameter.
+
+You can control the hardware probing using the environment variable
+`hwprobe` and the kernel cmdline parameter `hwprobe`.
+
+If `hwprobe` is set on the kernel cmdline, the environment variable
+`hwprobe` is ignored. Otherwise, the meaning of both is exactly the same.
+
+## Controlling probing flags
+
+`hwprobe` controls which probing flags should *always* be set/cleared (These
+settings *cannot* be overridden by command line switches). Examples:
+
+* `hwprobe=-isapnp` - *never* do any isapnp probing
+* `hwprobe=-braille,-modem` - don't look for braille displays & modems
+
+## Adding/removing hardware from results
+
+`hwprobe` allows you to add and remove hardware from the probing results. In
+this case the syntax is (-: remove, +: add at end of list, `<nothing>`: add at
+begin of list):
+
+    hwprobe=[+-]<device_class>:<vendor_id>:<device_id>[:<unix_device_file>]
+
+`<device_class>`, `<vendor_id>` and `<device_id>` are device ids as used by
+libhd. See the output of `hwinfo` for examples. In connection with `-`, you can
+use `*` as a placeholder that matches every id.
+
+Note: `<unix_device_file>` is optional.
+
+Note2: you cannot usefully *add* hardware that needs more info than that
+given by the `hwprobe` entry. Disks & floppies are notable examples.
+(But you can *remove* them.)
+
+Here is a typical `hwinfo` output for a mouse, with the relevant ids
+underlined (`<device_class>` is the combined `base_class` & `sub_class`),
+(see 1st example below):
+
+        14: PS/2 00.0: 10500 PS/2 Mouse
+                       ^^^^^ -->       <device_class>
+          [Created at mouse.110]
+          Vendor: s0200 "Unknown"
+                  ^^^^^  -->           <vendor_id>
+          Model: 0002 "Generic PS/2 Mouse"
+                 ^^^^  -->             <device_id>
+          Device File: /dev/psaux
+                       ^^^^^^^^^^ -->  <unix_device_file>
+          Driver Info #0:
+            XFree86 Protocol: ps/2
+            GPM Protocol: ps2
+          Attached to: #8 (PS/2 Controller)
+
+Examples:
+
+        hwprobe=+10500:s200:2:/dev/psaux
+          o add a ps/2 mouse [at the end of the hardware list]
+
+        hwprobe=10500:s200:2:/dev/psaux
+          o add a ps/2 mouse [at the start of the hardware list, so it
+            is our default mouse]
+
+        hwprobe=+10b00:s5001:0:/dev/ttyS0
+          o add a braille display connected to /dev/ttyS0
+
+        hwprobe=-10500:s200:2:/dev/psaux
+          o remove ps/2 mice attached to /dev/psaux
+
+        hwprobe=-10500:s200:2
+          o remove all ps/2 mice
+
+        hwprobe=-10500:*:*
+          o remove all ps/2 mice
+
+        hwprobe=-*:*:*:/dev/hdc
+          o remove /dev/hdc
+
+        hwprobe=+401:1274:5000
+          o add an ensoniq sound card
+
+Graphics cards are slightly trickier:
+
+        hwprobe=+300:1014:b7
+          o add a Fire GL1 card
+            Note: this way you'll get a multihead config. You'll probably
+            rather want the following example.
+
+        hwprobe=-300:*:*,+300:1014:b7
+          o remove all graphics cards; then add a Fire GL1 card
+
+        hwprobe=+400:121a:1
+          o add a 3fx voodoo card (Note the class "400", not "300"!)
+
+For more ids, see `src/ids/names.*` and `src/ids/drivers.*`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.21/README-legacy.md 
new/hwinfo-21.23/README-legacy.md
--- old/hwinfo-21.21/README-legacy.md   1970-01-01 01:00:00.000000000 +0100
+++ new/hwinfo-21.23/README-legacy.md   2015-10-09 14:41:05.000000000 +0200
@@ -0,0 +1,37 @@
+# Legacy
+
+This document describes some legacy features.
+
+__Note: please do not do this, this is only kept to assist debugging.__
+
+Legacy mode is activated when no option starting with "--" is given. In this 
case hwinfo
+works as follows:
+
+    hwinfo [debug=deb_flag] [log=log_file] [list[+]=hw_item] 
[[+|-]probe_option1] [[+|-]probe_option2] ...
+
+Examples:
+
+* `hwinfo` - probes for nearly everything
+* `hwinfo +all` - probes for everything
+* `hwinfo log=hw_log` - default probing, output is written to hw_log. Please
+  don't use `hwinfo >some_log 2>&1` to store the output into a log file!
+* `hwinfo -all +pci +int` - probe for pci devices
+
+Note that `int` should almost always be active.
+
+Some probing flags do not stand for complete modules but enable additional
+features; e.g. `bios.vesa` or `block.cdrom`.
+
+Example:
+
+    hwinfo -all +block +int
+
+gives a list of all block devs
+
+    hwinfo -all +block.cdrom +int
+
+additionally reads the iso9660 info.
+
+The list of supported flags varies from version to version. To get a list of
+the actual set of probing flags, call `hwinfo -all` and look at the top of
+the log.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.21/README.md new/hwinfo-21.23/README.md
--- old/hwinfo-21.21/README.md  1970-01-01 01:00:00.000000000 +0100
+++ new/hwinfo-21.23/README.md  2015-10-09 14:41:05.000000000 +0200
@@ -0,0 +1,21 @@
+# hwinfo
+
+## About hwinfo
+
+_hwinfo_ is used to probe for the hardware present in the system. It can be
+used to generate a system overview log which can be later used for support.
+
+For general usage instructions, see `hwinfo` manual page. Additional 
documentation
+about [legacy 
features](https://github.com/openSUSE/hwinfo/blob/master/README-legacy.md)
+and [hwprobe environment 
variable](https://github.com/openSUSE/hwinfo/blob/master/README-hwprobe.md)
+is available in this repository.
+
+## openSUSE Development
+
+The package is automatically submitted from the `master` branch to
+[system:install:head](https://build.opensuse.org/package/show/system:install:head/hwinfo)
+OBS project. From that place it is forwarded to
+[openSUSE Factory](https://build.opensuse.org/project/show/openSUSE:Factory).
+
+You can find more information about this workflow in the [linuxrc-devtools
+documentation](https://github.com/openSUSE/linuxrc-devtools#opensuse-development).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.21/VERSION new/hwinfo-21.23/VERSION
--- old/hwinfo-21.21/VERSION    2015-09-17 13:20:32.000000000 +0200
+++ new/hwinfo-21.23/VERSION    2015-10-09 14:41:05.000000000 +0200
@@ -1 +1 @@
-21.21
+21.23
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.21/changelog new/hwinfo-21.23/changelog
--- old/hwinfo-21.21/changelog  2015-09-17 13:20:32.000000000 +0200
+++ new/hwinfo-21.23/changelog  2015-10-09 14:41:05.000000000 +0200
@@ -1,3 +1,10 @@
+2015-10-09:    21.23
+       - scsi serial id: read vpd page 0x80 from sysfs, if possible (bsc 
#949287)
+
+2015-09-28:    21.22
+       - Add a general README.md
+       - Split README into README-legacy and README-hwprobe
+
 2015-09-17:    21.21
        - adjust disk device info gathering after nvme driver change (bsc 
#943008)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.21/src/hd/block.c 
new/hwinfo-21.23/src/hd/block.c
--- old/hwinfo-21.21/src/hd/block.c     2015-09-17 13:20:32.000000000 +0200
+++ new/hwinfo-21.23/src/hd/block.c     2015-10-09 14:41:05.000000000 +0200
@@ -992,33 +992,82 @@
       str_printf(&pr_str, 0, "%s serial", hd->unix_dev_name);
       PROGRESS(5, 2, pr_str);
 
+      char *serial_buf = NULL;
+      unsigned serial_buf_len = 0;
       memset(scsi_cmd_buf, 0, sizeof scsi_cmd_buf);
-      memset(&hdr, 0, sizeof(hdr));
 
-      hdr.interface_id = 'S';
-      hdr.cmd_len = 6;
-      hdr.dxfer_direction = SG_DXFER_FROM_DEV;
-      hdr.dxferp = scsi_cmd_buf + 8 + 6;
-      hdr.dxfer_len = 0x24;
-      hdr.cmdp = scsi_cmd_buf + 8;
-      hdr.cmdp[0] = 0x12;
-      hdr.cmdp[1] = 0x01;
-      hdr.cmdp[2] = 0x80;
-      hdr.cmdp[4] = 0x24;
- 
-      k = ioctl(fd, SG_IO, &hdr);
+      // get the page from sysfs, if it's there already
+      if(hd->sysfs_device_link) {
+        char *path = NULL;
+
+        str_printf(&path, 0, "/sys/%s/vpd_pg80", hd->sysfs_device_link);
+
+        int fd = open(path, O_RDONLY);
+        if(fd >= 0) {
+          serial_buf = scsi_cmd_buf;
+          int i = read(fd, scsi_cmd_buf, sizeof scsi_cmd_buf - 1);
+          close(fd);
+          if(i > 0) serial_buf_len = i;
+        }
+
+        path = free_mem(path);
+      }
+
+      // ... else go and fetch it
+      if(!serial_buf) {
+        memset(scsi_cmd_buf, 0, sizeof scsi_cmd_buf);
+        memset(&hdr, 0, sizeof(hdr));
+
+        hdr.interface_id = 'S';
+        hdr.cmd_len = 6;
+        hdr.dxfer_direction = SG_DXFER_FROM_DEV;
+        hdr.dxferp = scsi_cmd_buf + 8 + 6;
+        hdr.dxfer_len = 0x24;
+        hdr.cmdp = scsi_cmd_buf + 8;
+        hdr.cmdp[0] = 0x12;
+        hdr.cmdp[1] = 0x01;
+        hdr.cmdp[2] = 0x80;
+        hdr.cmdp[4] = 0x24;
 
-      if(k) {
-        ADD2LOG("%s status(0x12) 0x%x\n", scsi->dev_name, k);
+        k = ioctl(fd, SG_IO, &hdr);
+
+        if(k) {
+          ADD2LOG("%s status(0x12) 0x%x\n", scsi->dev_name, k);
+        }
+        else {
+          serial_buf = hdr.dxferp;
+          serial_buf_len = serial_buf[3] + 4;
+        }
       }
       else {
-        unsigned char *ptr = hdr.dxferp;
+        ADD2LOG("  got it from vpd_pg80\n");
+      }
+
+      // sanity check: serial_buf[3] holds the lenght of user data starting at 
offset 4
+      if(serial_buf_len < 4 || serial_buf_len < serial_buf[3] + 4) serial_buf 
= NULL;
 
-        ADD2LOG("  serial id len: %u\n", ptr[3]);
+      if(serial_buf) {
+        unsigned u;
 
-        if((hd->serial = canon_str(ptr + 4, ptr[3]))) {
-          if(!*hd->serial) hd->serial = free_mem(hd->serial);
+        ADD2LOG("  serial id len: %u\n", serial_buf[3]);
+
+        for(u = 0; u < serial_buf_len; u += 0x10) {
+          ADD2LOG("    ");
+          hd_log_hex(hd_data, 1, serial_buf_len - u >= 0x10 ? 0x10 : 
serial_buf_len - u, serial_buf + u);
+          ADD2LOG("\n");
         }
+
+        if((hd->serial = canon_str(serial_buf + 4, serial_buf[3]))) {
+          if(!*hd->serial) {
+            hd->serial = free_mem(hd->serial);
+          }
+          else {
+            ADD2LOG("  serial id: \"%s\"\n", hd->serial);
+          }
+        }
+      }
+      else {
+        ADD2LOG("  no serial id\n");
       }
 
       str_printf(&pr_str, 0, "%s model", hd->unix_dev_name);


Reply via email to