Skip to contentSkip to conversation

fake-hwclock: new package

PATCH New Christopher McCrory 5 participants 7 messages Aug 10, 2018 – Aug 14, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 fake-hwclock: new package

Save/restore system clock on machines without working RTC hardware

---
 DEVELOPERS                             |  3 +++
 package/Config.in                      |  1 +
 package/fake-hwclock/Config.in         | 12 ++++++++++
 package/fake-hwclock/fake-hwclock.hash |  2 ++
 package/fake-hwclock/fake-hwclock.mk   | 40 ++++++++++++++++++++++++++++++++++
 5 files changed, 58 insertions(+)
 create mode 100644 package/fake-hwclock/Config.in
 create mode 100644 package/fake-hwclock/fake-hwclock.hash
 create mode 100644 package/fake-hwclock/fake-hwclock.mk
DEVELOPERS +3 -0
index 215506c71c..9ea934fa57 100644
@@ -479,6 +479,9 @@ F:	package/python-rtslib-fb/
 F:	package/python-urwid/
 F:	package/targetcli-fb/
 
+N:	Christopher McCrory <[email protected]>
+F:	package/fake-hwclock/
+
 N:	Clayton Shotwell <[email protected]>
 F:	package/audit/
 F:	package/checkpolicy/
package/Config.in +1 -0
index f5a17492c7..42c61c242e 100644
@@ -1982,6 +1982,7 @@ comment "Utilities"
 	source "package/dialog/Config.in"
 	source "package/dtach/Config.in"
 	source "package/easy-rsa/Config.in"
+	source "package/fake-hwclock/Config.in"
 	source "package/file/Config.in"
 	source "package/gnupg/Config.in"
 	source "package/gnupg2/Config.in"
package/fake-hwclock/Config.in new file +12 -0
new file mode 100644
index 0000000000..f7e01dfb46
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_FAKE_HWCLOCK
+	bool "fake-hwclock"
+	help
+	 Save/restore system clock on machines without working RTC hardware
+
+if BR2_PACKAGE_FAKE_HWCLOCK
+config BR2_PACKAGE_FAKE_HWCLOCK_CRONJOB
+        bool "install fake-hwclock cronjob"
+        help
+          Hourly cronjob to save current timestamp
+
+endif
package/fake-hwclock/fake-hwclock.hash new file +2 -0
new file mode 100644
index 0000000000..7bf147d7a6
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 b658d6d130f66eeaa79bae6943ebae45a85bc6a932260befff75c630a8cfe428 fake-hwclock-v0.11.tar.gz
package/fake-hwclock/fake-hwclock.mk new file +40 -0
new file mode 100644
index 0000000000..caae8605b9
@@ -0,0 +1,40 @@
+################################################################################
+#
+# fake-hwclock
+#
+################################################################################
+
+FAKE_HWCLOCK_VERSION = v0.11
+FAKE_HWCLOCK_SITE = https://git.einval.com/git/fake-hwclock.git
+FAKE_HWCLOCK_SITE_METHOD = git
+FAKE_HWCLOCK_LICENSE_FILES = COPYING
+FAKE_LICENSE = GPL-2.0
+
+define FAKE_HWCLOCK_NO_LSB
+	$(SED) 's at . /lib/lsb/init-functions@#. /lib/lsb/init-functions@' \
+		$(@D)/debian/fake-hwclock.init
+endef
+
+FAKE_HWCLOCK_POST_PATCH_HOOKS += FAKE_HWCLOCK_NO_LSB
+
+ifeq ($(BR2_PACKAGE_FAKE_HWCLOCK_CRONJOB),y)
+define FAKE_HWCLOCK_INSTALL_CRONJOB
+	$(INSTALL) -D -m 755 $(@D)/debian/fake-hwclock.cron.hourly $(TARGET_DIR)/etc/cron.hourly/fake-hwclock
+endef
+endif
+
+define FAKE_HWCLOCK_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 755 $(@D)/fake-hwclock $(TARGET_DIR)/sbin/fake-hwclock
+	# Use buildroot buildtime as a seed.
+	# Not ideal, but better than 1970-01-01 UTC
+	date -u '+%Y-%m-%d %H:%M:%S' > $(TARGET_DIR)/etc/fake-hwclock.data
+	$(FAKE_HWCLOCK_INSTALL_CRONJOB)
+endef
+
+# This should run before everything else, so use S00
+define FAKE_HWCLOCK_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 $(@D)/debian/fake-hwclock.init $(TARGET_DIR)/etc/init.d/S00fake-hwclock
+	$(INSTALL) -D -m 755 $(@D)/etc/default/fake-hwclock $(TARGET_DIR)/etc/default/fake-hwclock
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.14.4
#1 lore raw

