Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] initscripts: Properly handle new timestamp format
@ 2012-03-01 14:43 Gary Thomas
  2012-03-01 14:59 ` Richard Purdie
  0 siblings, 1 reply; 10+ messages in thread
From: Gary Thomas @ 2012-03-01 14:43 UTC (permalink / raw)
  To: openembedded-core

Recent changes have attempted to make consistant use of /etc/timestamp
In particular
  5aab665 initscripts: Make /etc/timestamp consistent again.
  173a48f image.bbclass: Ensure timestamp matches format used in initscripts after recent changes

This new format can cause problems as the value is too large for
most [32 bit] machines.  Work around this by only comparing the
YYYYMMDD portion (which does fit in 32 bits).  Also, the new format
is not directly compatible with the 'date' command line, so it
must be reformatted for use.

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
---
 .../initscripts/initscripts-1.0/bootmisc.sh        |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
index 20ec0a0..383de82 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -70,8 +70,8 @@ if test -e /etc/timestamp
 then
 	SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M`
 	read TIMESTAMP < /etc/timestamp
-	if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
-		date -u $TIMESTAMP
+	if [ ${TIMESTAMP%????} -gt ${SYSTEMDATE%????} ]; then
+		date -u ${TIMESTAMP#????}${TIMESTAMP%????????}
 		/etc/init.d/hwclock.sh stop
 	fi
 fi
-- 
1.7.7.6




^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-02  6:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 14:43 [PATCH] initscripts: Properly handle new timestamp format Gary Thomas
2012-03-01 14:59 ` Richard Purdie
2012-03-01 15:11   ` Gary Thomas
2012-03-01 15:27     ` Gary Thomas
2012-03-01 15:44       ` Richard Purdie
2012-03-01 15:52         ` Gary Thomas
2012-03-01 16:04           ` Otavio Salvador
2012-03-01 16:06             ` Gary Thomas
2012-03-02  6:15               ` Lauri Hintsala
2012-03-01 16:01       ` Otavio Salvador

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox