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
This commit is contained in:
parent
4c0ec94eb4
commit
e6b0103b8c
9 changed files with 189 additions and 1 deletions
29
main/swclock-offset/swclock-offset-shutdown.initd
Normal file
29
main/swclock-offset/swclock-offset-shutdown.initd
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
# A dedicated shutdown service is used to write the offset file instead
|
||||
# of using the stop function of the swclock-offset service at boot. This
|
||||
# approach is more fail-safe on different installation/deinstallation
|
||||
# situations.
|
||||
#
|
||||
# Because the shutdown services are performed late within the shutdown
|
||||
# runlevel, dependencies are needed to execute the script before
|
||||
# processes are killed and filesystems are remounted read-only.
|
||||
|
||||
description="Writing the offset between system time and RTC to a file."
|
||||
|
||||
depend()
|
||||
{
|
||||
before killprocs mount-ro
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
ebegin "Saving swclock-offset"
|
||||
/sbin/swclock-offset-shutdown
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
return 0
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue