All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] initscripts: Make /etc/timestamp consistent again.
@ 2012-02-10 16:16 Gary Thomas
  2012-02-24  7:06 ` Lauri Hintsala
  2012-02-24 18:31 ` Saul Wold
  0 siblings, 2 replies; 6+ messages in thread
From: Gary Thomas @ 2012-02-10 16:16 UTC (permalink / raw)
  To: openembedded-core

Commit cc8695 changed the way timestamps were handled
and added some extra munging to be able to compare them
reliably.  This change makes the timestamp value the same
everywhere and simplifies how the check to set the system
clock based on the timestamp is done.

Also, if the value stored in /etc/timestamp is newer
[at all] than the current system time, set the system clock
from the stored value, down to the minute, not just the day.

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
---
 .../initscripts/initscripts-1.0/bootmisc.sh        |    4 ++--
 .../initscripts/initscripts-1.0/save-rtc.sh        |    2 +-
 meta/recipes-core/initscripts/initscripts_1.0.bb   |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
index d9e8ffa..20ec0a0 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -68,9 +68,9 @@ fi
 /etc/init.d/hwclock.sh start
 if test -e /etc/timestamp
 then
-	SYSTEMDATE=`date -u +%4Y%2m%2d`
+	SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M`
 	read TIMESTAMP < /etc/timestamp
-	if [ ${TIMESTAMP#????????}${TIMESTAMP%????????} -gt $SYSTEMDATE ]; then
+	if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
 		date -u $TIMESTAMP
 		/etc/init.d/hwclock.sh stop
 	fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
index 3d8e850..1f804e2 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
@@ -10,4 +10,4 @@
 ### END INIT INFO
 
 # Update the timestamp
-date -u +%2m%2d%2H%2M%4Y > /etc/timestamp
+date -u +%4Y%2m%2d%2H%2M > /etc/timestamp
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index 203c605..b56c55c 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system startup initialization scrip
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-PR = "r129"
+PR = "r130"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
-- 
1.7.7.6




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

* Re: [PATCH] initscripts: Make /etc/timestamp consistent again.
  2012-02-10 16:16 [PATCH] initscripts: Make /etc/timestamp consistent again Gary Thomas
@ 2012-02-24  7:06 ` Lauri Hintsala
  2012-02-24 10:26   ` Richard Purdie
  2012-02-24 18:31 ` Saul Wold
  1 sibling, 1 reply; 6+ messages in thread
From: Lauri Hintsala @ 2012-02-24  7:06 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Patches and discussions about the oe-core layer

On 02/10/2012 06:16 PM, Gary Thomas wrote:
> Commit cc8695 changed the way timestamps were handled
> and added some extra munging to be able to compare them
> reliably.  This change makes the timestamp value the same
> everywhere and simplifies how the check to set the system
> clock based on the timestamp is done.
>
> Also, if the value stored in /etc/timestamp is newer
> [at all] than the current system time, set the system clock
> from the stored value, down to the minute, not just the day.
>
> Signed-off-by: Gary Thomas<gary@mlbassoc.com>
> ---
>   .../initscripts/initscripts-1.0/bootmisc.sh        |    4 ++--
>   .../initscripts/initscripts-1.0/save-rtc.sh        |    2 +-
>   meta/recipes-core/initscripts/initscripts_1.0.bb   |    2 +-
>   3 files changed, 4 insertions(+), 4 deletions(-)


Hi Gary,

You should do the same changes to meta/classes/image.bbclass where the 
/etc/timestamp file is generated to filesystem image.

Regards,
Lauri Hintsala



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