PATCH 3/3 perl-cgi: new package

---
 package/Config.in              |  1 +
 package/perl-cgi/Config.in     | 11 +++++++++++
 package/perl-cgi/perl-cgi.hash |  6 ++++++
 package/perl-cgi/perl-cgi.mk   | 14 ++++++++++++++
 4 files changed, 32 insertions(+)
 create mode 100644 package/perl-cgi/Config.in
 create mode 100644 package/perl-cgi/perl-cgi.hash
 create mode 100644 package/perl-cgi/perl-cgi.mk
package/Config.in +1 -0
index 42c61c242e..9704aba846 100644
@@ -665,6 +665,7 @@ endif
 	source "package/perl/Config.in"
 if BR2_PACKAGE_PERL
 menu "Perl libraries/modules"
+	source "package/perl-cgi/Config.in"
 	source "package/perl-convert-asn1/Config.in"
 	source "package/perl-crypt-blowfish/Config.in"
 	source "package/perl-crypt-cbc/Config.in"
package/perl-cgi/Config.in new file +11 -0
new file mode 100644
index 0000000000..a054ed7929
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_PERL_CGI
+	bool "perl-cgi"
+	depends on !BR2_STATIC_LIBS
+	select BR2_PACKAGE_PERL_HTML_PARSER
+	help
+	  Handle Common Gateway Interface requests and responses
+
+	  https://metacpan.org/module/CGI
+
+comment "perl-cgi needs a toolchain w/ dynamic library"
+	depends on BR2_STATIC_LIBS
package/perl-cgi/perl-cgi.hash new file +6 -0
new file mode 100644
index 0000000000..a65b8e5446
@@ -0,0 +1,6 @@
+# retrieved by scancpan from http://cpan.metacpan.org/
+md5    0aeb8563d533e7f83724ed068b5bfc37 CGI-4.38.tar.gz
+sha256 8c58f4a529bb92a914b22b7e64c5e31185c9854a4070a6dfad44fe5cc248e7d4 CGI-4.38.tar.gz
+
+# computed by scancpan
+sha256 c7cae89f03a970e90443b93cbf4b65d287ed20572e5d81543589c4b45c80fad8 LICENSE
package/perl-cgi/perl-cgi.mk new file +14 -0
new file mode 100644
index 0000000000..b8115de6ad
@@ -0,0 +1,14 @@
+################################################################################
+#
+# perl-cgi
+#
+################################################################################
+
+PERL_CGI_VERSION = 4.38
+PERL_CGI_SOURCE = CGI-$(PERL_CGI_VERSION).tar.gz
+PERL_CGI_SITE = $(BR2_CPAN_MIRROR)/authors/id/L/LE/LEEJO
+PERL_CGI_DEPENDENCIES = perl-html-parser
+PERL_CGI_LICENSE = Artistic or GPL-1.0+
+PERL_CGI_LICENSE_FILES = LICENSE
+
+$(eval $(perl-package))
Signature · 1 line
2.14.4
#2 lore raw

PATCH 3/3 perl-cgi: new package

2018-08-10 16:46 GMT+02:00 Christopher McCrory <[email protected]>:

Quoted 2 lines

---

Quoted 78 lines
 package/Config.in              |  1 +
 package/perl-cgi/Config.in     | 11 +++++++++++
 package/perl-cgi/perl-cgi.hash |  6 ++++++
 package/perl-cgi/perl-cgi.mk   | 14 ++++++++++++++
 4 files changed, 32 insertions(+)
 create mode 100644 package/perl-cgi/Config.in
 create mode 100644 package/perl-cgi/perl-cgi.hash
 create mode 100644 package/perl-cgi/perl-cgi.mk
package/Config.in +1 -0
index 42c61c242e..9704aba846 100644
@@ -665,6 +665,7 @@ endif
        source "package/perl/Config.in"
 if BR2_PACKAGE_PERL
 menu "Perl libraries/modules"
+       source "package/perl-cgi/Config.in"
        source "package/perl-convert-asn1/Config.in"
        source "package/perl-crypt-blowfish/Config.in"
        source "package/perl-crypt-cbc/Config.in"
package/perl-cgi/Config.in new file +11 -0
new file mode 100644
index 0000000000..a054ed7929
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_PERL_CGI
+       bool "perl-cgi"
+       depends on !BR2_STATIC_LIBS
+       select BR2_PACKAGE_PERL_HTML_PARSER
+       help
+         Handle Common Gateway Interface requests and responses
+
+         https://metacpan.org/module/CGI
+
+comment "perl-cgi needs a toolchain w/ dynamic library"
+       depends on BR2_STATIC_LIBS
package/perl-cgi/perl-cgi. renamed from package/perl-cgi/perl-cgi.hash +0 -0

