mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] barebox update: add note after successful update
@ 2015-05-21  7:41 Stefan Christ
  2015-05-22  6:50 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Christ @ 2015-05-21  7:41 UTC (permalink / raw)
  To: barebox

Some users of the barebox_update command forget to erase the external
barebox environment after updating the barebox. Using an old barebox
environment leads to various problems if there were major changes.

So add a gentle reminder after the successful update.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
---
 common/bbu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/bbu.c b/common/bbu.c
index 7fb154a..1b125e9 100644
--- a/common/bbu.c
+++ b/common/bbu.c
@@ -113,8 +113,11 @@ int barebox_update(struct bbu_data *data)
 	if (ret == -EINTR)
 		printf("update aborted\n");
 
-	if (!ret)
+	if (!ret) {
 		printf("update succeeded\n");
+		if (IS_ENABLED(CONFIG_ENV_HANDLING))
+			printf("You maybe want to erase the barebox environment.\n");
+	}
 
 	return ret;
 }
-- 
1.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] barebox update: add note after successful update
  2015-05-21  7:41 [PATCH] barebox update: add note after successful update Stefan Christ
@ 2015-05-22  6:50 ` Sascha Hauer
  2015-05-22 11:55   ` Stefan Christ
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2015-05-22  6:50 UTC (permalink / raw)
  To: Stefan Christ; +Cc: barebox

On Thu, May 21, 2015 at 09:41:49AM +0200, Stefan Christ wrote:
> Some users of the barebox_update command forget to erase the external
> barebox environment after updating the barebox. Using an old barebox
> environment leads to various problems if there were major changes.
> 
> So add a gentle reminder after the successful update.
> 
> Signed-off-by: Stefan Christ <s.christ@phytec.de>
> ---
>  common/bbu.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/common/bbu.c b/common/bbu.c
> index 7fb154a..1b125e9 100644
> --- a/common/bbu.c
> +++ b/common/bbu.c
> @@ -113,8 +113,11 @@ int barebox_update(struct bbu_data *data)
>  	if (ret == -EINTR)
>  		printf("update aborted\n");
>  
> -	if (!ret)
> +	if (!ret) {
>  		printf("update succeeded\n");
> +		if (IS_ENABLED(CONFIG_ENV_HANDLING))
> +			printf("You maybe want to erase the barebox environment.\n");

How about adding a hint ...using saveenv -z?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] barebox update: add note after successful update
  2015-05-22  6:50 ` Sascha Hauer
@ 2015-05-22 11:55   ` Stefan Christ
  2015-05-29  7:22     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Christ @ 2015-05-22 11:55 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Fri, May 22, 2015 at 08:50:37AM +0200, Sascha Hauer wrote:
> On Thu, May 21, 2015 at 09:41:49AM +0200, Stefan Christ wrote:
> > Some users of the barebox_update command forget to erase the external
> > barebox environment after updating the barebox. Using an old barebox
> > environment leads to various problems if there were major changes.
> > 
> > So add a gentle reminder after the successful update.
> > 
> > Signed-off-by: Stefan Christ <s.christ@phytec.de>
> > ---
> >  common/bbu.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/common/bbu.c b/common/bbu.c
> > index 7fb154a..1b125e9 100644
> > --- a/common/bbu.c
> > +++ b/common/bbu.c
> > @@ -113,8 +113,11 @@ int barebox_update(struct bbu_data *data)
> >  	if (ret == -EINTR)
> >  		printf("update aborted\n");
> >  
> > -	if (!ret)
> > +	if (!ret) {
> >  		printf("update succeeded\n");
> > +		if (IS_ENABLED(CONFIG_ENV_HANDLING))
> > +			printf("You maybe want to erase the barebox environment.\n");
> 
> How about adding a hint ...using saveenv -z?

Oh, I didn't know that the "-z" argument exits. Nice.

Ok, but what about the situation when a user boots the barebox from sdcard and
uses the barebox_update handler to flash a barebox to NAND. In such case
'saveenv -z' overwrites the environment on the sdcard.

I've struggled a bit to come up with a short text that covers all these cases.

Mit freundlichen Grüßen / Kind regards,
	Stefan Christ

> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] barebox update: add note after successful update
  2015-05-22 11:55   ` Stefan Christ
@ 2015-05-29  7:22     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2015-05-29  7:22 UTC (permalink / raw)
  To: Stefan Christ; +Cc: barebox

On Fri, May 22, 2015 at 01:55:16PM +0200, Stefan Christ wrote:
> On Fri, May 22, 2015 at 08:50:37AM +0200, Sascha Hauer wrote:
> > On Thu, May 21, 2015 at 09:41:49AM +0200, Stefan Christ wrote:
> > > Some users of the barebox_update command forget to erase the external
> > > barebox environment after updating the barebox. Using an old barebox
> > > environment leads to various problems if there were major changes.
> > > 
> > > So add a gentle reminder after the successful update.
> > > 
> > > Signed-off-by: Stefan Christ <s.christ@phytec.de>
> > > ---
> > >  common/bbu.c | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/common/bbu.c b/common/bbu.c
> > > index 7fb154a..1b125e9 100644
> > > --- a/common/bbu.c
> > > +++ b/common/bbu.c
> > > @@ -113,8 +113,11 @@ int barebox_update(struct bbu_data *data)
> > >  	if (ret == -EINTR)
> > >  		printf("update aborted\n");
> > >  
> > > -	if (!ret)
> > > +	if (!ret) {
> > >  		printf("update succeeded\n");
> > > +		if (IS_ENABLED(CONFIG_ENV_HANDLING))
> > > +			printf("You maybe want to erase the barebox environment.\n");
> > 
> > How about adding a hint ...using saveenv -z?
> 
> Oh, I didn't know that the "-z" argument exits. Nice.
> 
> Ok, but what about the situation when a user boots the barebox from sdcard and
> uses the barebox_update handler to flash a barebox to NAND. In such case
> 'saveenv -z' overwrites the environment on the sdcard.

I still have no good answer to this :/

I may also happen that the updated barebox comes with a different
partition layout so that you can't properly erase the environment from
the currently running barebox. At some point we thought about adding
some version counter to the environment so that the updated barebox
could either issue a warning when an outdated environment is detected
or ignore it completely. This would of course mean we must not forget to
increase the version when we do an incompatible change.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2015-05-29  7:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21  7:41 [PATCH] barebox update: add note after successful update Stefan Christ
2015-05-22  6:50 ` Sascha Hauer
2015-05-22 11:55   ` Stefan Christ
2015-05-29  7:22     ` Sascha Hauer

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