]> git.ipfire.org Git - thirdparty/util-linux.git/commit
Revert "hwclock-rtc.c: try the 'new' rtc class first"
authorRasmus Villemoes <ravi@prevas.dk>
Thu, 16 Jan 2025 10:38:47 +0000 (11:38 +0100)
committerRasmus Villemoes <ravi@prevas.dk>
Thu, 16 Jan 2025 10:56:18 +0000 (11:56 +0100)
commitbee7a00d9770e6abea27fd23c5a15729dd786837
treec83348ed041711693a8cf052d55bac8c0fa21171
parent23901d227c6e948a9f3a413a5f3e0ca41bc8f8fa
Revert "hwclock-rtc.c: try the 'new' rtc class first"

This (effectively) reverts commit
1811900a91be856e794005511eac7859adb8e383.

There was no real motivation given, and it certainly makes the default
behaviour of hwclock on current linux systems counter-intuitive: udev
has a standard rule so that whichever rtc device is designated as the
CONFIG_RTC_HCTOSYS_DEVICE one in the kernel configuration also becomes
the target of the /dev/rtc symlink. People may have some other way of
setting that symlink, but regardless, that must be considered the
primary or default rtc for the system.

Also, busybox's implementation of hwclock still uses the original
/dev/rtc, /dev/rtc0 order, meaning that installing util-linux's
version on a board previously using busybox leads to unexpected
regressions - it's not at all clear that one must go around and stick
--rtc /dev/rtc on every hwclock invocation in all scripts.

While it's usually busybox that should align with the full-fledged
implementation, in this case, I do believe that util-linux is
wrong.

There is no change in behaviour on systems that for some reason do not
have a /dev/rtc symlink, or for which it is a symlink to rtc0 (such as
on any board with only a single RTC device). However, I do understand
that reverting this after 8 years can itself lead to regressions, and
I can understand if it would be rejected for that reason. However, in
that case I'd appreciate a config option so that one can choose the
primary rtc device at build time.
include/pathnames.h
sys-utils/hwclock-rtc.c
sys-utils/hwclock.8.adoc