pmaports/main/swclock-offset/swclock-offset-openrc.post-install
Jakob Hauser e6b0103b8c
main/swclock-offset: new package (MR 2191)
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.

[ci:skip-build] already built successfully in CI
2021-06-08 19:45:11 -07:00

17 lines
599 B
Bash

#!/bin/sh
# The service "osclock" is a dummy service simply providing "clock".
# This avoids other services that need "clock" to call the service
# "hwclock".
#
# The service "swclock-offset-boot" needs to run after the sysfs has
# been mounted. As the sysfs is mounted in runlevel sysinit, assigning
# the service to runlevel boot is enough to keep the order.
# replace service hwclock by osclock
rc-update -q del hwclock boot
rc-update -q add osclock boot
# assign swclock-offset services to runlevels
rc-update -q add swclock-offset-boot boot
rc-update -q add swclock-offset-shutdown shutdown