]> git.ipfire.org Git - thirdparty/util-linux.git/commit
hwclock: skip RTC_PARAM_SET for --param-set with unchanged value
authorBastian Krause <bst@pengutronix.de>
Fri, 24 Oct 2025 15:32:20 +0000 (17:32 +0200)
committerBastian Krause <bst@pengutronix.de>
Thu, 30 Oct 2025 11:05:11 +0000 (12:05 +0100)
commit3f3f7298347c88cc5e2265f949d60bc40e0d0ebe
tree82dc10899a952ea440639e0f98fe90a97f4a6c28
parent7492ca660b235cfea5cf78f1c3d5f0dc4e535545
hwclock: skip RTC_PARAM_SET for --param-set with unchanged value

Parameters set with `hwclock --param-set` tend to be persisted in the
RTC's EEPROM. Writing the same value over and over again can wear out
the EEPROM (e.g. on each boot).
So read the current value first. Only if the parameter is changed,
actually write the new value.

This allows for easier integrations, especially since there is no
machine-readable way of retrieving the current value via hwclock.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
sys-utils/hwclock-rtc.c