[meta-intel] [meta-intel-iot-devkit] [PATCH] timedate-scripts: fix date and time format in keep-shutdown-time script

rebecca.swee.fun.chang at intel.com rebecca.swee.fun.chang at intel.com
Tue Jun 2 03:02:35 PDT 2015


From: Chang Rebecca Swee Fun <rebecca.swee.fun.chang at intel.com>

The date and time format was invalid in the script causes service
execution failed when we shutdown or power off the system.
The date and time format used in Yocto Project is %4Y%2m%2d%2H%2M.
This patch also includes some code clean up by removing trailing whitespaces
and redundant lines at the end of script.

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang at intel.com>
---
 recipes-support/timedate-scripts/files/keep-shutdown-time | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/recipes-support/timedate-scripts/files/keep-shutdown-time b/recipes-support/timedate-scripts/files/keep-shutdown-time
index d639743..18f1194 100755
--- a/recipes-support/timedate-scripts/files/keep-shutdown-time
+++ b/recipes-support/timedate-scripts/files/keep-shutdown-time
@@ -1,16 +1,14 @@
 #!/usr/bin/env bash
 
-# keep date of shutdown by touching /etc/version 
+# keep date of shutdown by touching /etc/version
 # this time will be set on the next run as initial time
 
 # touch /etc/version with later date (either /etc/version or current date)
 d0=$(cat /etc/version)
-d1=$(date +'%Y%m%d%H%M')
+d1=$(date +'%4Y%2m%2d%2H%2M')
 
-if [[ $d1 -gt $d0 ]]; then 
+if [[ $d1 -gt $d0 ]]; then
   touch /etc/version
 else
   touch -t $d0 /etc/version
 fi
-
-
-- 
1.9.1



More information about the meta-intel mailing list