hash
new file mode 100644
index 0000000000..a65b8e5446

package/perl-cgi/perl-cgi.hash new file +3 -0
@@ -0,0 +1,6 @@
+# retrieved by scancpan from http://cpan.metacpan.org/
+md5    0aeb8563d533e7f83724ed068b5bfc37 CGI-4.38.tar.gz
+sha256 8c58f4a529bb92a914b22b7e64c5e31185c9854a4070a6dfad44fe5cc248e7d4

CGI-4.38.tar.gz

package/perl-cgi/perl-cgi.hash new file +3 -0
+
+# computed by scancpan
+sha256 c7cae89f03a970e90443b93cbf4b65d287ed20572e5d81543589c4b45c80fad8

LICENSE

package/perl-cgi/perl-cgi.mk new file +1 -0
new file mode 100644
index 0000000000..b8115de6ad
@@ -0,0 +1,14 @@
+###########################################################

#####################

package/perl-cgi/perl-cgi.mk new file +4 -0
+#
+# perl-cgi
+#
+###########################################################

#####################

package/perl-cgi/perl-cgi.mk new file +9 -1
+
+PERL_CGI_VERSION = 4.38
+PERL_CGI_SOURCE = CGI-$(PERL_CGI_VERSION).tar.gz
+PERL_CGI_SITE = $(BR2_CPAN_MIRROR)/authors/id/L/LE/LEEJO
+PERL_CGI_DEPENDENCIES = perl-html-parser
+PERL_CGI_LICENSE = Artistic or GPL-1.0+
+PERL_CGI_LICENSE_FILES = LICENSE
+
+$(eval $(perl-package))
--

2.14.4

Quoted 5 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180814/81e160ca/attachment.html>

#3 lore raw

PATCH 1/3 fake-hwclock: new package

In reply to Christopher McCrory

Hello,

Yann, Arnout, Peter, there is a question below.

Christopher, there are some review comments as well.

package/fake-hwclock/Config.in line 10

Quoted 5 lines · Christopher McCrory
package/fake-hwclock/Config.in new file +5 -0
+if BR2_PACKAGE_FAKE_HWCLOCK
+config BR2_PACKAGE_FAKE_HWCLOCK_CRONJOB
+        bool "install fake-hwclock cronjob"
+        help
+          Hourly cronjob to save current timestamp

What should be our policy for cronjobs ? I'm not sure we currently have packages that install cronjobs. What should we do? Install unconditionally? Have a sub-option?

I would personally lean towards installing unconditionally, but I'd like to have others opinions before applying.

package/fake-hwclock/fake-hwclock.mk line 11

Quoted 5 lines
package/fake-hwclock/fake-hwclock.mk new file +5 -0
+FAKE_HWCLOCK_VERSION = v0.11
+FAKE_HWCLOCK_SITE = https://git.einval.com/git/fake-hwclock.git
+FAKE_HWCLOCK_SITE_METHOD = git
+FAKE_HWCLOCK_LICENSE_FILES = COPYING
+FAKE_LICENSE = GPL-2.0

This variable is wrong: it should be FAKE_HWCLOCK_LICENSE. Also, we prefer to have it before the LICENSE_FILES variable.

package/fake-hwclock/fake-hwclock.mk line 16

Quoted 4 lines
package/fake-hwclock/fake-hwclock.mk new file +4 -0
+define FAKE_HWCLOCK_NO_LSB
+	$(SED) 's at . /lib/lsb/init-functions@#. /lib/lsb/init-functions@' \
+		$(@D)/debian/fake-hwclock.init
+endef

This should be done by a patch.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/3 fake-hwclock: new package

Thomas, Christopher, All,

On 2018-08-14 16:00 +0200, Thomas Petazzoni spake thusly:

Quoted 11 lines · Christopher McCrory

package/fake-hwclock/Config.in line 10

Quoted 5 lines
package/fake-hwclock/Config.in new file +5 -0
+if BR2_PACKAGE_FAKE_HWCLOCK
+config BR2_PACKAGE_FAKE_HWCLOCK_CRONJOB
+        bool "install fake-hwclock cronjob"
+        help
+          Hourly cronjob to save current timestamp

What should be our policy for cronjobs ? I'm not sure we currently have packages that install cronjobs. What should we do? Install unconditionally? Have a sub-option?

Quoted 2 lines

I would personally lean towards installing unconditionally, but I'd like to have others opinions before applying.

Don't add an option; always install it.

Unless there is a *very* good reason not to (e.g. security considerations), in which case a rationale must be provided.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 1/3 fake-hwclock: new package

