pmaports/main/swclock-offset/swclock-offset-openrc.post-install
Jakob Hauser 5f7a5aa7a4
main/swclock-offset: update dependency tree cache (MR 2244)
If the system time jumps back and forth before installing the package
"swclock-offset", OpenRC can get confused whether the current dependency
tree is old or new. To resolve this confusion, the dependency tree cache
is updated within the post-install script of the openrc subpackage.
2021-06-10 19:36:00 +03:00

25 lines
935 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.
#
# Before installation of the package "swclock-offset", the system time
# might jump back and forth. Because of this, OpenRC can get confused
# whether the cached dependency tree is old or new. To avoid this
# uncertainty, an update of the dependency tree cache is triggered here.
# 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
# update dependency tree cache
rc-update -q --update