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

Koen Kooi koen at dominion.thruhere.net
Tue Dec 13 07:45:29 UTC 2011



Op 13 dec. 2011 om 07:58 heeft Lauri Hintsala <lauri.hintsala at bluegiga.com> het volgende geschreven:

> Timestamp checking has been broken by the commit
> 2078af333d704fd894a2dedbc19cef5775cdadbb. Fix timestamp checking
> and clean the code.
> 
> cc: sgw at linux.intel.com
> cc: gary at mlbassoc.com
> 
> Signed-off-by: Lauri Hintsala <lauri.hintsala at bluegiga.com>
> ---
> .../initscripts/initscripts-1.0/bootmisc.sh        |   12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> index 03fd67c..6d68b35 100755
> --- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> @@ -62,16 +62,16 @@ then
> fi
> 
> # Set the system clock from hardware clock
> -# If the timestamp is 1 day or more recent than the current time,
> +# If the timestamp is more recent than the current time,
> # use the timestamp instead.
> /etc/init.d/hwclock.sh start
> if test -e /etc/timestamp
> then
> -    SYSTEMDATE=`date  -u +%2m%2d%2H%2M%4Y`
> -    read TIMESTAMP < /etc/timestamp
> -        NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE + 10000 \)`
> -        if [ $NEEDUPDATE -eq 1 ]; then 
> -        date -u $TIMESTAMP
> +    SYSTEMDATE=`date -u +%4Y%2m%2d`
> +    TIMESTAMP=`cat /etc/timestamp | awk '{ print substr($0,9,4) substr($0,1,4); }'`
> +    NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE \)`
> +    if [ $NEEDUPDATE -eq 1 ]; then
> +        date -u `cat /etc/timestamp`
>        /etc/init.d/hwclock.sh stop
>    fi
> fi

This changes the format of timestamp, which breaks the code in image.bbclass.

Have a look at http://git.angstrom-distribution.org/cgi-bin/cgit.cgi/meta-angstrom/commit/?id=e003be8cba3d387f44a502fdbebf58e774afd677 for backwards compatible Logic 




> -- 
> 1.7.4.1
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core




More information about the Openembedded-core mailing list