forked from pool/hwinfo
Accepting request 226706 from system:install:head
- Show Consistant Device Name (CDN) as Device Name. The Device name of a PCI or PCI Express device under OS may be exported by BIOS via label sysfs attribute. Read it and show it to the user as "Device Name:" fate#316031, fate#315201 Add: hwinfo_pci_scan_label.patch (forwarded request 215318 from trenn) OBS-URL: https://build.opensuse.org/request/show/226706 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/hwinfo?expand=0&rev=118
This commit is contained in:
commit
5b4fe6f852
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 27 19:32:58 UTC 2014 - trenn@suse.de
|
||||
|
||||
- Show Consistant Device Name (CDN) as Device Name.
|
||||
The Device name of a PCI or PCI Express device under OS may be exported
|
||||
by BIOS via label sysfs attribute. Read it and show it to the user as
|
||||
"Device Name:"
|
||||
fate#316031, fate#315201
|
||||
Add: hwinfo_pci_scan_label.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 27 16:00:22 CET 2013 - snwint@suse.de
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package hwinfo
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2014 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
|
||||
@ -16,6 +16,7 @@
|
||||
#
|
||||
|
||||
|
||||
|
||||
Name: hwinfo
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: flex
|
||||
@ -39,6 +40,7 @@ Url: http://gitorious.org/opensuse/hwinfo
|
||||
Version: 21.0
|
||||
Release: 0
|
||||
Source: hwinfo-21.0.tar.bz2
|
||||
Patch0: hwinfo_pci_scan_label.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
@ -73,6 +75,7 @@ system.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
make static
|
||||
|
61
hwinfo_pci_scan_label.patch
Normal file
61
hwinfo_pci_scan_label.patch
Normal file
@ -0,0 +1,61 @@
|
||||
Index: hwinfo-21.0/src/hd/hd.h
|
||||
===================================================================
|
||||
--- hwinfo-21.0.orig/src/hd/hd.h
|
||||
+++ hwinfo-21.0/src/hd/hd.h
|
||||
@@ -1047,6 +1047,7 @@ typedef struct s_pci_t {
|
||||
char *sysfs_id; /**< sysfs path */
|
||||
char *sysfs_bus_id; /**< sysfs bus id */
|
||||
char *modalias; /**< module alias */
|
||||
+ char *label; /**< Consistant Device Name (CDN), pci firmware spec 3.1, chapter 4.6.7 */
|
||||
unsigned edid_len[4]; /**< edid record length */
|
||||
unsigned char edid_data[4][0x80]; /**< edid record */
|
||||
} pci_t;
|
||||
@@ -2583,6 +2584,7 @@ typedef struct s_hd_t {
|
||||
hal_prop_t *persistent_prop; /**< persistent property list */
|
||||
|
||||
char *modalias; /**< module alias */
|
||||
+ char *label; /**< Consistent Device Name (CDN), pci firmware spec 3.1, chapter 4.6.7 */
|
||||
|
||||
/*
|
||||
* These are used internally for memory management.
|
||||
Index: hwinfo-21.0/src/hd/pci.c
|
||||
===================================================================
|
||||
--- hwinfo-21.0.orig/src/hd/pci.c
|
||||
+++ hwinfo-21.0/src/hd/pci.c
|
||||
@@ -192,6 +192,11 @@ void hd_pci_read_data(hd_data_t *hd_data
|
||||
pci->irq = ul0;
|
||||
}
|
||||
|
||||
+ if((s = get_sysfs_attr_by_path(sf_dev, "label"))) {
|
||||
+ pci->label = canon_str(s, strlen(s));
|
||||
+ ADD2LOG(" label = \"%s\"\n", pci->label);
|
||||
+ }
|
||||
+
|
||||
sl = hd_attr_list(get_sysfs_attr_by_path(sf_dev, "resource"));
|
||||
for(u = 0; sl; sl = sl->next, u++) {
|
||||
if(
|
||||
@@ -432,6 +437,11 @@ void hd_pci_complete_data(hd_t *hd)
|
||||
pci->modalias = NULL;
|
||||
}
|
||||
|
||||
+ if(pci->label && *pci->label) {
|
||||
+ hd->label = pci->label;
|
||||
+ pci->label = NULL;
|
||||
+ }
|
||||
+
|
||||
hd->slot = pci->slot + (pci->bus << 8);
|
||||
hd->func = pci->func;
|
||||
hd->base_class.id = pci->base_class;
|
||||
Index: hwinfo-21.0/src/hd/hdp.c
|
||||
===================================================================
|
||||
--- hwinfo-21.0.orig/src/hd/hdp.c
|
||||
+++ hwinfo-21.0/src/hd/hdp.c
|
||||
@@ -357,6 +357,8 @@ void dump_normal(hd_data_t *hd_data, hd_
|
||||
hd_detail_monitor_t *mdetail;
|
||||
static char *geo_type_str[] = { "Physical", "Logical", "BIOS EDD", "BIOS Legacy" };
|
||||
|
||||
+ if(h->label) dump_line("Device Name: \"%s\"\n", h->label);
|
||||
+
|
||||
if(h->model) dump_line("Model: \"%s\"\n", h->model);
|
||||
|
||||
s = NULL;
|
Loading…
x
Reference in New Issue
Block a user