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
-- 
1.7.9.5


_______________________________________________
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