Skip to content

main/swclock-offset: new package

Jakko requested to merge jakko/pmaports:swclock-offset into master

Some devices have a working but non-writable real-time clock (RTC). This package contains two shell scripts: One writes the offset between 'hwclock' and 'swclock' to a file at shutdown, another one reads the offset from the file at boot and sets the 'swclock'. This way the system time in userspace is kept in present time.

Comment on the shell scripts:

  • The string passed to the command "date" may contain negative values. However, "date" is capable to deal with this.
  • Command "date" returns an output. It provides no quiet option. Let's send the output to the null device.

Comments on the initd scripts:

  • The intrd script for boot contains the dependencies "before fsck dmesg syslog". They have little effect on the point in time the script is started because it can't be startet much earlier than it already does.

Comments on the install scripts:

  • The script setting the 'swclock' is assigned to the runlevel "sysinit" with the intension to set the time as early as possible.
  • The service "osclock" is added instead of "hwclock" to avoid "hwclock being started as dependency of another rc-service" [1]. Actually it only contains "provide clock" [2] to satisfy clock dependencies.

Fixes #1096 (closed)

[1] https://wiki.gentoo.org/wiki/System_time#OpenRC_2

[2] https://github.com/OpenRC/openrc/blob/0d86c4903bdc68d2d4704ab6c2d4fc8f2c054276/init.d/osclock.in

Edited by Minecrell

Merge request reports