Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: fake-hwclock-0.11
Date: Fri, 04 Oct 2019 10:17:31 +0200	[thread overview]
Message-ID: <20191004081731.AGXdgu14qAb9h0rJhiIra5Ri4450qY8os-3tGR2rMIo@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-15056@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1664 bytes --]

There is an updated pull request by dreamtigers against master on the void-packages repository

https://github.com/dreamtigers/void-packages master
https://github.com/void-linux/void-packages/pull/15056

New package: fake-hwclock-0.11
Hello! I closed the previous pull request (#14985) and I'm making a new one
(sorry if it's wrong, I'm not used to pull requests) with some fixes so:
1. The template file now passes `xlint`'s test.
2. The service now behaves more like the systemd original one (that is, a
   "oneshot" service)

Thanks to maldridge, pulux, and bobertlo on IRC for their help and guidance!

Brief description of the package:

Save/restore system clock on machines without working RTC hardware.

Some machines don't have a working Real Time Clock (RTC) unit, or no driver for
said hardware. fake-hwclock is a simple set of scripts to save the kernel's
current clock periodically (including at shutdown) and restore it at boot so
that the system clock keeps at least close to the real time. This will stop
some of the problems that may be caused by a system believing it has travelled
in time back to 1970.

This is originally a Debian package, and as Debian uses systemd as it's init
and service manager, most of the init and service instructions were useless for
Void.

I took the liberty of adapting the scripts and patching the manpage with the
instructions to make fake-hwclock execute on boot and shutdown in Void Linux
(or at least distributions that use runit as init), all while being as
faithful to upstream as possible.


A patch file from https://github.com/void-linux/void-packages/pull/15056.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-15056.patch --]
[-- Type: text/x-diff, Size: 4080 bytes --]

From 9488d2ea01eb9a8ebece701c0b16e40aef6fa537 Mon Sep 17 00:00:00 2001
From: Ivan Gonzalez Polanco <ivan14polanco@gmail.com>
Date: Fri, 4 Oct 2019 03:55:48 -0400
Subject: [PATCH] New package: fake-hwclock-0.11

Thanks maldridge, pulux, and bobertlo on IRC for the help provided!
---
 .../fake-hwclock/files/fake-hwclock/finish    |  2 ++
 srcpkgs/fake-hwclock/files/fake-hwclock/run   |  5 +++
 srcpkgs/fake-hwclock/patches/manpage.patch    | 34 +++++++++++++++++++
 srcpkgs/fake-hwclock/template                 | 25 ++++++++++++++
 4 files changed, 66 insertions(+)
 create mode 100755 srcpkgs/fake-hwclock/files/fake-hwclock/finish
 create mode 100755 srcpkgs/fake-hwclock/files/fake-hwclock/run
 create mode 100644 srcpkgs/fake-hwclock/patches/manpage.patch
 create mode 100644 srcpkgs/fake-hwclock/template

diff --git a/srcpkgs/fake-hwclock/files/fake-hwclock/finish b/srcpkgs/fake-hwclock/files/fake-hwclock/finish
new file mode 100755
index 00000000000..2b54817ed0b
--- /dev/null
+++ b/srcpkgs/fake-hwclock/files/fake-hwclock/finish
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec fake-hwclock save
diff --git a/srcpkgs/fake-hwclock/files/fake-hwclock/run b/srcpkgs/fake-hwclock/files/fake-hwclock/run
new file mode 100755
index 00000000000..e5f8c5a70c8
--- /dev/null
+++ b/srcpkgs/fake-hwclock/files/fake-hwclock/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+exec 1>&2
+[ -r /etc/default/fake-hwclock ] && . /etc/default/fake-hwclock
+fake-hwclock load $FORCE || exit 1
+exec chpst -b fake-hwclock pause
diff --git a/srcpkgs/fake-hwclock/patches/manpage.patch b/srcpkgs/fake-hwclock/patches/manpage.patch
new file mode 100644
index 00000000000..f404d6ffc4a
--- /dev/null
+++ b/srcpkgs/fake-hwclock/patches/manpage.patch
@@ -0,0 +1,34 @@
+--- o.fake-hwclock.8	2019-10-03 01:19:44.542744670 -0400
++++ fake-hwclock.8	2019-10-03 01:21:03.241032055 -0400
+@@ -1,4 +1,4 @@
+-.TH FAKE-HWCLOCK 8 "1 October 2014" Debian
++.TH FAKE-HWCLOCK 8 "4 October 2019" Linux
+ .SH NAME
+ fake-hwclock \- Control fake hardware clock
+ .SH SYNOPSIS
+@@ -23,6 +23,11 @@
+ case, in which case it is possible to modify the init system
+ configuration to move things earlier/later as appropriate.
+
++This program was originally written for Debian, which uses an init system
++different from \fBrunit\fP. To add \fBfake-hwclock\fP as a service, the system
++administrator must link the directory \fI/etc/sv/fake-hwclock\fP to
++\fI/var/service\fP.
++
+ .SH DESCRIPTION
+ \fBfake-hwclock\fP sets and queries a fake "hardware clock" which stores the
+ time in a file. This program may be run by the system administrator
+@@ -47,11 +52,8 @@
+ \fB/etc/fake-hwclock.data\fR
+ The file used to store the time
+ .TP
+-\fB/etc/init.d/fake-hwclock\fR
+-The init script used to run fake-hwclock on startup and shutdown
+-.TP
+-\fB/lib/systemd/system/fake-hwclock.service\fR
+-systemd service used to run fake-hwclock on startup and shutdown
++\fB/etc/sv/fake-hwclock/\fR
++runit service used to run fake-hwclock on startup and shutdown
+ .TP
+ \fB/etc/default/fake-hwclock\fR
+ Settings file for the init script.
diff --git a/srcpkgs/fake-hwclock/template b/srcpkgs/fake-hwclock/template
new file mode 100644
index 00000000000..3fe76b3b749
--- /dev/null
+++ b/srcpkgs/fake-hwclock/template
@@ -0,0 +1,25 @@
+# Template file for 'fake-hwclock'
+pkgname=fake-hwclock
+version=0.11
+revision=1
+archs=noarch
+create_wrksrc=yes
+short_desc="Save/restore system clock on machines without working RTC hardware"
+maintainer="Ivan Gonzalez Polanco <ivan14polanco@gmail.com>"
+license="GPL-2.0-only"
+homepage="https://tracker.debian.org/pkg/fake-hwclock"
+distfiles="${DEBIAN_SITE}/main/f/${pkgname}/${pkgname}_${version}.tar.gz"
+checksum="58e29ff272a8e8b40ab972c49f82fd8fb6ef69a7fdde5f84292f800b53ea29ce"
+
+do_extract() {
+	filename="$(basename ${distfiles})"
+	tar xzf ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${filename} --strip-components=1 -C ${wrksrc}
+}
+
+do_install() {
+	vbin ${pkgname}
+	vconf etc/default/${pkgname}
+	vinstall debian/${pkgname}.cron.hourly 755 etc/cron.hourly ${pkgname}
+	vman ${pkgname}.8
+	vsv ${pkgname}
+}

  parent reply	other threads:[~2019-10-04  8:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04  8:11 [PR PATCH] " voidlinux-github
2019-10-04  8:17 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-04  8:17 ` voidlinux-github [this message]
2019-10-04 18:46 ` voidlinux-github
2019-10-06  3:04 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-06  3:04 ` voidlinux-github
2019-11-09 21:13 ` [PR PATCH] [Merged]: " voidlinux-github

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191004081731.AGXdgu14qAb9h0rJhiIra5Ri4450qY8os-3tGR2rMIo@z \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).