From: Saul Wold <sgw@linux.intel.com>
To: Ben Shelton <ben.shelton@ni.com>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 2/5] initscripts: save /etc/timestamp with seconds accuracy
Date: Wed, 16 Jul 2014 15:05:41 -0700 [thread overview]
Message-ID: <53C6F735.2060208@linux.intel.com> (raw)
In-Reply-To: <0ae4bf831ba9b0ffce4eeb6403da183a5e71a445.1405542432.git.ben.shelton@ni.com>
On 07/16/2014 01:59 PM, Ben Shelton wrote:
> From: Blair Elliott <blair.elliott@ni.com>
>
> Currently, /etc/timestamp is saved with minutes accuracy. To increase
> the accuracy, modify the save-rtc.sh and bootmisc.sh scripts to save and
> read /etc/timestamp respectively with seconds accuracy.
>
We also initialize it in the image.bbclass, you may want to tweak that one.
Since we deal with readonly it's possible it won't get updated after the
image creation.
Sau!
> Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
> Signed-off-by: Ben Shelton <ben.shelton@ni.com>
> ---
> meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | 5 +++--
> meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh | 2 +-
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> index 5211824..ccc7f9f 100755
> --- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> @@ -66,10 +66,11 @@ fi
> test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start
> if test -e /etc/timestamp
> then
> - SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M`
> + SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M%2S`
> read TIMESTAMP < /etc/timestamp
> if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
> - date -u ${TIMESTAMP#????}${TIMESTAMP%????????}
> + # format the timestamp as date expects it (2m2d2H2M4Y.2S)
> + date -u ${TIMESTAMP:4:8}${TIMESTAMP:0:4}.${TIMESTAMP:(-2)}
> test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop
> fi
> fi
> diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> index 1f804e2..b038fc5 100644
> --- a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> @@ -10,4 +10,4 @@
> ### END INIT INFO
>
> # Update the timestamp
> -date -u +%4Y%2m%2d%2H%2M > /etc/timestamp
> +date -u +%4Y%2m%2d%2H%2M%2S > /etc/timestamp
>
next prev parent reply other threads:[~2014-07-16 22:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 20:59 [PATCH 0/5] Various fixes and improvements to initscripts Ben Shelton
2014-07-16 20:59 ` [PATCH 1/5] initscripts: bootmisc.sh: Make sysctl -p honor VERBOSE Ben Shelton
2014-07-16 22:10 ` Saul Wold
2014-07-17 15:02 ` Ben Shelton
2014-07-16 20:59 ` [PATCH 2/5] initscripts: save /etc/timestamp with seconds accuracy Ben Shelton
2014-07-16 22:05 ` Saul Wold [this message]
2014-07-17 15:00 ` Ben Shelton
2014-07-16 20:59 ` [PATCH 3/5] initscripts: parametrize random seed file location Ben Shelton
2014-07-16 20:59 ` [PATCH 4/5] initscripts: Use current date as an additional source of entropy Ben Shelton
2014-07-16 20:59 ` [PATCH 5/5] initscripts: make hostname.sh coreutils-compatible Ben Shelton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53C6F735.2060208@linux.intel.com \
--to=sgw@linux.intel.com \
--cc=ben.shelton@ni.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox