All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lauri Hintsala <lauri.hintsala@bluegiga.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v2] initscripts: fix timestamp check at bootmisc.sh
Date: Tue, 13 Dec 2011 15:18:56 +0200	[thread overview]
Message-ID: <4EE750C0.8050703@bluegiga.com> (raw)
In-Reply-To: <1323781625.24417.150.camel@phil-desktop>



On 12/13/2011 03:07 PM, Phil Blundell wrote:
> On Tue, 2011-12-13 at 14:58 +0200, Lauri Hintsala wrote:
>> SYSTEMDATE=`date -u +%4Y%2m%2d`
>> TIMESTAMP=`awk '{ print substr($0,9,4) substr($0,1,4); }'<  /etc/timestamp`
>> if [ $TIMESTAMP -gt $SYSTEMDATE ]; then
>> 	read TIMESTAMP<  /etc/timestamp
>> 	date -u $TIMESTAMP
>> 	/etc/init.d/hwclock.sh stop
>> fi
>>
>> How about this?
>
> You could lose the call to "awk" as well:
>
> read RAWTIMESTAMP<  /etc/timestamp
> TIMESTAMP=${RAWTIMESTAMP#????????}${RAWTIMESTAMP%????????}
>
> Or, er, something like that.  You might need to tweak the patterns a bit
> depending on what exactly the format of /etc/timestamp actually is, but
> I guess you get the idea.

Yes I got your idea and it seems to work. Thanks for your tips!

Second try:

SYSTEMDATE=`date -u +%4Y%2m%2d`
read TIMESTAMP < /etc/timestamp
if [ ${TIMESTAMP:8:4}${TIMESTAMP:0:4} -gt $SYSTEMDATE ]; then
     date -u $TIMESTAMP
     /etc/init.d/hwclock.sh stop
fi

Is this okay? Should I generate patch?

Lauri



  reply	other threads:[~2011-12-13 13:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08  7:07 [PATCH] initscripts: fix timestamp check at bootmisc.sh Lauri Hintsala
2011-12-13  6:58 ` [PATCH v2] " Lauri Hintsala
2011-12-13  7:45   ` Koen Kooi
2011-12-13  8:26     ` Lauri Hintsala
2011-12-13 12:26   ` Richard Purdie
2011-12-13 12:36     ` Phil Blundell
2011-12-13 12:58       ` Lauri Hintsala
2011-12-13 13:07         ` Phil Blundell
2011-12-13 13:18           ` Lauri Hintsala [this message]
2011-12-13 13:24             ` Phil Blundell
2011-12-13 13:31               ` Henning Heinold
2011-12-13 13:40               ` Lauri Hintsala
2011-12-14  6:27 ` [PATCH v3] initscripts: fix timestamp checking " Lauri Hintsala
2011-12-15 19:17   ` Saul Wold

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=4EE750C0.8050703@bluegiga.com \
    --to=lauri.hintsala@bluegiga.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.