cc: [email protected]
cc: [email protected]
Signed-off-by: Lauri Hintsala <[email protected]>
---
Hello guys,
It seems that timestamp checking has been broken by the commit
2078af333d704fd894a2dedbc19cef5775cdadbb. Some notes about following
lines.
meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh:
/etc/init.d/hwclock.sh start
if test -e /etc/timestamp
then
SYSTEMDATE=`date -u +%2m%2d%2H%2M`
read TIMESTAMP < /etc/timestamp
# Remove year from timestamp.
TMP=`echo $TIMESTAMP | cut -c -8`
NEEDUPDATE=`expr \( $TMP \> $SYSTEMDATE + 10000 \)`
if [ $NEEDUPDATE -eq 1 ]; then
date -u $TIMESTAMP
/etc/init.d/hwclock.sh stop
fi
fi
1. Overflow happens in expr command of busybox if the length of number
is over 10 digits (now the length is 12 digits). This could be fixed
enabling flag CONFIG_EXPR_MATH_SUPPORT_64 from busybox config.
$ expr 120808302011 + 10000
-2147473649
2. Expression is adding +1 to minutes, not to days as supposed.
If that form is used "100000000" should be added instead of "10000".
3. The year is at the end of timestamp (last 4 least significant digits)
so it doesn't matter if it is there or not. So I decided to remove
year from the timestamp we are comparing. Then it is not needed to
attend to my note number 1.
BR,
Lauri Hintsala
---
.../initscripts/initscripts-1.0/bootmisc.sh | 8 +++++---
1 files changed, 5 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 03fd67c..e97b5f8 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -67,10 +67,12 @@ fi
/etc/init.d/hwclock.sh start
if test -e /etc/timestamp
then
- SYSTEMDATE=`date -u +%2m%2d%2H%2M%4Y`
+ SYSTEMDATE=`date -u +%2m%2d%2H%2M`
read TIMESTAMP < /etc/timestamp
- NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE + 10000 \)`
- if [ $NEEDUPDATE -eq 1 ]; then
+ # Remove year from timestamp.
+ TMP=`echo $TIMESTAMP | cut -c -8`
+ NEEDUPDATE=`expr \( $TMP \> $SYSTEMDATE + 10000 \)`
+ if [ $NEEDUPDATE -eq 1 ]; then
date -u $TIMESTAMP
/etc/init.d/hwclock.sh stop
fi
--
1.7.4.1
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core