diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2014-06-25 09:51:06 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2014-08-04 11:12:25 +0200 |
commit | 6f8534436e6294ff47217086eca79ee37d422fce (patch) | |
tree | 21a3467bbb11e3188764edde1bd819cb37ff0cff | |
parent | 957c3ced48b38cda4e283559897d156f1f61eb0c (diff) |
timestamp-service: change to new timestamp format
Patch pending in meta-angstrom
-rw-r--r-- | recipes-core/systemd/timestamp-service.bbappend | 1 | ||||
-rwxr-xr-x | recipes-core/systemd/timestamp-service/load-timestamp.sh | 18 | ||||
-rw-r--r-- | recipes/images/trdx-extra.inc | 6 |
3 files changed, 20 insertions, 5 deletions
diff --git a/recipes-core/systemd/timestamp-service.bbappend b/recipes-core/systemd/timestamp-service.bbappend new file mode 100644 index 0000000..72d991c --- /dev/null +++ b/recipes-core/systemd/timestamp-service.bbappend @@ -0,0 +1 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/recipes-core/systemd/timestamp-service/load-timestamp.sh b/recipes-core/systemd/timestamp-service/load-timestamp.sh new file mode 100755 index 0000000..b34c7ca --- /dev/null +++ b/recipes-core/systemd/timestamp-service/load-timestamp.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Set the system clock from hardware clock +# If the timestamp is 1 day or more recent than the current time, +# use the timestamp instead. +SYSTEMDATE=$(/bin/date -u "+%4Y%2m%2d%2H%2M") + +TIMESTAMP=$(/bin/cat /etc/timestamp 2>/dev/null) + +if [ ${TIMESTAMP} -gt $SYSTEMDATE ] 2>/dev/null ; then + echo "Update systemtime from /etc/timestamp" + /bin/date -u ${TIMESTAMP#????}${TIMESTAMP%????????} +fi + +if [ "$1" = "--save" ] ; then + /bin/date -u +%4Y%2m%2d%2H%2M > /etc/timestamp +fi + diff --git a/recipes/images/trdx-extra.inc b/recipes/images/trdx-extra.inc index 3efacc6..b933359 100644 --- a/recipes/images/trdx-extra.inc +++ b/recipes/images/trdx-extra.inc @@ -10,12 +10,8 @@ DEPENDS += "canutils libsocketcan iproute2" #the following builds cross gdb and gdbserver DEPENDS += "gdb-cross" -# angstrom and oe-core disagree on the format -rootfs_update_timestamp_classic () { - date -u +%2m%2d%2H%2M%4Y >${IMAGE_ROOTFS}/etc/timestamp -} #create the file /etc/timestamp -IMAGE_PREPROCESS_COMMAND = "rootfs_update_timestamp_classic" +IMAGE_PREPROCESS_COMMAND = "rootfs_update_timestamp" IMAGE_INSTALL_T20_T30 = " \ gpioconfig \ |