From 5f7a5aa7a47e2f831266780191ddf7dc1c747034 Mon Sep 17 00:00:00 2001 From: Jakob Hauser Date: Thu, 10 Jun 2021 17:00:23 +0200 Subject: [PATCH] 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. --- main/swclock-offset/APKBUILD | 2 +- main/swclock-offset/swclock-offset-openrc.post-install | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/main/swclock-offset/APKBUILD b/main/swclock-offset/APKBUILD index 8cbc4f8ad..3b09e1cf2 100644 --- a/main/swclock-offset/APKBUILD +++ b/main/swclock-offset/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: Jakob Hauser pkgname=swclock-offset -pkgver=0.1 +pkgver=0.2 pkgrel=0 pkgdesc="Keep system time at an offset to a non-writable RTC" url="https://gitlab.com/postmarketOS/pmaports" diff --git a/main/swclock-offset/swclock-offset-openrc.post-install b/main/swclock-offset/swclock-offset-openrc.post-install index e0275855d..267aa554f 100644 --- a/main/swclock-offset/swclock-offset-openrc.post-install +++ b/main/swclock-offset/swclock-offset-openrc.post-install @@ -7,6 +7,11 @@ # 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 @@ -15,3 +20,6 @@ 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