[OE-core] [PATCH v2] initscripts: fix timestamp check at bootmisc.sh

Phil Blundell philb at gnu.org
Tue Dec 13 13:24:47 UTC 2011


On Tue, 2011-12-13 at 15:18 +0200, Lauri Hintsala wrote:
> On 12/13/2011 03:07 PM, Phil Blundell wrote:
> > read RAWTIMESTAMP<  /etc/timestamp
> > TIMESTAMP=${RAWTIMESTAMP#????????}${RAWTIMESTAMP%????????}
>
> 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?

Is the "${var:X:Y}" substring notation part of POSIX?  I have a feeling
that it might be a GNU extension, and it didn't seem to work in dash
when I tried it just now.

p.






More information about the Openembedded-core mailing list