Gentoo hwclock error: /dev/rtc file not found

2012-02-06

Saturday usually is a day during which I update my OS', and so it was on this past week. I fancied it was time to update the kernel, too, since it had been a while. Everything went as smoothly as ever, despite the fact that I didn't use an existing config but set everything up manually this time. Until…

Today I launched off Anki on the desktop instead of reviewing the flashcards on my phone, and I was greeted with a notification that told me that my clock was 7198 seconds off, and continuing could cause some serious trouble for my deck.

7198 seconds is roughly two hours, so I figured it had something to do with time zones. It was only then that I noticed my desktop's clock was indeed off by that two hours. Hwclock would spit me an error:

# hwclock
Cannot access the Hardware Clock via any known method.  Use the
–debug option to see the details of our search for an access method.
# hwclock –debug
hwclock from util-linux 2.19.1
hwclock: Open of /dev/rtc failed, errno=2:
No such file or directory.  No usable clock interface found.
Cannot access the Hardware Clock via any known method.

Now, I have had this problem before, but I couldn't remember the solution straight away, which is why I'm making this note. /dev/rtc wasn’t available because rtc wasn't enabled in the kernel. Enabling it (Device Drivers -> Real-time Clock) got the hwclock working. This episode also revealed me that the desktop didn't have ntpd installed, so I set openntpd up to keep the clock in time in the future.