* Re: [PATCH] initscripts: Make /etc/timestamp consistent again.
  2012-02-24  7:06 ` Lauri Hintsala
@ 2012-02-24 10:26   ` Richard Purdie
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2012-02-24 10:26 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, 2012-02-24 at 09:06 +0200, Lauri Hintsala wrote:
> On 02/10/2012 06:16 PM, Gary Thomas wrote:
> > Commit cc8695 changed the way timestamps were handled
> > and added some extra munging to be able to compare them
> > reliably.  This change makes the timestamp value the same
> > everywhere and simplifies how the check to set the system
> > clock based on the timestamp is done.
> >
> > Also, if the value stored in /etc/timestamp is newer
> > [at all] than the current system time, set the system clock
> > from the stored value, down to the minute, not just the day.
> >
> > Signed-off-by: Gary Thomas<gary@mlbassoc.com>
> > ---
> >   .../initscripts/initscripts-1.0/bootmisc.sh        |    4 ++--
> >   .../initscripts/initscripts-1.0/save-rtc.sh        |    2 +-
> >   meta/recipes-core/initscripts/initscripts_1.0.bb   |    2 +-
> >   3 files changed, 4 insertions(+), 4 deletions(-)
> 
> 
> Hi Gary,
> 
> You should do the same changes to meta/classes/image.bbclass where the 
> /etc/timestamp file is generated to filesystem image.

Agreed, this is a nasty inconsistency. I've pushed a patch into master
which fixes this.

Cheers,

Richard




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

* Re: [PATCH] initscripts: Make /etc/timestamp consistent again.
  2012-02-10 16:16 [PATCH] initscripts: Make /etc/timestamp consistent again Gary Thomas
  2012-02-24  7:06 ` Lauri Hintsala
@ 2012-02-24 18:31 ` Saul Wold
  2012-02-29  5:31   ` James Limbouris
  2012-02-29  6:34   ` James Limbouris
  1 sibling, 2 replies; 6+ messages in thread
From: Saul Wold @ 2012-02-24 18:31 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 02/10/2012 08:16 AM, Gary Thomas wrote:
> Commit cc8695 changed the way timestamps were handled
> and added some extra munging to be able to compare them
> reliably.  This change makes the timestamp value the same
> everywhere and simplifies how the check to set the system
> clock based on the timestamp is done.
>
> Also, if the value stored in /etc/timestamp is newer
> [at all] than the current system time, set the system clock
> from the stored value, down to the minute, not just the day.
>
> Signed-off-by: Gary Thomas<gary@mlbassoc.com>
> ---
>   .../initscripts/initscripts-1.0/bootmisc.sh        |    4 ++--
>   .../initscripts/initscripts-1.0/save-rtc.sh        |    2 +-
>   meta/recipes-core/initscripts/initscripts_1.0.bb   |    2 +-
>   3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> index d9e8ffa..20ec0a0 100755
> --- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> @@ -68,9 +68,9 @@ fi
>   /etc/init.d/hwclock.sh start
>   if test -e /etc/timestamp
>   then
> -	SYSTEMDATE=`date -u +%4Y%2m%2d`
> +	SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M`
>   	read TIMESTAMP<  /etc/timestamp
> -	if [ ${TIMESTAMP#????????}${TIMESTAMP%????????} -gt $SYSTEMDATE ]; then
> +	if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
>   		date -u $TIMESTAMP
>   		/etc/init.d/hwclock.sh stop
>   	fi
> diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> index 3d8e850..1f804e2 100644
> --- a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> @@ -10,4 +10,4 @@
>   ### END INIT INFO
>
>   # Update the timestamp
> -date -u +%2m%2d%2H%2M%4Y>  /etc/timestamp
> +date -u +%4Y%2m%2d%2H%2M>  /etc/timestamp
> diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
> index 203c605..b56c55c 100644
> --- a/meta/recipes-core/initscripts/initscripts_1.0.bb
> +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
> @@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system startup initialization scrip
>   SECTION = "base"
>   LICENSE = "GPLv2"
>   LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
> -PR = "r129"
> +PR = "r130"
>
>   INHIBIT_DEFAULT_DEPS = "1"
>

Merged into OE-core

Thanks
	Sau!



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

* Re: [PATCH] initscripts: Make /etc/timestamp consistent again.
  2012-02-24 18:31 ` Saul Wold