In reply to Thomas Petazzoni
Quoted 7 lines · Thomas Petazzoni

Hello,

Yann, Arnout, Peter, there is a question below.

Christopher, there are some review comments as well.

On phone, sorry for formatting. I'll look into this and the others

tomorrow. My other job got in the way today.

Quoted 32 lines · Christopher McCrory

package/fake-hwclock/Config.in line 10

Quoted 6 lines
package/fake-hwclock/Config.in new file +5 -0
+if BR2_PACKAGE_FAKE_HWCLOCK
+config BR2_PACKAGE_FAKE_HWCLOCK_CRONJOB
+        bool "install fake-hwclock cronjob"
+        help
+          Hourly cronjob to save current timestamp

What should be our policy for cronjobs ? I'm not sure we currently have packages that install cronjobs. What should we do? Install unconditionally? Have a sub-option?

I would personally lean towards installing unconditionally, but I'd like to have others opinions before applying.

package/fake-hwclock/fake-hwclock.mk line 11

Quoted 5 lines
package/fake-hwclock/fake-hwclock.mk new file +5 -0
+FAKE_HWCLOCK_VERSION = v0.11
+FAKE_HWCLOCK_SITE = https://git.einval.com/git/fake-hwclock.git
+FAKE_HWCLOCK_SITE_METHOD = git
+FAKE_HWCLOCK_LICENSE_FILES = COPYING
+FAKE_LICENSE = GPL-2.0

This variable is wrong: it should be FAKE_HWCLOCK_LICENSE. Also, we prefer to have it before the LICENSE_FILES variable.

package/fake-hwclock/fake-hwclock.mk line 16

Quoted 4 lines
package/fake-hwclock/fake-hwclock.mk new file +4 -0
+define FAKE_HWCLOCK_NO_LSB
+     $(SED) 's at . /lib/lsb/init-functions@#. /lib/lsb/init-functions@' \
+             $(@D)/debian/fake-hwclock.init
+endef

This should be done by a patch.

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering
https://bootlin.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180814/0deb8d54/attachment.html>

#6 lore raw

PATCH 1/3 fake-hwclock: new package

In reply to Thomas Petazzoni
Quoted 8 lines · Thomas Petazzoni

Hello,

Yann, Arnout, Peter, there is a question below.

Christopher, there are some review comments as well.

On Fri, 10 Aug 2018 07:46:34 -0700, Christopher McCrory wrote:

Quoted 8 lines

package/fake-hwclock/Config.in line 10

Quoted 5 lines
package/fake-hwclock/Config.in new file +5 -0
+if BR2_PACKAGE_FAKE_HWCLOCK
+config BR2_PACKAGE_FAKE_HWCLOCK_CRONJOB
+        bool "install fake-hwclock cronjob"
+        help
+          Hourly cronjob to save current timestamp

What should be our policy for cronjobs ? I'm not sure we currently have packages that install cronjobs.

We don't, for a good reason: we don't start a cron daemon.

Actually the 'at' package does install crontab entries, but it's kind of
pointless without crond...

Quoted 2 lines

What should we do? Install
unconditionally? Have a sub-option?

I agree with unconditional. Ideally, though, as part of the _INSTALL_INIT,
because for systemd you really want to use systemd.timer units instead of crontabs.

Quoted 13 lines

I would personally lean towards installing unconditionally, but I'd like to have others opinions before applying.

package/fake-hwclock/fake-hwclock.mk line 11

Quoted 5 lines
package/fake-hwclock/fake-hwclock.mk new file +5 -0
+FAKE_HWCLOCK_VERSION = v0.11
+FAKE_HWCLOCK_SITE = https://git.einval.com/git/fake-hwclock.git
+FAKE_HWCLOCK_SITE_METHOD = git
+FAKE_HWCLOCK_LICENSE_FILES = COPYING
+FAKE_LICENSE = GPL-2.0

This variable is wrong: it should be FAKE_HWCLOCK_LICENSE. Also, we prefer to have it before the LICENSE_FILES variable.

Quoted 6 lines

package/fake-hwclock/fake-hwclock.mk line 16

Quoted 4 lines
package/fake-hwclock/fake-hwclock.mk new file +4 -0
+define FAKE_HWCLOCK_NO_LSB
+	$(SED) 's at . /lib/lsb/init-functions@#. /lib/lsb/init-functions@' \
+		$(@D)/debian/fake-hwclock.init
+endef

This should be done by a patch.

Actually I think we'd prefer a Buildroot-specific init script instead of the
bloaty Debian one.

Regards,
Arnout

Quoted 5 lines

Thanks!

Thomas

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF