mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* how does barebox deal with more than one environment?
@ 2012-12-01 13:12 Robert P. J. Day
  2012-12-01 13:19 ` Robert P. J. Day
  0 siblings, 1 reply; 6+ messages in thread
From: Robert P. J. Day @ 2012-12-01 13:12 UTC (permalink / raw)
  To: U-Boot Version 2 (barebox)


  writing up a simple barebox exercise for students and on this page:

http://wiki.barebox.org/doku.php?id=user:first_steps

it seems clear(?) that you can define multiple environments that will
appear at /dev/env0, /dev/env1, etc, but that page also claims that
*only* the configuration on /dev/env0 will be executed automatically
if barebox finds that it's a valid configuration sector.

  so what happens with the additional environments?  that page doesn't
make it clear.  i'm just about to read the source to see if i can
figure this out.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

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

* Re: how does barebox deal with more than one environment?
  2012-12-01 13:12 how does barebox deal with more than one environment? Robert P. J. Day
@ 2012-12-01 13:19 ` Robert P. J. Day
  2012-12-01 13:46   ` Antony Pavlov
  2012-12-03  9:04   ` Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: Robert P. J. Day @ 2012-12-01 13:19 UTC (permalink / raw)
  To: U-Boot Version 2 (barebox)

On Sat, 1 Dec 2012, Robert P. J. Day wrote:

>
>   writing up a simple barebox exercise for students and on this page:
>
> http://wiki.barebox.org/doku.php?id=user:first_steps
>
> it seems clear(?) that you can define multiple environments that will
> appear at /dev/env0, /dev/env1, etc, but that page also claims that
> *only* the configuration on /dev/env0 will be executed automatically
> if barebox finds that it's a valid configuration sector.
>
>   so what happens with the additional environments?  that page doesn't
> make it clear.  i'm just about to read the source to see if i can
> figure this out.

  oh, wait, i think i see ... the "loadenv" command will load a given
environment into a directory so i'm *assuming* that additional
environments are simply available to be loaded, but /dev/env0 is the
only one treated special.  or feel free to correct me if i'm
hopelessly wrong.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

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

* Re: how does barebox deal with more than one environment?
  2012-12-01 13:19 ` Robert P. J. Day
@ 2012-12-01 13:46   ` Antony Pavlov
  2012-12-01 14:07     ` Robert P. J. Day
  2012-12-03  9:04   ` Sascha Hauer
  1 sibling, 1 reply; 6+ messages in thread
From: Antony Pavlov @ 2012-12-01 13:46 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: U-Boot Version 2 (barebox)

On 1 December 2012 17:19, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> On Sat, 1 Dec 2012, Robert P. J. Day wrote:
>
>>
>>   writing up a simple barebox exercise for students and on this page:
>>
>> http://wiki.barebox.org/doku.php?id=user:first_steps
>>
>> it seems clear(?) that you can define multiple environments that will
>> appear at /dev/env0, /dev/env1, etc, but that page also claims that
>> *only* the configuration on /dev/env0 will be executed automatically
>> if barebox finds that it's a valid configuration sector.
>>
>>   so what happens with the additional environments?  that page doesn't
>> make it clear.  i'm just about to read the source to see if i can
>> figure this out.
>
>   oh, wait, i think i see ... the "loadenv" command will load a given
> environment into a directory so i'm *assuming* that additional
> environments are simply available to be loaded, but /dev/env0 is the
> only one treated special.  or feel free to correct me if i'm
> hopelessly wrong.

See common/startup.c:110

#ifdef CONFIG_ENV_HANDLING
        if (envfs_load(default_environment_path, "/env")) {
#ifdef CONFIG_DEFAULT_ENVIRONMENT
                printf("no valid environment found on %s. "
                        "Using default environment\n",
                        default_environment_path);
                envfs_load("/dev/defaultenv", "/env");
#endif

By default  default_environment_path="/dev/env0", but it can be
overwritten in a board code (e.g. see arch/arm/boards/panda/board.c).

-- 
Best regards,
  Antony Pavlov

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

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

* Re: how does barebox deal with more than one environment?
  2012-12-01 13:46   ` Antony Pavlov
@ 2012-12-01 14:07     ` Robert P. J. Day
  0 siblings, 0 replies; 6+ messages in thread
From: Robert P. J. Day @ 2012-12-01 14:07 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: U-Boot Version 2 (barebox)

On Sat, 1 Dec 2012, Antony Pavlov wrote:

> On 1 December 2012 17:19, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> > On Sat, 1 Dec 2012, Robert P. J. Day wrote:
> >
> >>
> >>   writing up a simple barebox exercise for students and on this page:
> >>
> >> http://wiki.barebox.org/doku.php?id=user:first_steps
> >>
> >> it seems clear(?) that you can define multiple environments that will
> >> appear at /dev/env0, /dev/env1, etc, but that page also claims that
> >> *only* the configuration on /dev/env0 will be executed automatically
> >> if barebox finds that it's a valid configuration sector.
> >>
> >>   so what happens with the additional environments?  that page doesn't
> >> make it clear.  i'm just about to read the source to see if i can
> >> figure this out.
> >
> >   oh, wait, i think i see ... the "loadenv" command will load a given
> > environment into a directory so i'm *assuming* that additional
> > environments are simply available to be loaded, but /dev/env0 is the
> > only one treated special.  or feel free to correct me if i'm
> > hopelessly wrong.
>
> See common/startup.c:110
>
> #ifdef CONFIG_ENV_HANDLING
>         if (envfs_load(default_environment_path, "/env")) {
> #ifdef CONFIG_DEFAULT_ENVIRONMENT
>                 printf("no valid environment found on %s. "
>                         "Using default environment\n",
>                         default_environment_path);
>                 envfs_load("/dev/defaultenv", "/env");
> #endif
>
> By default  default_environment_path="/dev/env0", but it can be
> overwritten in a board code (e.g. see arch/arm/boards/panda/board.c).

  i realize that -- what i was asking about were the possible
*additional* environments (/dev/env1, /dev/env2, ...) that are
mentioned on that page.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

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

* Re: how does barebox deal with more than one environment?
  2012-12-01 13:19 ` Robert P. J. Day
  2012-12-01 13:46   ` Antony Pavlov
@ 2012-12-03  9:04   ` Sascha Hauer
  2012-12-03 12:48     ` Robert P. J. Day
  1 sibling, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2012-12-03  9:04 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: U-Boot Version 2 (barebox)

On Sat, Dec 01, 2012 at 08:19:26AM -0500, Robert P. J. Day wrote:
> On Sat, 1 Dec 2012, Robert P. J. Day wrote:
> 
> >
> >   writing up a simple barebox exercise for students and on this page:
> >
> > http://wiki.barebox.org/doku.php?id=user:first_steps
> >
> > it seems clear(?) that you can define multiple environments that will
> > appear at /dev/env0, /dev/env1, etc, but that page also claims that
> > *only* the configuration on /dev/env0 will be executed automatically
> > if barebox finds that it's a valid configuration sector.
> >
> >   so what happens with the additional environments?  that page doesn't
> > make it clear.  i'm just about to read the source to see if i can
> > figure this out.
> 
>   oh, wait, i think i see ... the "loadenv" command will load a given
> environment into a directory so i'm *assuming* that additional
> environments are simply available to be loaded, but /dev/env0 is the
> only one treated special.  or feel free to correct me if i'm
> hopelessly wrong.

/dev/env0 is the only environment used by barebox by default. As you
correctly found out loadenv/saveenv could be used to load arbitrary
envfs images to arbitrary directories. We could also think about
adding some kind of redundancy, but currently this would be board
specific, there is no generic heuristic to fall back to a second
env if the first one is corrupted.

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] 6+ messages in thread

* Re: how does barebox deal with more than one environment?
  2012-12-03  9:04   ` Sascha Hauer
@ 2012-12-03 12:48     ` Robert P. J. Day
  0 siblings, 0 replies; 6+ messages in thread
From: Robert P. J. Day @ 2012-12-03 12:48 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: U-Boot Version 2 (barebox)

On Mon, 3 Dec 2012, Sascha Hauer wrote:

> On Sat, Dec 01, 2012 at 08:19:26AM -0500, Robert P. J. Day wrote:
> > On Sat, 1 Dec 2012, Robert P. J. Day wrote:
> >
> > >
> > >   writing up a simple barebox exercise for students and on this page:
> > >
> > > http://wiki.barebox.org/doku.php?id=user:first_steps
> > >
> > > it seems clear(?) that you can define multiple environments that will
> > > appear at /dev/env0, /dev/env1, etc, but that page also claims that
> > > *only* the configuration on /dev/env0 will be executed automatically
> > > if barebox finds that it's a valid configuration sector.
> > >
> > >   so what happens with the additional environments?  that page doesn't
> > > make it clear.  i'm just about to read the source to see if i can
> > > figure this out.
> >
> >   oh, wait, i think i see ... the "loadenv" command will load a
> > given environment into a directory so i'm *assuming* that
> > additional environments are simply available to be loaded, but
> > /dev/env0 is the only one treated special.  or feel free to
> > correct me if i'm hopelessly wrong.
>
> /dev/env0 is the only environment used by barebox by default. As you
> correctly found out loadenv/saveenv could be used to load arbitrary
> envfs images to arbitrary directories. We could also think about
> adding some kind of redundancy, but currently this would be board
> specific, there is no generic heuristic to fall back to a second env
> if the first one is corrupted.

  oh, i wasn't suggesting getting that carried away, just wanted to
clarify that only the first environment is automatically consulted,
while additional environments are available only *manually* to the
developer.  that's fine, i just wanted to make sure i understood that.
thanks.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

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

end of thread, other threads:[~2012-12-03 12:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-01 13:12 how does barebox deal with more than one environment? Robert P. J. Day
2012-12-01 13:19 ` Robert P. J. Day
2012-12-01 13:46   ` Antony Pavlov
2012-12-01 14:07     ` Robert P. J. Day
2012-12-03  9:04   ` Sascha Hauer
2012-12-03 12:48     ` Robert P. J. Day

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