Skip to contentSkip to conversation

rtc-tool: Add a recipe

PATCH In review Fabio Estevam 4 participants 6 messages Jan 23, 2022 – Jan 26, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc-tool: 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       | 52 +++++++++++++++++++
 .../rtc-tools/rtc-tools_1.0.0.bb              | 19 +++++++
 2 files changed, 71 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 +52 -0
new file mode 100644
index 000000000000..a372e390efb9
@@ -0,0 +1,52 @@
+From faa6dd2e4d063afcaa19f16740a3fc413a399e60 Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <[email protected]>
+Date: Sun, 23 Jan 2022 09:22:19 -0300
+Subject: [PATCH rtc-tools] 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=164294073129803&w=2]
+Signed-off-by: Fabio Estevam <[email protected]>
+---
+ Makefile | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+ create mode 100644 Makefile
+
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 000000000000..4f244d9289f1
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,29 @@
++prefix ?= /usr
++bindir ?= $(prefix)/bin
++
++EXEC = rtc-range rtc rtc-sync
++
++all: $(EXEC)
++
++rtc-range: rtc-range.c
++	$(CC) $(CFLAGS) -o $@ rtc-range.c
++
++rtc: rtc.c
++	$(CC) $(CFLAGS) -o $@ rtc.c
++
++rtc-sync: rtc-sync.c
++	$(CC) $(CFLAGS) -o $@ rtc-sync.c
++
++clean:
++	rm -f $(EXEC)
++
++install: rtc-range rtc rtc-sync
++	mkdir -p '$(DESTDIR)$(bindir)'
++	install -m755 rtc-range '$(DESTDIR)$(bindir)/rtc-range'
++	install -m755 rtc '$(DESTDIR)$(bindir)/rtc'
++	install -m755 rtc-sync '$(DESTDIR)$(bindir)/rtc-sync'
++
++uninstall:
++	rm -rf '$(DESTDIR)$(bindir)/rtc-range'
++	rm -rf '$(DESTDIR)$(bindir)/rtc'
++	rm -rf '$(DESTDIR)$(bindir)/rtc-sync'
+--
+2.25.1
meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb new file +19 -0
new file mode 100644
index 000000000000..8f0326829d8c
@@ -0,0 +1,19 @@
+DESCRIPTION = "Useful programs to test rtc drivers"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=74274e8a218423e49eefdea80bc55038"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/rtc-tools.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} \
+	all \
+	"
+do_install() {
+	oe_runmake install
+}
Signature · 1 line
2.25.1
#1 lore raw

Hi Fabio,

from my experience, custom build systems (including "bare" Makefiles) are often hard to integrate/maintain for distributors.

What about using CMake instead?

regards
Christian

Quoted 21 lines · Fabio Estevam

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       | 52 +++++++++++++++++++
 .../rtc-tools/rtc-tools_1.0.0.bb              | 19 +++++++
 2 files changed, 71 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 +0 -0
new file mode 100644
index 000000000000..a372e390efb9

meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a-Makefile.patch line 2

Quoted 2 lines
meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a-Makefile.patch new file +2 -0
@@ -0,0 +1,52 @@
+From faa6dd2e4d063afcaa19f16740a3fc413a399e60 Mon Sep 17 00:00:00 2001
+

_______________________________________________________
Christian
Eggers
Software Engineer
​
ARRI
Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Arriweg 17,
83071
Stephanskirchen
www.arri.com

+49 8036 3009-3118
[email protected]

​
Get all the latest information from www.arri.com, Facebook, Twitter, Instagram and YouTube.

Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRA 57918 Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRB 54477 Geschäftsführer: Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger; Markus Zeiler

​
From: Fabio Estevam <[email protected]>

Quoted 76 lines
meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a-Makefile.patch new file +50 -0
+Date: Sun, 23 Jan 2022 09:22:19 -0300
+Subject: [PATCH rtc-tools] 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=164294073129803&w=2]
+Signed-off-by: Fabio Estevam <[email protected]>
+---
+ Makefile | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+ create mode 100644 Makefile
+
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 000000000000..4f244d9289f1
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,29 @@
++prefix ?= /usr
++bindir ?= $(prefix)/bin
++
++EXEC = rtc-range rtc rtc-sync
++
++all: $(EXEC)
++
++rtc-range: rtc-range.c
++	$(CC) $(CFLAGS) -o $@ rtc-range.c
++
++rtc: rtc.c
++	$(CC) $(CFLAGS) -o $@ rtc.c
++
++rtc-sync: rtc-sync.c
++	$(CC) $(CFLAGS) -o $@ rtc-sync.c
++
++clean:
++	rm -f $(EXEC)
++
++install: rtc-range rtc rtc-sync
++	mkdir -p '$(DESTDIR)$(bindir)'
++	install -m755 rtc-range '$(DESTDIR)$(bindir)/rtc-range'
++	install -m755 rtc '$(DESTDIR)$(bindir)/rtc'
++	install -m755 rtc-sync '$(DESTDIR)$(bindir)/rtc-sync'
++
++uninstall:
++	rm -rf '$(DESTDIR)$(bindir)/rtc-range'
++	rm -rf '$(DESTDIR)$(bindir)/rtc'
++	rm -rf '$(DESTDIR)$(bindir)/rtc-sync'
+--
+2.25.1
meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb new file +19 -0
new file mode 100644
index 000000000000..8f0326829d8c
@@ -0,0 +1,19 @@
+DESCRIPTION = "Useful programs to test rtc drivers"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=74274e8a218423e49eefdea80bc55038"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/rtc-tools.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} \
+	all \
+	"
+do_install() {
+	oe_runmake install
+}
#2 lore raw