@ 2012-02-29  5:31   ` James Limbouris
  2012-02-29  6:34   ` James Limbouris
  1 sibling, 0 replies; 6+ messages in thread
From: James Limbouris @ 2012-02-29  5:31 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Hi,

I think we need to add BUSYBOX_CONFIG_FEATURE_TEST_64 to the busybox defconfig after this patch.
On my build (which had neither BUSYBOX_CONFIG_FEATURE_TEST_64 nor BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64) I was getting 'out of range' errors.
  
Regards 
James Limbouris

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf
> Of Saul Wold
> Sent: Saturday, 25 February 2012 2:31 AM
> To: Patches and discussions about the oe-core layer
> Subject: Re: [OE-core] [PATCH] initscripts: Make /etc/timestamp consistent
> again.
> 
> On 02/10/2012 08:16 AM, Gary Thomas wrote:
> > Commit cc8695 changed the way timestamps were handled
> > and added some extra munging to be able to compare them
> > reliably.  This change makes the timestamp value the same
> > everywhere and simplifies how the check to set the system
> > clock based on the timestamp is done.
> >
> > Also, if the value stored in /etc/timestamp is newer
> > [at all] than the current system time, set the system clock
> > from the stored value, down to the minute, not just the day.
> >
> > Signed-off-by: Gary Thomas<gary@mlbassoc.com>
> > ---
> >   .../initscripts/initscripts-1.0/bootmisc.sh        |    4 ++--
> >   .../initscripts/initscripts-1.0/save-rtc.sh        |    2 +-
> >   meta/recipes-core/initscripts/initscripts_1.0.bb   |    2 +-
> >   3 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> > index d9e8ffa..20ec0a0 100755
> > --- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> > +++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> > @@ -68,9 +68,9 @@ fi
> >   /etc/init.d/hwclock.sh start
> >   if test -e /etc/timestamp
> >   then
> > -	SYSTEMDATE=`date -u +%4Y%2m%2d`
> > +	SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M`
> >   	read TIMESTAMP<  /etc/timestamp
> > -	if [ ${TIMESTAMP#????????}${TIMESTAMP%????????} -gt
> $SYSTEMDATE ]; then
> > +	if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
> >   		date -u $TIMESTAMP
> >   		/etc/init.d/hwclock.sh stop
> >   	fi
> > diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> > index 3d8e850..1f804e2 100644
> > --- a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> > +++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> > @@ -10,4 +10,4 @@
> >   ### END INIT INFO
> >
> >   # Update the timestamp
> > -date -u +%2m%2d%2H%2M%4Y>  /etc/timestamp
> > +date -u +%4Y%2m%2d%2H%2M>  /etc/timestamp
> > diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-
> core/initscripts/initscripts_1.0.bb
> > index 203c605..b56c55c 100644
> > --- a/meta/recipes-core/initscripts/initscripts_1.0.bb
> > +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
> > @@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system
> startup initialization scrip
> >   SECTION = "base"
> >   LICENSE = "GPLv2"
> >   LIC_FILES_CHKSUM =
> "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
> > -PR = "r129"
> > +PR = "r130"
> >
> >   INHIBIT_DEFAULT_DEPS = "1"
> >
> 
> Merged into OE-core
> 
> Thanks
> 	Sau!
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



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

* Re: [PATCH] initscripts: Make /etc/timestamp consistent again.
  2012-02-24 18:31 ` Saul Wold
  2012-02-29  5:31   ` James Limbouris
@ 2012-02-29  6:34   ` James Limbouris
  1 sibling, 0 replies; 6+ messages in thread
From: James Limbouris @ 2012-02-29  6:34 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Also, CONFIG_FEATURE_DATE_COMPAT=y has to be removed - it mungs the YYYYMMddhhmm string into hhmmYYYYMMdd !

