Skip to contentSkip to conversation

rtc-tools: Add a recipe

PATCH Superseded Fabio Estevam 3 participants 6 messages Jan 27, 2022 – Jan 28, 2022

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 rtc-tools: Add a recipe

From: Fabio Estevam <[email protected]>

rtc-tools is a useful utility developed by Alexandre Belloni for testing RTC kernel drivers, such as y2038 support.

Based on the initial recipe from Heiko Schocher <[email protected]>.

---
 .../0001-rtc-tools-Add-a-Makefile.patch       | 44 +++++++++++++++++++
 .../rtc-tools/rtc-tools_1.0.0.bb              | 18 ++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a-Makefile.patch
 create mode 100644 meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb
meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a-Makefile.patch new file +44 -0
new file mode 100644
index 000000000000..c1d1fa97eaa3
@@ -0,0 +1,44 @@
+From b19924f797d69475b1857272231500c97ba9959c Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <[email protected]>
+Date: Thu, 27 Jan 2022 18:40:29 -0300
+Subject: [PATCH rtc-tools v2] rtc-tools: Add a Makefile
+
+Add a Makefile to make installation and uninstallation
+process easier.
+
+Upstream-Status: Submitted [https://marc.info/?l=linux-rtc&m=164332426030004&w=2]
+Signed-off-by: Fabio Estevam <[email protected]>
+---
+Changes since v1:
+- Simplify the Makefile by taking Peter Kjellerstedt's feedback in
+the oe-devel list.
+
+ Makefile | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+ create mode 100644 Makefile
+
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..71a4c9c
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,16 @@
++prefix ?= /usr
++bindir ?= $(prefix)/bin
++
++EXEC = rtc-range rtc rtc-sync
++
++all: $(EXEC)
++
++clean:
++	$(RM) $(EXEC)
++
++install:
++	install -d $(DESTDIR)$(bindir)
++	install $(EXEC) $(DESTDIR)$(bindir)
++
++uninstall:
++	$(RM) -r $(addprefix $(DESTDIR)$(bindir)/,$(EXEC))
+-- 
+2.25.1
+
meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb new file +18 -0
new file mode 100644
index 000000000000..64ea3173d8a4
@@ -0,0 +1,18 @@
+SUMMARY = "Useful programs to test rtc drivers"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=74274e8a218423e49eefdea80bc55038"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/${BPN}.git;protocol=https;branch=master \
+           file://0001-rtc-tools-Add-a-Makefile.patch \
+           "
+SRCREV = "acc442e7af4e1e783432a43d37f1a7938c692659"
+
+S = "${WORKDIR}/git"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+EXTRA_OEMAKE = "DESTDIR=${D}"
+
+do_install() {
+	oe_runmake install
+}
Signature · 1 line
2.25.1
#1 lore raw
Quoted 33 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Fabio Estevam
Sent: den 28 januari 2022 00:06
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Peter Kjellerstedt <[email protected]>; Fabio Estevam <[email protected]>
Subject: [oe] [PATCH v3 meta-oe] rtc-tools: Add a recipe

From: Fabio Estevam <[email protected]>

rtc-tools is a useful utility developed by Alexandre Belloni for testing RTC kernel drivers, such as y2038 support.

Based on the initial recipe from Heiko Schocher <[email protected]>.

---
 .../0001-rtc-tools-Add-a-Makefile.patch       | 44 +++++++++++++++++++
 .../rtc-tools/rtc-tools_1.0.0.bb              | 18 ++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a-Makefile.patch
 create mode 100644 meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb
meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a- new file +0 -0
new file mode 100644
index 000000000000..c1d1fa97eaa3

Makefile.patch

meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a- new file +4 -0
@@ -0,0 +1,44 @@
+From b19924f797d69475b1857272231500c97ba9959c Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <[email protected]>
+Date: Thu, 27 Jan 2022 18:40:29 -0300
+Subject: [PATCH rtc-tools v2] rtc-tools: Add a Makefile

meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a- line 14

Quoted 10 lines
meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a- new file +10 -0
+
+Add a Makefile to make installation and uninstallation
+process easier.
+
+Upstream-Status: Submitted [https://marc.info/?l=linux-rtc&m=164332426030004&w=2]
+Signed-off-by: Fabio Estevam <[email protected]>
+---
+Changes since v1:
+- Simplify the Makefile by taking Peter Kjellerstedt's feedback in
+the oe-devel list.

This doesn't belong in the Makefile.patch file, it belongs after the commit message as it relates to the review process and has no bearing once this is integrated.

Quoted 38 lines
meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a- new file +30 -0
+
+ Makefile | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+ create mode 100644 Makefile
+
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..71a4c9c
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,16 @@
++prefix ?= /usr
++bindir ?= $(prefix)/bin
++
++EXEC = rtc-range rtc rtc-sync
++
++all: $(EXEC)
++
++clean:
++	$(RM) $(EXEC)
++
++install:
++	install -d $(DESTDIR)$(bindir)
++	install $(EXEC) $(DESTDIR)$(bindir)
++
++uninstall:
++	$(RM) -r $(addprefix $(DESTDIR)$(bindir)/,$(EXEC))
+--
+2.25.1
+
meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb new file +2 -0
new file mode 100644
index 000000000000..64ea3173d8a4
@@ -0,0 +1,18 @@
+SUMMARY = "Useful programs to test rtc drivers"
+LICENSE = "GPL-2.0-only"

meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb line 12

Quoted 10 lines
meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb new file +10 -0
+LIC_FILES_CHKSUM = "file://COPYING;md5=74274e8a218423e49eefdea80bc55038"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/${BPN}.git;protocol=https;branch=master \
+           file://0001-rtc-tools-Add-a-Makefile.patch \
+           "
+SRCREV = "acc442e7af4e1e783432a43d37f1a7938c692659"
+
+S = "${WORKDIR}/git"
+
+TARGET_CC_ARCH += "${LDFLAGS}"

You forgot to remove the TAGET_CC_ARCH line.

Quoted 8 lines
meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb new file +6 -1
+
+EXTRA_OEMAKE = "DESTDIR=${D}"
+
+do_install() {
+	oe_runmake install
+}
--

2.25.1

//Peter

#2 lore raw

Hi Peter,

Quoted 3 lines · Peter Kjellerstedt
Quoted 1 line

+TARGET_CC_ARCH += "${LDFLAGS}"

You forgot to remove the TAGET_CC_ARCH line.

If I remove this line, the following error happens:

ERROR: rtc-tools-1.0.0-r0 do_package_qa: QA Issue: File /usr/bin/rtc-sync in package rtc-tools doesn't have GNU_HASH (didn't pass LDFLAGS?)
File /usr/bin/rtc in package rtc-tools doesn't have GNU_HASH (didn't pass LDFLAGS?)
File /usr/bin/rtc-range in package rtc-tools doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]
ERROR: rtc-tools-1.0.0-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.

