From: Chang Rebecca Swee Fun <[email protected]>

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 <[email protected]>
---
 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

-- 
_______________________________________________
meta-intel mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-intel

Reply via email to