Bug#1057634: /sbin/hwclock: unrecognized option '--rtc=/dev/rtc0'
Mark Hindley
mark at hindley.org.uk
Wed Dec 6 14:57:12 GMT 2023
Control: tags -1 = patch
Svante,
On Wed, Dec 06, 2023 at 02:20:09PM +0100, Svante Signell wrote:
> On a qemu Hurd image:
>
> /sbin/hwclock --help | grep rtc
> --directisa use the ISA bus instead of /dev/rtc0 access
>
> /sbin/hwclock --directisa --show
> 2023-12-06 14:17:54.949951+01:00
Many thanks, that is a great help.
Could you and Martin test this patch, please?
I also propose downgrading the initscripts Depends: util-linux-extra to
Recommends. Even on non-systemd systems, hwclock.sh is far from essential as
many now use NTP and hwclock.sh already handles a missing /sbin/hwclock
gracefully.
Mark
commit acdbb98f05db8f24ddc9e72adb2b6a0982e69748
Author: Mark Hindley <mark at hindley.org.uk>
Date: Wed Dec 6 10:20:41 2023 +0000
hwclock.sh: support HURD direct ISA I/O.
Closes: #1057634
diff --git a/debian/src/initscripts/etc/init.d/hwclock.sh b/debian/src/initscripts/etc/init.d/hwclock.sh
index a9872b64..055508e7 100644
--- a/debian/src/initscripts/etc/init.d/hwclock.sh
+++ b/debian/src/initscripts/etc/init.d/hwclock.sh
@@ -38,13 +38,24 @@ hwclocksh()
# Updates the Hardware Clock with the System Clock time.
# This will *override* any changes made to the Hardware Clock,
# for example by the Linux kernel when NTP is in use.
- log_action_msg "Saving the system clock to /dev/$HCTOSYS_DEVICE"
- if /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc; then
- verbose_log_action_msg "Hardware Clock updated to `date`"
- fi
+ if [ "$(uname -s)" = GNU ]; then
+ log_action_msg "Saving the system clock to CMOS"
+ /sbin/hwclock --directisa --systohc
+ else
+ log_action_msg "Saving the system clock to /dev/$HCTOSYS_DEVICE"
+ /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc
+ fi
+ if [ $? -eq 0 ]; then
+ verbose_log_action_msg "Hardware Clock updated to `date`"
+ fi
+
;;
show)
- /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --show
+ if [ "$(uname -s)" = GNU ]; then
+ /sbin/hwclock --directisa --show
+ else
+ /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --show
+ fi
;;
*)
log_success_msg "Usage: hwclock.sh {stop|reload|force-reload|show}"
More information about the Debian-init-diversity
mailing list