On 10/18/2012 12:19 PM, Tasslehoff Kjappfot wrote:
If /etc/timestamp was more recent than the output from date, the script
would set the date from the /etc/timestamp before rewriting it. Because of
this it was not possible to adjust the date backwards.

Signed-off-by: Tasslehoff Kjappfot <tasskj...@gmail.com>
---
  recipes-core/systemd/timestamp-service.bb          |    2 ++
  .../systemd/timestamp-service/load-timestamp.sh    |    8 +++++---
  2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/recipes-core/systemd/timestamp-service.bb 
b/recipes-core/systemd/timestamp-service.bb
index 0de6285..39e8a03 100644
--- a/recipes-core/systemd/timestamp-service.bb
+++ b/recipes-core/systemd/timestamp-service.bb
@@ -2,6 +2,8 @@ DESCRIPTION = "Poor mans RTC using timestamps"
  LICENSE = "MIT"
  LIC_FILES_CHKSUM = 
"file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
+PR = "r1"
+
  inherit allarch systemd
SRC_URI = "file://timestamp.service \
diff --git a/recipes-core/systemd/timestamp-service/load-timestamp.sh 
b/recipes-core/systemd/timestamp-service/load-timestamp.sh
index 82c69f6..9d42026 100755
--- a/recipes-core/systemd/timestamp-service/load-timestamp.sh
+++ b/recipes-core/systemd/timestamp-service/load-timestamp.sh
@@ -1,5 +1,10 @@
  #!/bin/sh
+if [ "$1" = "--save" ] ; then
+    /bin/date -u +%2m%2d%2H%2M%4Y > /etc/timestamp
+    exit $?
+fi
+
  # Set the system clock from hardware clock
  # If the timestamp is 1 day or more recent than the current time,
  # use the timestamp instead.
@@ -17,6 +22,3 @@ if [ $SYSTEMDATE -lt $TIMESTAMP ]; then
        date -u $(cat /etc/timestamp)
  fi
-if [ "$1" = "--save" ] ; then
-       /bin/date -u +%2m%2d%2H%2M%4Y > /etc/timestamp
-fi

You probably understood that the above was a new version of the patch. I tried to make the prefix [PATCH v2] and add a comment saying that I have no idea why I wrote the 1 hour stuff in the commit message, but my "git send-email" skills were too weak.


- Tasslehoff

_______________________________________________
Angstrom-distro-devel mailing list
Angstrom-distro-devel@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/angstrom-distro-devel

Reply via email to