> -----Original Message-----
> From: James Limbouris
> Sent: Wednesday, 29 February 2012 1:32 PM
> To: Patches and discussions about the oe-core layer
> Subject: RE: [OE-core] [PATCH] initscripts: Make /etc/timestamp consistent
> again.
> 
> Hi,
> 
> I think we need to add BUSYBOX_CONFIG_FEATURE_TEST_64 to the
> busybox defconfig after this patch.
> On my build (which had neither BUSYBOX_CONFIG_FEATURE_TEST_64 nor
> BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64) I was getting 'out of range'
> errors.
> 
> Regards
> James Limbouris
> 
> > -----Original Message-----
> > From: openembedded-core-bounces@lists.openembedded.org
> > [mailto:openembedded-core-bounces@lists.openembedded.org] On
> Behalf
> > Of Saul Wold
> > Sent: Saturday, 25 February 2012 2:31 AM
> > To: Patches and discussions about the oe-core layer
> > Subject: Re: [OE-core] [PATCH] initscripts: Make /etc/timestamp consistent
> > again.
> >
> > On 02/10/2012 08:16 AM, Gary Thomas wrote:
> > > Commit cc8695 changed the way timestamps were handled
> > > and added some extra munging to be able to compare them
> > > reliably.  This change makes the timestamp value the same
> > > everywhere and simplifies how the check to set the system
> > > clock based on the timestamp is done.
> > >
> > > Also, if the value stored in /etc/timestamp is newer
> > > [at all] than the current system time, set the system clock
> > > from the stored value, down to the minute, not just the day.
> > >
> > > Signed-off-by: Gary Thomas<gary@mlbassoc.com>
> > > ---
> > >   .../initscripts/initscripts-1.0/bootmisc.sh        |    4 ++--
> > >   .../initscripts/initscripts-1.0/save-rtc.sh        |    2 +-
> > >   meta/recipes-core/initscripts/initscripts_1.0.bb   |    2 +-
> > >   3 files changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> > b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> > > index d9e8ffa..20ec0a0 100755
> > > --- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> > > +++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
> > > @@ -68,9 +68,9 @@ fi
> > >   /etc/init.d/hwclock.sh start
> > >   if test -e /etc/timestamp
> > >   then
> > > -	SYSTEMDATE=`date -u +%4Y%2m%2d`
> > > +	SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M`
> > >   	read TIMESTAMP<  /etc/timestamp
> > > -	if [ ${TIMESTAMP#????????}${TIMESTAMP%????????} -gt
> > $SYSTEMDATE ]; then
> > > +	if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
> > >   		date -u $TIMESTAMP
> > >   		/etc/init.d/hwclock.sh stop
> > >   	fi
> > > diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> > b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> > > index 3d8e850..1f804e2 100644
> > > --- a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> > > +++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
> > > @@ -10,4 +10,4 @@
> > >   ### END INIT INFO
> > >
> > >   # Update the timestamp
> > > -date -u +%2m%2d%2H%2M%4Y>  /etc/timestamp
> > > +date -u +%4Y%2m%2d%2H%2M>  /etc/timestamp
> > > diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb
> b/meta/recipes-
> > core/initscripts/initscripts_1.0.bb
> > > index 203c605..b56c55c 100644
> > > --- a/meta/recipes-core/initscripts/initscripts_1.0.bb
> > > +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
> > > @@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system
> > startup initialization scrip
> > >   SECTION = "base"
> > >   LICENSE = "GPLv2"
> > >   LIC_FILES_CHKSUM =
> > "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
> > > -PR = "r129"
> > > +PR = "r130"
> > >
> > >   INHIBIT_DEFAULT_DEPS = "1"
> > >
> >
> > Merged into OE-core
> >
> > Thanks
> > 	Sau!
> >
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-10 16:16 [PATCH] initscripts: Make /etc/timestamp consistent again Gary Thomas
2012-02-24  7:06 ` Lauri Hintsala
2012-02-24 10:26   ` Richard Purdie
2012-02-24 18:31 ` Saul Wold
2012-02-29  5:31   ` James Limbouris
2012-02-29  6:34   ` James Limbouris

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.