diff options
author | Leon Anavi <leon.anavi@konsulko.com> | 2020-08-25 12:54:06 +0300 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-08-25 11:24:58 -0700 |
commit | 354c2add85741bd99b5918a7068019b2a9a034c1 (patch) | |
tree | e65f8d8edf1358be6ba42cc567bcff89dd14c77f /meta-oe/recipes-devtools/lshw | |
parent | af306b7f7f53cd8574d095effdea9fae5b303d38 (diff) | |
download | meta-openembedded-354c2add85741bd99b5918a7068019b2a9a034c1.tar.gz |
lshw: Upgrade 2.18 -> 2.19
Upgrade to release B.02.19:
- detection of NVMe disks
- detection of SD/MMC and SDIO devices
- bug fixes
- code cleanup
- updated data files
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/lshw')
-rw-r--r-- | meta-oe/recipes-devtools/lshw/files/0001-Fix-musl-build.patch | 125 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/lshw/files/0001-Makefile-Fix-cross-compilation.patch | 57 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/lshw/files/0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch | 34 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/lshw/files/0003-sysfs-Fix-basename-build-with-musl.patch | 92 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/lshw/lshw_02.19.2.bb (renamed from meta-oe/recipes-devtools/lshw/lshw_02.18.bb) | 8 |
5 files changed, 128 insertions, 188 deletions
diff --git a/meta-oe/recipes-devtools/lshw/files/0001-Fix-musl-build.patch b/meta-oe/recipes-devtools/lshw/files/0001-Fix-musl-build.patch new file mode 100644 index 000000000..fa90aa121 --- /dev/null +++ b/meta-oe/recipes-devtools/lshw/files/0001-Fix-musl-build.patch | |||
@@ -0,0 +1,125 @@ | |||
1 | From a5a4bb4254b2109bd3e272174946f0bb36ee99a8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Leon Anavi <leon.anavi@konsulko.com> | ||
3 | Date: Tue, 25 Aug 2020 11:45:45 +0300 | ||
4 | Subject: [PATCH] Fix musl build | ||
5 | |||
6 | Apply the following fixes for musl: | ||
7 | |||
8 | - Fix basename() is in libgen.h | ||
9 | - Fix wrong usage of LONG_BIT | ||
10 | |||
11 | Same fixes have been submitted to the upstream of lshw by Sergio | ||
12 | Prado but they have not been merged yet. | ||
13 | |||
14 | Upstream-Status: Submitted | ||
15 | |||
16 | Co-Authored-By: Sergio Prado <sergio.prado@e-labworks.com> | ||
17 | Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> | ||
18 | --- | ||
19 | src/core/abi.cc | 4 +--- | ||
20 | src/core/sysfs.cc | 19 ++++++++++--------- | ||
21 | 2 files changed, 11 insertions(+), 12 deletions(-) | ||
22 | |||
23 | diff --git a/src/core/abi.cc b/src/core/abi.cc | ||
24 | index adff7b5..76c664c 100644 | ||
25 | --- a/src/core/abi.cc | ||
26 | +++ b/src/core/abi.cc | ||
27 | @@ -20,9 +20,7 @@ __ID("@(#) $Id: mem.cc 1352 2006-05-27 23:54:13Z ezix $"); | ||
28 | bool scan_abi(hwNode & system) | ||
29 | { | ||
30 | // are we compiled as 32- or 64-bit process ? | ||
31 | - long sc = sysconf(LONG_BIT); | ||
32 | - if(sc==-1) sc = sysconf(_SC_LONG_BIT); | ||
33 | - if(sc!=-1) system.setWidth(sc); | ||
34 | + system.setWidth(LONG_BIT); | ||
35 | |||
36 | pushd(PROC_SYS); | ||
37 | |||
38 | diff --git a/src/core/sysfs.cc b/src/core/sysfs.cc | ||
39 | index 32d6564..c2fa84f 100644 | ||
40 | --- a/src/core/sysfs.cc | ||
41 | +++ b/src/core/sysfs.cc | ||
42 | @@ -16,6 +16,7 @@ | ||
43 | #include <sys/stat.h> | ||
44 | #include <sys/types.h> | ||
45 | #include <sys/mount.h> | ||
46 | +#include <libgen.h> | ||
47 | |||
48 | |||
49 | __ID("@(#) $Id$"); | ||
50 | @@ -100,7 +101,7 @@ static string sysfs_getbustype(const string & path) | ||
51 | { | ||
52 | devname = | ||
53 | string(fs.path + "/bus/") + string(namelist[i]->d_name) + | ||
54 | - "/devices/" + basename(path.c_str()); | ||
55 | + "/devices/" + basename(const_cast<char*>(path.c_str())); | ||
56 | |||
57 | if (samefile(devname, path)) | ||
58 | return string(namelist[i]->d_name); | ||
59 | @@ -140,7 +141,7 @@ static string sysfstobusinfo(const string & path) | ||
60 | |||
61 | if (bustype == "usb") | ||
62 | { | ||
63 | - string name = basename(path.c_str()); | ||
64 | + string name = basename(const_cast<char*>(path.c_str())); | ||
65 | if (matches(name, "^[0-9]+-[0-9]+(\\.[0-9]+)*:[0-9]+\\.[0-9]+$")) | ||
66 | { | ||
67 | size_t colon = name.rfind(":"); | ||
68 | @@ -151,7 +152,7 @@ static string sysfstobusinfo(const string & path) | ||
69 | |||
70 | if (bustype == "virtio") | ||
71 | { | ||
72 | - string name = basename(path.c_str()); | ||
73 | + string name = basename(const_cast<char*>(path.c_str())); | ||
74 | if (name.compare(0, 6, "virtio") == 0) | ||
75 | return "virtio@" + name.substr(6); | ||
76 | else | ||
77 | @@ -159,10 +160,10 @@ static string sysfstobusinfo(const string & path) | ||
78 | } | ||
79 | |||
80 | if (bustype == "vio") | ||
81 | - return string("vio@") + basename(path.c_str()); | ||
82 | + return string("vio@") + basename(const_cast<char*>(path.c_str())); | ||
83 | |||
84 | if (bustype == "ccw") | ||
85 | - return string("ccw@") + basename(path.c_str()); | ||
86 | + return string("ccw@") + basename(const_cast<char*>(path.c_str())); | ||
87 | |||
88 | if (bustype == "ccwgroup") | ||
89 | { | ||
90 | @@ -240,7 +241,7 @@ string entry::driver() const | ||
91 | string driverlink = This->devpath + "/driver"; | ||
92 | if (!exists(driverlink)) | ||
93 | return ""; | ||
94 | - return basename(readlink(driverlink).c_str()); | ||
95 | + return basename(const_cast<char*>(readlink(driverlink).c_str())); | ||
96 | } | ||
97 | |||
98 | |||
99 | @@ -328,7 +329,7 @@ string entry::name_in_class(const string & classname) const | ||
100 | |||
101 | string entry::name() const | ||
102 | { | ||
103 | - return basename(This->devpath.c_str()); | ||
104 | + return basename(const_cast<char*>(This->devpath.c_str())); | ||
105 | } | ||
106 | |||
107 | |||
108 | @@ -340,12 +341,12 @@ entry entry::parent() const | ||
109 | |||
110 | string entry::classname() const | ||
111 | { | ||
112 | - return basename(dirname(This->devpath).c_str()); | ||
113 | + return basename(const_cast<char*>(dirname(This->devpath).c_str())); | ||
114 | } | ||
115 | |||
116 | bool entry::isvirtual() const | ||
117 | { | ||
118 | - return string(basename(dirname(dirname(This->devpath)).c_str())) == "virtual"; | ||
119 | + return string(basename(const_cast<char*>(dirname(dirname(This->devpath)).c_str()))) == "virtual"; | ||
120 | } | ||
121 | |||
122 | string entry::string_attr(const string & name, const string & def) const | ||
123 | -- | ||
124 | 2.17.1 | ||
125 | |||
diff --git a/meta-oe/recipes-devtools/lshw/files/0001-Makefile-Fix-cross-compilation.patch b/meta-oe/recipes-devtools/lshw/files/0001-Makefile-Fix-cross-compilation.patch deleted file mode 100644 index 6db6ab95e..000000000 --- a/meta-oe/recipes-devtools/lshw/files/0001-Makefile-Fix-cross-compilation.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | From 62f9ed95b5d0feab426bff452be793c62a6b795a Mon Sep 17 00:00:00 2001 | ||
2 | From: Krzysztof Kozlowski <krzk@kernel.org> | ||
3 | Date: Wed, 6 Jun 2018 12:49:21 +0200 | ||
4 | Subject: [PATCH 1/2] Makefile: Fix cross compilation | ||
5 | |||
6 | Allow building on ARMv7 and ARMv8. | ||
7 | |||
8 | Upstream-Status: Submitted | ||
9 | Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> | ||
10 | --- | ||
11 | src/Makefile | 2 +- | ||
12 | src/core/Makefile | 2 +- | ||
13 | src/gui/Makefile | 4 ++-- | ||
14 | 3 files changed, 4 insertions(+), 4 deletions(-) | ||
15 | |||
16 | diff --git a/src/Makefile b/src/Makefile | ||
17 | index b50586bc9234..654b786dd899 100644 | ||
18 | --- a/src/Makefile | ||
19 | +++ b/src/Makefile | ||
20 | @@ -18,7 +18,7 @@ export MANDIR | ||
21 | export DATADIR | ||
22 | export SQLITE | ||
23 | |||
24 | -CXX?=c++ | ||
25 | +CXX?=$(CROSS_COMPILE)c++ | ||
26 | INCLUDES=-I./core/ | ||
27 | DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" | ||
28 | CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) | ||
29 | diff --git a/src/core/Makefile b/src/core/Makefile | ||
30 | index 5bf5a69cc6a6..2bd1b94c4175 100644 | ||
31 | --- a/src/core/Makefile | ||
32 | +++ b/src/core/Makefile | ||
33 | @@ -1,6 +1,6 @@ | ||
34 | PACKAGENAME?=lshw | ||
35 | |||
36 | -CXX=c++ | ||
37 | +CXX?=$(CROSS_COMPILE)c++ | ||
38 | INCLUDES= | ||
39 | DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" | ||
40 | CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) | ||
41 | diff --git a/src/gui/Makefile b/src/gui/Makefile | ||
42 | index 332ce5704819..b0f925490356 100644 | ||
43 | --- a/src/gui/Makefile | ||
44 | +++ b/src/gui/Makefile | ||
45 | @@ -1,7 +1,7 @@ | ||
46 | PACKAGENAME?=lshw | ||
47 | |||
48 | -CXX?=c++ | ||
49 | -CC?=cc | ||
50 | +CXX?=$(CROSS_COMPILE)c++ | ||
51 | +CC?=$(CROSS_COMPILE)cc | ||
52 | STRIP?=strip | ||
53 | OBJCOPY?=objcopy | ||
54 | |||
55 | -- | ||
56 | 2.7.4 | ||
57 | |||
diff --git a/meta-oe/recipes-devtools/lshw/files/0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch b/meta-oe/recipes-devtools/lshw/files/0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch deleted file mode 100644 index d3da01b40..000000000 --- a/meta-oe/recipes-devtools/lshw/files/0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | From 75667f8a0ae4f1689ff03eb1768b1ee8cdfbf00d Mon Sep 17 00:00:00 2001 | ||
2 | From: Krzysztof Kozlowski <krzk@kernel.org> | ||
3 | Date: Wed, 6 Jun 2018 12:49:30 +0200 | ||
4 | Subject: [PATCH 2/2] Makefile: Use supplied LDFLAGS to silence OE GNU_HASH QA | ||
5 | warning | ||
6 | |||
7 | Fix OpenEmbedded/Yocto QA warning: | ||
8 | |||
9 | ERROR: lshw-02.16-r1 do_package_qa: QA Issue: No GNU_HASH in the elf binary: 'build/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/lshw/02.16-r1/packages-split/lshw/usr/sbin/lshw' [ldflags] | ||
10 | ERROR: lshw-02.16-r1 do_package_qa: QA run found fatal errors. Please consider fixing them. | ||
11 | ERROR: lshw-02.16-r1 do_package_qa: Function failed: do_package_qa | ||
12 | |||
13 | Upstream-Status: Submitted | ||
14 | Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> | ||
15 | --- | ||
16 | src/Makefile | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/src/Makefile b/src/Makefile | ||
20 | index 654b786dd899..a441ba2bb666 100644 | ||
21 | --- a/src/Makefile | ||
22 | +++ b/src/Makefile | ||
23 | @@ -25,7 +25,7 @@ CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) | ||
24 | ifeq ($(SQLITE), 1) | ||
25 | CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3) | ||
26 | endif | ||
27 | -LDFLAGS=-L./core/ -g | ||
28 | +LDFLAGS+=-L./core/ -g | ||
29 | ifneq ($(shell $(LD) --help 2| grep -- --as-needed), ) | ||
30 | LDFLAGS+= -Wl,--as-needed | ||
31 | endif | ||
32 | -- | ||
33 | 2.7.4 | ||
34 | |||
diff --git a/meta-oe/recipes-devtools/lshw/files/0003-sysfs-Fix-basename-build-with-musl.patch b/meta-oe/recipes-devtools/lshw/files/0003-sysfs-Fix-basename-build-with-musl.patch deleted file mode 100644 index 34924939d..000000000 --- a/meta-oe/recipes-devtools/lshw/files/0003-sysfs-Fix-basename-build-with-musl.patch +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | From a89f2ba8496994c8b5e28a89202df15d64c648f9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Krzysztof Kozlowski <krzk@kernel.org> | ||
3 | Date: Wed, 6 Jun 2018 12:47:02 +0200 | ||
4 | Subject: [PATCH] sysfs: Fix basename() build with musl | ||
5 | |||
6 | musl provides only standard basename() which accepts non-const string. | ||
7 | This fixes build error with musl C library: | ||
8 | |||
9 | | sysfs.cc: In function 'std::__cxx11::string sysfs_getbustype(const string&)': | ||
10 | | sysfs.cc:102:21: error: 'basename' was not declared in this scope | ||
11 | | "/devices/" + basename(path.c_str()); | ||
12 | | ^~~~~~~~ | ||
13 | |||
14 | Upstream-Status: Submitted | ||
15 | Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> | ||
16 | --- | ||
17 | src/core/dasd.cc | 3 ++- | ||
18 | src/core/sysfs.cc | 9 +++++---- | ||
19 | 2 files changed, 7 insertions(+), 5 deletions(-) | ||
20 | |||
21 | diff --git a/src/core/dasd.cc b/src/core/dasd.cc | ||
22 | index 626b8a872b0f..b27844215cc4 100644 | ||
23 | --- a/src/core/dasd.cc | ||
24 | +++ b/src/core/dasd.cc | ||
25 | @@ -2,6 +2,7 @@ | ||
26 | #include "osutils.h" | ||
27 | #include "dasd.h" | ||
28 | #include <glob.h> | ||
29 | +#include <libgen.h> | ||
30 | #include <string.h> | ||
31 | #include <fcntl.h> | ||
32 | #include <unistd.h> | ||
33 | @@ -42,7 +43,7 @@ bool scan_dasd(hwNode & n) | ||
34 | { | ||
35 | for(dev_num=0;dev_num<devices.gl_pathc;dev_num++) | ||
36 | { | ||
37 | - dev_name = basename(devices.gl_pathv[dev_num]); | ||
38 | + dev_name = basename(const_cast<char *>(devices.gl_pathv[dev_num])); | ||
39 | for (std::vector<std::string>::iterator it = sysfs_attribs.begin(); it != sysfs_attribs.end(); ++it) | ||
40 | { | ||
41 | std::string attrib_fname = std::string(SYSFS_PREFIX) + dev_name + "/device/" + *it; | ||
42 | diff --git a/src/core/sysfs.cc b/src/core/sysfs.cc | ||
43 | index acc9d0056d5e..c56bab7b3b9f 100644 | ||
44 | --- a/src/core/sysfs.cc | ||
45 | +++ b/src/core/sysfs.cc | ||
46 | @@ -7,6 +7,7 @@ | ||
47 | #include "version.h" | ||
48 | #include "sysfs.h" | ||
49 | #include "osutils.h" | ||
50 | +#include <libgen.h> | ||
51 | #include <limits.h> | ||
52 | #include <unistd.h> | ||
53 | #include <stdlib.h> | ||
54 | @@ -99,7 +100,7 @@ static string sysfs_getbustype(const string & path) | ||
55 | { | ||
56 | devname = | ||
57 | string(fs.path + "/bus/") + string(namelist[i]->d_name) + | ||
58 | - "/devices/" + basename(path.c_str()); | ||
59 | + "/devices/" + basename(const_cast<char *>(path.c_str())); | ||
60 | |||
61 | if (samefile(devname, path)) | ||
62 | return string(namelist[i]->d_name); | ||
63 | @@ -139,7 +140,7 @@ static string sysfstobusinfo(const string & path) | ||
64 | |||
65 | if (bustype == "virtio") | ||
66 | { | ||
67 | - string name = basename(path.c_str()); | ||
68 | + string name = basename(const_cast<char *>(path.c_str())); | ||
69 | if (name.compare(0, 6, "virtio") == 0) | ||
70 | return "virtio@" + name.substr(6); | ||
71 | else | ||
72 | @@ -207,7 +208,7 @@ string entry::driver() const | ||
73 | string driverlink = This->devpath + "/driver"; | ||
74 | if (!exists(driverlink)) | ||
75 | return ""; | ||
76 | - return basename(readlink(driverlink).c_str()); | ||
77 | + return basename(const_cast<char *>(readlink(driverlink).c_str())); | ||
78 | } | ||
79 | |||
80 | |||
81 | @@ -288,7 +289,7 @@ string entry::name_in_class(const string & classname) const | ||
82 | |||
83 | string entry::name() const | ||
84 | { | ||
85 | - return basename(This->devpath.c_str()); | ||
86 | + return basename(const_cast<char *>(This->devpath.c_str())); | ||
87 | } | ||
88 | |||
89 | |||
90 | -- | ||
91 | 2.7.4 | ||
92 | |||
diff --git a/meta-oe/recipes-devtools/lshw/lshw_02.18.bb b/meta-oe/recipes-devtools/lshw/lshw_02.19.2.bb index d1a733424..a26fac992 100644 --- a/meta-oe/recipes-devtools/lshw/lshw_02.18.bb +++ b/meta-oe/recipes-devtools/lshw/lshw_02.19.2.bb | |||
@@ -13,12 +13,10 @@ COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" | |||
13 | 13 | ||
14 | SRC_URI = " \ | 14 | SRC_URI = " \ |
15 | http://ezix.org/software/files/lshw-B.${PV}.tar.gz \ | 15 | http://ezix.org/software/files/lshw-B.${PV}.tar.gz \ |
16 | file://0001-Makefile-Fix-cross-compilation.patch \ | 16 | file://0001-Fix-musl-build.patch \ |
17 | file://0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch \ | ||
18 | file://0003-sysfs-Fix-basename-build-with-musl.patch \ | ||
19 | " | 17 | " |
20 | SRC_URI[md5sum] = "8671c6d94d6324a744b7f21f1bfecfd2" | 18 | SRC_URI[md5sum] = "8c70d46e906688309095c73ecb9396e3" |
21 | SRC_URI[sha256sum] = "ae22ef11c934364be4fd2a0a1a7aadf4495a0251ec6979da280d342a89ca3c2f" | 19 | SRC_URI[sha256sum] = "9bb347ac87142339a366a1759ac845e3dbb337ec000aa1b99b50ac6758a80f80" |
22 | 20 | ||
23 | S = "${WORKDIR}/lshw-B.${PV}" | 21 | S = "${WORKDIR}/lshw-B.${PV}" |
24 | 22 | ||