summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-devtools/lshw/files/0001-Makefile-Fix-cross-compilation.patch57
-rw-r--r--meta-oe/recipes-devtools/lshw/files/0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch34
-rw-r--r--meta-oe/recipes-devtools/lshw/files/0003-sysfs-Fix-basename-build-with-musl.patch92
-rw-r--r--meta-oe/recipes-devtools/lshw/lshw_02.18.bb32
4 files changed, 215 insertions, 0 deletions
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
new file mode 100644
index 000000000..6db6ab95e
--- /dev/null
+++ b/meta-oe/recipes-devtools/lshw/files/0001-Makefile-Fix-cross-compilation.patch
@@ -0,0 +1,57 @@
1From 62f9ed95b5d0feab426bff452be793c62a6b795a Mon Sep 17 00:00:00 2001
2From: Krzysztof Kozlowski <krzk@kernel.org>
3Date: Wed, 6 Jun 2018 12:49:21 +0200
4Subject: [PATCH 1/2] Makefile: Fix cross compilation
5
6Allow building on ARMv7 and ARMv8.
7
8Upstream-Status: Submitted
9Signed-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
16diff --git a/src/Makefile b/src/Makefile
17index 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)
29diff --git a/src/core/Makefile b/src/core/Makefile
30index 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)
41diff --git a/src/gui/Makefile b/src/gui/Makefile
42index 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--
562.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
new file mode 100644
index 000000000..d3da01b40
--- /dev/null
+++ b/meta-oe/recipes-devtools/lshw/files/0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch
@@ -0,0 +1,34 @@
1From 75667f8a0ae4f1689ff03eb1768b1ee8cdfbf00d Mon Sep 17 00:00:00 2001
2From: Krzysztof Kozlowski <krzk@kernel.org>
3Date: Wed, 6 Jun 2018 12:49:30 +0200
4Subject: [PATCH 2/2] Makefile: Use supplied LDFLAGS to silence OE GNU_HASH QA
5 warning
6
7Fix 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
13Upstream-Status: Submitted
14Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
15---
16 src/Makefile | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/src/Makefile b/src/Makefile
20index 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--
332.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
new file mode 100644
index 000000000..34924939d
--- /dev/null
+++ b/meta-oe/recipes-devtools/lshw/files/0003-sysfs-Fix-basename-build-with-musl.patch
@@ -0,0 +1,92 @@
1From a89f2ba8496994c8b5e28a89202df15d64c648f9 Mon Sep 17 00:00:00 2001
2From: Krzysztof Kozlowski <krzk@kernel.org>
3Date: Wed, 6 Jun 2018 12:47:02 +0200
4Subject: [PATCH] sysfs: Fix basename() build with musl
5
6musl provides only standard basename() which accepts non-const string.
7This 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
14Upstream-Status: Submitted
15Signed-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
21diff --git a/src/core/dasd.cc b/src/core/dasd.cc
22index 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;
42diff --git a/src/core/sysfs.cc b/src/core/sysfs.cc
43index 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--
912.7.4
92
diff --git a/meta-oe/recipes-devtools/lshw/lshw_02.18.bb b/meta-oe/recipes-devtools/lshw/lshw_02.18.bb
new file mode 100644
index 000000000..b344fbf32
--- /dev/null
+++ b/meta-oe/recipes-devtools/lshw/lshw_02.18.bb
@@ -0,0 +1,32 @@
1DESCRIPTION = "A small tool to provide detailed information on the hardware \
2configuration of the machine. It can report exact memory configuration, \
3firmware version, mainboard configuration, CPU version and speed, cache \
4configuration, bus speed, etc. on DMI-capable or EFI systems."
5SUMMARY = "Hardware lister"
6HOMEPAGE = "http://ezix.org/project/wiki/HardwareLiSter"
7SECTION = "console/tools"
8
9LICENSE = "GPLv2+"
10LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
11
12COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
13
14SRC_URI = " \
15 http://ezix.org/software/files/lshw-B.${PV}.tar.gz \
16 file://0001-Makefile-Fix-cross-compilation.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"
20SRC_URI[md5sum] = "8671c6d94d6324a744b7f21f1bfecfd2"
21SRC_URI[sha256sum] = "ae22ef11c934364be4fd2a0a1a7aadf4495a0251ec6979da280d342a89ca3c2f"
22
23S = "${WORKDIR}/lshw-B.${PV}"
24
25do_compile() {
26 # build core only - don't ship gui
27 oe_runmake -C src core
28}
29
30do_install() {
31 oe_runmake install DESTDIR=${D}
32}