[U-Boot] anyone implemented a failsafe upgrade involving two kernel/rootfs pairs?

Robert P. J. Day rpjday at crashcourse.ca
Thu Jan 31 15:27:04 CET 2013


On Thu, 31 Jan 2013, Wolfgang Denk wrote:

> Dear Robert,
>
> In message <alpine.DEB.2.02.1301310731270.7034 at oneiric> you wrote:
> >
> > that is, a single u-boot and config in flash, followed by a pair of
> > kernel/rootfs partitions, that is remotely upgradeable by, from
> > userspace, determining the "older" (backup) of the pairs, overwriting
> > that pair with a new pair, then flipping the switch in the u-boot
> > configuration to always boot the newer kernel and rootfs (with an
> > emergency revert to the backup pair under circumstances i haven't
> > imagined yet).
>
> The emergency revert usually relies on two things:
>
> - Watchdog support that will reset (reboot) the system reliably in
>   case the Linux kernel does not boot or does not manage to start the
>   user space control application that will trigger the watchdog.
>
> - The "boot counter" feature that will allow to run an alternativce
>   boot command (i. e. booting from the backup) in case the number of
>   boot attempts exceeds the set limit.
>
> >   it *looks* fairly straightforward, but while that's a nice write-up,
> > it does warn right up front that it hasn't been implemented so if
> > anyone has done something like this they care to share, that would be
> > delightful.
>
> Things like that have been done a number of times before; the fact
> that such features as watchdog support and boot counter were added to
> U-Boot are an indication for this.  However, in the cases known to me,
> the actual implementation was done as shell scripts (i. e. environment
> settings) which were not published.

  ok, i'm going to clear my schedule for the day and just read the
u-boot manual cover to cover finally -- it will probably resolve a lot
of my questions.  if it's all right, i might update some of the manual
wiki pages, like this one that corresponds to the patch i just
submitted:

http://www.denx.de/wiki/view/DULG/HowCanIAccessUBootEnvironmentVariablesInLinux

where that comment should read:

# Configuration file for fw_(printenv/setenv) utility.

if it's anything more than just a trivial fix, i'll ask first.

rday

p.s.  just edited that page, hope i did it correctly.  onward ...

-- 

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

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


More information about the U-Boot mailing list