Hi Christian,

Quoted 5 lines · Christian Eggers

Hi Fabio,

from my experience, custom build systems (including "bare" Makefiles) are often hard to integrate/maintain for distributors.

rtc-tools is a straightforward package and I have sent the Makefile patch upstream.

Not sure why it can be hard to integrate or maintain it.

Quoted 1 line

What about using CMake instead?

I can do that if needed, but it is up to the rtc-tools maintainer, Alexandre.

Alexandre, any advice?

Thanks

#3 lore raw

Hi Fabio, hi Alexandre,

Quoted 2 lines · Fabio Estevam

Hi Christian,

_______________________________________________________
Christian
Eggers
Software Engineer
​
ARRI
Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Arriweg 17,
83071
Stephanskirchen
www.arri.com

+49 8036 3009-3118
[email protected]

​
Get all the latest information from www.arri.com, Facebook, Twitter, Instagram and YouTube.

Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRA 57918 Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRB 54477 Geschäftsführer: Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger; Markus Zeiler

​

Quoted 11 lines · Christian Eggers
Quoted 5 lines

Hi Fabio,

from my experience, custom build systems (including "bare" Makefiles) are often hard to integrate/maintain for distributors.

rtc-tools is a straightforward package and I have sent the Makefile patch upstream.

Not sure why it can be hard to integrate or maintain it.

ok, maybe my statement was a little bit opinion based. It is likely that the OE/Yocto maintainers have a different position to this.

I remember that I've read an article (but cannot find it again) that custom build systems regularly causes headaches for distributors (because they usually use custom/no ways for setting compiler switches and installation directories which normally the distributor want to control).

Well known systems like autotools (I don't fully understand them) or cmake (I use it) have a standardized interface for setting important switches. Additionally they provide common features like cross-compiling, platform specific stuff, removing build artifacts (clean), installation of generated files or out-of-tree builds.

Doing the same in bare Makefiles is possible, but requires much hand-crafted code. Often Makefiles consist of a lot of repetitive code. You can use macros for this. After putting everything into macros, you will have reinvented either cmake or kbuild.

Quoted 4 lines
Quoted 2 lines

What about using CMake instead?

I can do that if needed, but it is up to the rtc-tools maintainer, Alexandre.

I am not involved into rtc-tools and also not much into OE/Yocto. So don't count too much on my opinion and choose the best solution yourself.

regards
Christia
(having created hand-written Makefiles for 13 years)

#4 lore raw
In reply to Fabio Estevam

Hello Fabio,

Quoted 12 lines · Fabio Estevam

Hi Christian,

Quoted 5 lines · Christian Eggers

Hi Fabio,

from my experience, custom build systems (including "bare" Makefiles) are often hard to integrate/maintain for distributors.

rtc-tools is a straightforward package and I have sent the Makefile patch upstream.

Quoted 8 lines

Not sure why it can be hard to integrate or maintain it.

Quoted 1 line

What about using CMake instead?

I can do that if needed, but it is up to the rtc-tools maintainer, Alexandre.

Alexandre, any advice?

My plan is to probably go for the Makefile. I don't think it will cause any issue and this doesn't care about portability to other systems as the tool is Linux only.

I'm just checking with buildroot whether they prefer having all the binaries installed with a single target or if rtc-range has to be separated out.

rtc-range is supposed to be a debugging tool. I'd also separate it in a different package.

Note that there is a daemon that should be coming up (well when I will have time) with the goal of monitoring both battery status and clock drift.

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

please send it to oe-devel ml if you intend to propose it for meta-oe

Quoted 20 lines · Alexandre Belloni

Hello Fabio,

Quoted 16 lines · Fabio Estevam

Hi Christian,

Quoted 5 lines · Christian Eggers

Hi Fabio,

from my experience, custom build systems (including "bare" Makefiles) are often hard to integrate/maintain for distributors.

rtc-tools is a straightforward package and I have sent the Makefile patch upstream.

Not sure why it can be hard to integrate or maintain it.

Quoted 1 line

What about using CMake instead?

Quoted 8 lines
Quoted 4 lines

I can do that if needed, but it is up to the rtc-tools maintainer, Alexandre.

Alexandre, any advice?

My plan is to probably go for the Makefile. I don't think it will cause any issue and this doesn't care about portability to other systems as the tool is Linux only.

thats fine, well written makefiles can do cross compilation just fine.

Quoted 25 lines

I'm just checking with buildroot whether they prefer having all the binaries installed with a single target or if rtc-range has to be separated out.

rtc-range is supposed to be a debugging tool. I'd also separate it in a different package.

Note that there is a daemon that should be coming up (well when I will have time) with the goal of monitoring both battery status and clock drift.

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#160987): https://lists.openembedded.org/g/openembedded-core/message/160987
Mute This Topic: https://lists.openembedded.org/mt/88625470/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-