From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Ben Shelton <ben.shelton@ni.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v2 2/6] initscripts: save /etc/timestamp with seconds accuracy
Date: Sun, 20 Jul 2014 23:56:15 +0100 [thread overview]
Message-ID: <1405896975.22985.84.camel@ted> (raw)
In-Reply-To: <c417e9dd139050026787229778db277911302044.1405633546.git.ben.shelton@ni.com>
On Thu, 2014-07-17 at 16:56 -0500, 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.
>
> Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
> Signed-off-by: Ben Shelton <ben.shelton@ni.com>
> ---
> meta/classes/image.bbclass | 2 +-
> meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | 5 +++--
> meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh | 2 +-
> 3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index a03b880..772c3ed 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -359,7 +359,7 @@ set_image_autologin () {
> # Can be use to create /etc/timestamp during image construction to give a reasonably
> # sane default time setting
> rootfs_update_timestamp () {
> - date -u +%4Y%2m%2d%2H%2M >${IMAGE_ROOTFS}/etc/timestamp
> + date -u +%4Y%2m%2d%2H%2M%2S >${IMAGE_ROOTFS}/etc/timestamp
> }
>
> # Prevent X from being started
> 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
The syntax above doesn't appear to work with busybox:
/etc/init.d/rc: /etc/rcS.d/S55bootmisc.sh: line 73: syntax error: bad substitution
:(
Cheers,
Richard
next prev parent reply other threads:[~2014-07-20 22:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 21:56 [PATCH v2 0/6] Various fixes and improvements to initscripts Ben Shelton
2014-07-17 21:56 ` [PATCH v2 1/6] initscripts: bootmisc.sh: Make sysctl -p honor VERBOSE Ben Shelton
2014-07-17 21:56 ` [PATCH v2 2/6] initscripts: save /etc/timestamp with seconds accuracy Ben Shelton
2014-07-20 22:56 ` Richard Purdie [this message]
2014-07-17 21:56 ` [PATCH v2 3/6] initscripts: parametrize random seed file location Ben Shelton
2014-07-17 21:56 ` [PATCH v2 4/6] initscripts: Use current date as an additional source of entropy Ben Shelton
2014-07-17 21:56 ` [PATCH v2 5/6] initscripts: make hostname.sh coreutils-compatible Ben Shelton
2014-07-17 21:56 ` [PATCH v2 6/6] initscripts: Add support for /etc/default/urandom 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=1405896975.22985.84.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--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