[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

hwclock: NVRAM flat battery sets date to 1904



retitle 520763 hwclock: NVRAM flat battery sets date to 1904
severity important
tags 520763 patch
thanks

This is a common problem on powerpc ibook's once the NVRAM battery goes flat.

Apparently this has been discussed with upstream:
https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/23426/comments/18

Mark


This patch is a quick hack, but you get the idea:

--- hwclockfirst.sh.orig        2009-05-16 14:26:54.000000000 +1000
+++ hwclockfirst.sh     2009-05-16 14:23:11.000000000 +1000
@@ -38,6 +38,12 @@
     . /lib/lsb/init-functions
     verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; }

+    if `/sbin/hwclock | /bin/grep -q 1904`; then
+       log_warning_msg "NVRAM Battery Clock flat (date 1904)"
+       log_action_msg "Setting hwclock date to 2009-5-16"
+       hwclock --set --date 2009-5-16
+    fi
+
     [ "$GMT" = "-u" ] && UTC="yes"
     case "$UTC" in
        no|"")  GMT="--localtime"

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: