mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* powerfail safe env save
@ 2018-11-20 20:08 Erwin Rol
  2018-11-21  8:18 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Erwin Rol @ 2018-11-20 20:08 UTC (permalink / raw)
  To: Barebox List

Hallo,

as long time u-boot user I have several projects where we have a dual
dataflash "sector" in wich we store our env variables. And dual so we
always have or the correct old version or the correct new version even
if there is a power fail during saveenv.

Is powerfail robust env writing also available in barebox. Or what
would be the barebox equifelant of a number of config variables?

Any hints and tips are welcome.

TIA,

Erwin


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

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

* Re: powerfail safe env save
  2018-11-20 20:08 powerfail safe env save Erwin Rol
@ 2018-11-21  8:18 ` Sascha Hauer
  2018-11-24 11:14   ` Erwin Rol
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2018-11-21  8:18 UTC (permalink / raw)
  To: Erwin Rol; +Cc: Barebox List

Hi Erwin,

On Tue, Nov 20, 2018 at 09:08:01PM +0100, Erwin Rol wrote:
> Hallo,
> 
> as long time u-boot user I have several projects where we have a dual
> dataflash "sector" in wich we store our env variables. And dual so we
> always have or the correct old version or the correct new version even
> if there is a power fail during saveenv.
> 
> Is powerfail robust env writing also available in barebox. Or what
> would be the barebox equifelant of a number of config variables?

We do not have redundant environment right now.

There have been attempts in the past, but they fell short in flexibility
and/or robustness. Nowadays we normally do not use environment in
products anymore, so this isn't much of an issue.

If you have flash I would consider using UBI for the environment. With
atomic LEB change a robust environment could be implemented fairly
easily.

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: powerfail safe env save
  2018-11-21  8:18 ` Sascha Hauer
@ 2018-11-24 11:14   ` Erwin Rol
  2018-11-26  9:48     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Erwin Rol @ 2018-11-24 11:14 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

Hallo Sascha,

On Wed, 2018-11-21 at 09:18 +0100, Sascha Hauer wrote:
> Hi Erwin,
> 
> On Tue, Nov 20, 2018 at 09:08:01PM +0100, Erwin Rol wrote:
> > Hallo,
> > 
> > as long time u-boot user I have several projects where we have a dual
> > dataflash "sector" in wich we store our env variables. And dual so we
> > always have or the correct old version or the correct new version even
> > if there is a power fail during saveenv.
> > 
> > Is powerfail robust env writing also available in barebox. Or what
> > would be the barebox equifelant of a number of config variables?
> 
> We do not have redundant environment right now.
> 
> There have been attempts in the past, but they fell short in flexibility
> and/or robustness. Nowadays we normally do not use environment in
> products anymore, so this isn't much of an issue.

So what do you use? Some sort of configuration (mac addresses, serial
numbers, etc.) will still be needed, or ?

> 
> If you have flash I would consider using UBI for the environment. With
> atomic LEB change a robust environment could be implemented fairly
> easily.

It is a phycore imx6 module with NAND, so that should be possible. But
I rather stay as close by "mainline" as possible, so I would rather use
what ever feature Barebox hhas to offer out of the box.

What I have in U-boot is that we have 2 kernels (and rootfs) and after
an update I write in the uboot env which kernel/rootfs is active. This
is something that happens in the field and so the writing to the uboot
env must be so robuste that the system will not be bricked.

What would be the equivalent of such a setup in Barebox ?

- Erwin



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

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

* Re: powerfail safe env save
  2018-11-24 11:14   ` Erwin Rol
@ 2018-11-26  9:48     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2018-11-26  9:48 UTC (permalink / raw)
  To: Erwin Rol; +Cc: Barebox List

On Sat, Nov 24, 2018 at 12:14:24PM +0100, Erwin Rol wrote:
> Hallo Sascha,
> 
> On Wed, 2018-11-21 at 09:18 +0100, Sascha Hauer wrote:
> > Hi Erwin,
> > 
> > On Tue, Nov 20, 2018 at 09:08:01PM +0100, Erwin Rol wrote:
> > > Hallo,
> > > 
> > > as long time u-boot user I have several projects where we have a dual
> > > dataflash "sector" in wich we store our env variables. And dual so we
> > > always have or the correct old version or the correct new version even
> > > if there is a power fail during saveenv.
> > > 
> > > Is powerfail robust env writing also available in barebox. Or what
> > > would be the barebox equifelant of a number of config variables?
> > 
> > We do not have redundant environment right now.
> > 
> > There have been attempts in the past, but they fell short in flexibility
> > and/or robustness. Nowadays we normally do not use environment in
> > products anymore, so this isn't much of an issue.
> 
> So what do you use? Some sort of configuration (mac addresses, serial
> numbers, etc.) will still be needed, or ?
> 
> > 
> > If you have flash I would consider using UBI for the environment. With
> > atomic LEB change a robust environment could be implemented fairly
> > easily.
> 
> It is a phycore imx6 module with NAND, so that should be possible. But
> I rather stay as close by "mainline" as possible, so I would rather use
> what ever feature Barebox hhas to offer out of the box.
> 
> What I have in U-boot is that we have 2 kernels (and rootfs) and after
> an update I write in the uboot env which kernel/rootfs is active. This
> is something that happens in the field and so the writing to the uboot
> env must be so robuste that the system will not be bricked.
> 
> What would be the equivalent of such a setup in Barebox ?

We use the state frameowork and bootchooser for this task, see:

https://barebox.org/doc/latest/user/state.html
https://www.barebox.org/doc/latest/devicetree/bindings/barebox/barebox,state.html
https://barebox.org/doc/latest/user/bootchooser.html?highlight=bootchooser

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:[~2018-11-26  9:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20 20:08 powerfail safe env save Erwin Rol
2018-11-21  8:18 ` Sascha Hauer
2018-11-24 11:14   ` Erwin Rol
2018-11-26  9:48     ` Sascha Hauer

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