diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2018-06-06 20:33:24 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-06-08 00:57:29 -0700 |
commit | faa20de8833a31e725d28bc13c17af523c745fc9 (patch) | |
tree | fefb85c6e2f711dbb6b75c815558669534c8ec6a | |
parent | 2ac1799a19f3fbbd01468892539ad2d989aace1e (diff) | |
download | meta-openembedded-faa20de8833a31e725d28bc13c17af523c745fc9.tar.gz |
lshw: Add new recipe with B.02.18 version
Add new recipe for lshw B.02.18 version - a small tool to provide
detailed information on the hardware configuration of the machine.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
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 @@ | |||
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 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 @@ | |||
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 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 @@ | |||
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.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 @@ | |||
1 | DESCRIPTION = "A small tool to provide detailed information on the hardware \ | ||
2 | configuration of the machine. It can report exact memory configuration, \ | ||
3 | firmware version, mainboard configuration, CPU version and speed, cache \ | ||
4 | configuration, bus speed, etc. on DMI-capable or EFI systems." | ||
5 | SUMMARY = "Hardware lister" | ||
6 | HOMEPAGE = "http://ezix.org/project/wiki/HardwareLiSter" | ||
7 | SECTION = "console/tools" | ||
8 | |||
9 | LICENSE = "GPLv2+" | ||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
11 | |||
12 | COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" | ||
13 | |||
14 | SRC_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 | " | ||
20 | SRC_URI[md5sum] = "8671c6d94d6324a744b7f21f1bfecfd2" | ||
21 | SRC_URI[sha256sum] = "ae22ef11c934364be4fd2a0a1a7aadf4495a0251ec6979da280d342a89ca3c2f" | ||
22 | |||
23 | S = "${WORKDIR}/lshw-B.${PV}" | ||
24 | |||
25 | do_compile() { | ||
26 | # build core only - don't ship gui | ||
27 | oe_runmake -C src core | ||
28 | } | ||
29 | |||
30 | do_install() { | ||
31 | oe_runmake install DESTDIR=${D} | ||
32 | } | ||