On Fri, Jun 1, 2018 at 6:48 PM, Khem Raj <[email protected]> wrote:
> Hi Krzysztof
>
> On 6/1/18 5:06 AM, Krzysztof Kozlowski wrote:
>> 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 <[email protected]>
>>
>> ---
>>
>> The recipe is based on existing meta-linaro:
>> https://layers.openembedded.org/layerindex/recipe/5446/
>>
>> with changes:
>> 1. Bump to 02.18,
>> 2. Fix QA issue with GNU_HASH,
>> 3. Minor recipe styling fixes.
>> ---
>>  ...e-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch | 33 ++++++++++++++++++
>>  .../lshw/files/cross-compile.patch                 | 39 
>> ++++++++++++++++++++++
>>  meta-oe/recipes-devtools/lshw/lshw_02.18.bb        | 37 ++++++++++++++++++++
>>  3 files changed, 109 insertions(+)
>>  create mode 100644 
>> meta-oe/recipes-devtools/lshw/files/0001-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch
>>  create mode 100644 meta-oe/recipes-devtools/lshw/files/cross-compile.patch
>>  create mode 100644 meta-oe/recipes-devtools/lshw/lshw_02.18.bb
>>
>> diff --git 
>> a/meta-oe/recipes-devtools/lshw/files/0001-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch
>>  
>> b/meta-oe/recipes-devtools/lshw/files/0001-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch
>> new file mode 100644
>> index 000000000000..627619fd137f
>> --- /dev/null
>> +++ 
>> b/meta-oe/recipes-devtools/lshw/files/0001-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch
>> @@ -0,0 +1,33 @@
>> +From 2f69ba75608619ba7fc962b1a0338682b644a406 Mon Sep 17 00:00:00 2001
>> +From: Krzysztof Kozlowski <[email protected]>
>> +Date: Thu, 31 May 2018 16:22:23 +0200
>> +Subject: [PATCH] Makefile: Use supplied LDFLAGS to silence OE GNU_HASH QA
>> + warning
>> +
>> +Fix OpenEmbedded/Yocto QA warning:
>> +
>> +    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]
>> +    ERROR: lshw-02.16-r1 do_package_qa: QA run found fatal errors. Please 
>> consider fixing them.
>> +    ERROR: lshw-02.16-r1 do_package_qa: Function failed: do_package_qa
>> +
>> +Signed-off-by: Krzysztof Kozlowski <[email protected]>
>> +---
>> + src/Makefile | 2 +-
>> + 1 file changed, 1 insertion(+), 1 deletion(-)
>> +
>> +diff --git a/src/Makefile b/src/Makefile
>> +index f474ff9d56b3..dd7a2a400be2 100644
>> +--- a/src/Makefile
>> ++++ b/src/Makefile
>> +@@ -25,7 +25,7 @@ CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) 
>> $(RPM_OPT_FLAGS)
>> + ifeq ($(SQLITE), 1)
>> +     CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3)
>> + endif
>> +-LDFLAGS=-L./core/ -g
>> ++LDFLAGS+=-L./core/ -g
>> + ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
>> +     LDFLAGS+= -Wl,--as-needed
>> + endif
>> +--
>> +2.7.4
>> +
>> diff --git a/meta-oe/recipes-devtools/lshw/files/cross-compile.patch 
>> b/meta-oe/recipes-devtools/lshw/files/cross-compile.patch
>> new file mode 100644
>> index 000000000000..221b7e538c00
>> --- /dev/null
>> +++ b/meta-oe/recipes-devtools/lshw/files/cross-compile.patch
>> @@ -0,0 +1,39 @@
>> +---
>> + src/Makefile      |    2 +-
>> + src/core/Makefile |    2 +-
>> + src/gui/Makefile  |    4 ++--
>> + 3 files changed, 4 insertions(+), 4 deletions(-)
>> +
>> +--- a/src/Makefile
>> ++++ b/src/Makefile
>> +@@ -18,7 +18,7 @@ export MANDIR
>> + export DATADIR
>> + export SQLITE
>> +
>> +-CXX?=c++
>> ++CXX?=$(CROSS_COMPILE)c++
>> + INCLUDES=-I./core/
>> + DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" 
>> -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
>> + CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
>> +--- a/src/core/Makefile
>> ++++ b/src/core/Makefile
>> +@@ -1,6 +1,6 @@
>> + PACKAGENAME?=lshw
>> +
>> +-CXX=c++
>> ++CXX?=$(CROSS_COMPILE)c++
>> + INCLUDES=
>> + DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" 
>> -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
>> + CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
>> +--- a/src/gui/Makefile
>> ++++ b/src/gui/Makefile
>> +@@ -1,7 +1,7 @@
>> + PACKAGENAME?=lshw
>> +
>> +-CXX?=c++
>> +-CC?=cc
>> ++CXX?=$(CROSS_COMPILE)c++
>> ++CC?=$(CROSS_COMPILE)cc
>> + STRIP?=strip
>> + OBJCOPY?=objcopy
>> +
>> 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 000000000000..aac6707fcea4
>> --- /dev/null
>> +++ b/meta-oe/recipes-devtools/lshw/lshw_02.18.bb
>> @@ -0,0 +1,37 @@
>> +DESCRIPTION = "A small tool to provide detailed information on the hardware 
>> \
>> +configuration of the machine. It can report exact memory configuration, \
>> +firmware version, mainboard configuration, CPU version and speed, cache \
>> +configuration, bus speed, etc. on DMI-capable or EFI systems."
>> +SUMMARY = "Hardware lister"
>> +HOMEPAGE = "http://ezix.org/project/wiki/HardwareLiSter";
>> +SECTION = "console/tools"
>> +
>> +LICENSE = "GPLv2+"
>> +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>> +
>> +DEPENDS = " \
>> +    pciutils \
>> +    usbutils \
>> +"
>> +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
>> +
>> +SRC_URI = " \
>> +    http://ezix.org/software/files/lshw-B.${PV}.tar.gz \
>> +    file://cross-compile.patch \
>> +    file://0001-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch \
>> +"
>> +SRC_URI[md5sum] = "8671c6d94d6324a744b7f21f1bfecfd2"
>> +SRC_URI[sha256sum] = 
>> "ae22ef11c934364be4fd2a0a1a7aadf4495a0251ec6979da280d342a89ca3c2f"
>> +
>> +S = "${WORKDIR}/lshw-B.${PV}"
>> +
>> +do_compile() {
>> +    # build core only - don't ship gui
>> +    oe_runmake -C src core
>> +}
>> +
>> +do_install() {
>> +    oe_runmake install DESTDIR=${D}
>> +    # data files provided by dependencies
>> +    rm -rf ${D}/usr/share/lshw
>
> who should be providing these files ?
> should these packages be in rrecommends for this to work effectively ?

Thanks for catching this. They were indeed missing in the image. I can
add all of them as RDEPENDS or maybe as PACKAGECONFIG and then
customize the install with check for respective dependencies. I think
I will go with the second as it gives greater flexibility.

Best regards,
Krzysztof
-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Reply via email to