Any suggestions as to how this should be fixed?

Thanks

#3 lore raw
Quoted 21 lines · Fabio Estevam

Hi Peter,

Quoted 3 lines · Peter Kjellerstedt
Quoted 1 line

+TARGET_CC_ARCH += "${LDFLAGS}"

You forgot to remove the TAGET_CC_ARCH line.

If I remove this line, the following error happens:

ERROR: rtc-tools-1.0.0-r0 do_package_qa: QA Issue: File /usr/bin/rtc-sync in package rtc-tools doesn't have GNU_HASH (didn't pass LDFLAGS?)
File /usr/bin/rtc in package rtc-tools doesn't have GNU_HASH (didn't pass LDFLAGS?)
File /usr/bin/rtc-range in package rtc-tools doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]
ERROR: rtc-tools-1.0.0-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.

Quoted 1 line

Any suggestions as to how this should be fixed?

I already suggested in earlier email to add LDFLAGS in makefile rules

Quoted 4 lines

Thanks

#4 lore raw

The default rules provided by make do include $(LDFLAGS). This is the default rule provided by make to link a binary from a .c file:

%: %.c
# recipe to execute (built-in):

        $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@

where LINK.c is defined as:

LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)

(you can see the default rules by running make -p anywhere where there isn’t a Makefile).

I have now also applied the patch for the rtc-tools recipe. I then removed the TARGET_CC_ARCH line from it and built it without problems.

@Fabio: Are you sure you built with the correct version of the recipe and Makefile when you got the error about GNU_HASH? Because it should work (and I’ve verified that the files I built have the GNU_HASH and I never built with the TARGET_CC_ARCH line in the recipe).

//Peter

From: Khem Raj <[email protected]>
Sent: den 28 januari 2022 16:33
To: Fabio Estevam <[email protected]>
Cc: Fabio Estevam <[email protected]>; Peter Kjellerstedt <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [oe] [PATCH v3 meta-oe] rtc-tools: Add a recipe

On Fri, Jan 28, 2022 at 2:28 AM Fabio Estevam <[email protected]<mailto:[email protected]>> wrote:
Hi Peter,

Quoted 3 lines · On Fri, Jan 28, 2022 at 1:48 AM Peter Kjellerstedt…
Quoted 1 line

+TARGET_CC_ARCH += "${LDFLAGS}"

You forgot to remove the TAGET_CC_ARCH line.

If I remove this line, the following error happens:

ERROR: rtc-tools-1.0.0-r0 do_package_qa: QA Issue: File
/usr/bin/rtc-sync in package rtc-tools doesn't have GNU_HASH (didn't pass LDFLAGS?) File /usr/bin/rtc in package rtc-tools doesn't have GNU_HASH (didn't pass LDFLAGS?) File /usr/bin/rtc-range in package rtc-tools doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]
ERROR: rtc-tools-1.0.0-r0 do_package_qa: QA run found fatal errors.
Please consider fixing them.

Any suggestions as to how this should be fixed?

I already suggested in earlier email to add LDFLAGS in makefile rules

Thanks

#5 lore raw

Hi Peter,

Quoted 1 line · Peter Kjellerstedt

@Fabio: Are you sure you built with the correct version of the recipe and Makefile when you got the error about GNU_HASH? Because it should work (and I’ve verified that the files I built have the GNU_HASH and I never built with the TARGET_CC_ARCH line in the recipe).

You are right. I rebuilt without the TARGET_CC_ARCH line in the recipe and it builds fine.

I have sent v4 without this line.

Thanks for your help, really appreciate it.