[maemo-commits] [maemo-commits] r16374 - in projects/haf/trunk/osso-af-startup: debian top-scripts

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Oct 8 15:29:00 EEST 2008
Author: schulhof
Date: 2008-10-08 15:28:59 +0300 (Wed, 08 Oct 2008)
New Revision: 16374

Added:
   projects/haf/trunk/osso-af-startup/top-scripts/hwclock
Modified:
   projects/haf/trunk/osso-af-startup/debian/changelog
Log:
Added hwclock startup script

Modified: projects/haf/trunk/osso-af-startup/debian/changelog
===================================================================
--- projects/haf/trunk/osso-af-startup/debian/changelog	2008-10-08 09:18:04 UTC (rev 16373)
+++ projects/haf/trunk/osso-af-startup/debian/changelog	2008-10-08 12:28:59 UTC (rev 16374)
@@ -1,3 +1,9 @@
+osso-af-startup (1.70-2unreleased0) unstable; urgency=low
+
+  * Added init script to save clock state to hw: top-scripts/hwclock
+
+ -- Gabriel Schulhof <gabriel.schulhof at nokia.com>  Wed,  8 Oct 2008 14:22:55 +0300
+
 osso-af-startup (1.70-1) unstable; urgency=low
 
   * Start/stop tracker from real-af-startup

Added: projects/haf/trunk/osso-af-startup/top-scripts/hwclock
===================================================================
--- projects/haf/trunk/osso-af-startup/top-scripts/hwclock	2008-10-08 09:18:04 UTC (rev 16373)
+++ projects/haf/trunk/osso-af-startup/top-scripts/hwclock	2008-10-08 12:28:59 UTC (rev 16374)
@@ -0,0 +1,44 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          hwclock
+# Required-Start:
+# Required-Stop:
+# Default-Start:     S 1 2 3 4 5
+# Default-Stop:      0 6
+# Short-Description: Hardware clock sync
+# Description:       Syncronizes the system clock to the hardware clock
+#                    at shutdown and the hardware clock to the system
+#                    clock at bootup
+### END INIT INFO
+# -*- coding: utf-8 -*-
+# Debian init.d script for hwclock
+# Copyright Nokia Corporation 2008
+
+case "$1" in
+  start)
+    if test -x "/sbin/hwclock"; then
+      echo -n 'Synching hardware clock to system time ... '
+      /sbin/hwclock --hctosys
+      if test "x$?" = "x0"; then
+        echo "OK"
+      else
+        echo "FAILED"
+      fi
+    fi
+  ;;
+  stop)
+    if test -x "/sbin/hwclock"; then
+      echo -n 'Synching system time to hardware clock ... '
+      /sbin/hwclock --systohc
+      if test "x$?" = "x0"; then
+        echo "OK"
+      else
+        echo "FAILED"
+      fi
+    fi
+  ;;
+  *)
+    echo "Usage: /etc/init.d/$NAME {start|stop}" >&2
+    exit 2
+  ;;
+esac


More information about the maemo-commits mailing list