<p dir="ltr">Hi,</p>
<p dir="ltr">I have a client that just asked for this. As their router uses grub, its script if enough for the fallback logic. I implemented a POC and it worked perfectly. There is no watchdog integration so the reboot is manually done when the new firmware fails.</p>
<p dir="ltr">I'm just waiting for them to give me a go in order to implement a complete solution. I'll post to the list when I get a working patch.</p>
<p dir="ltr">The basic idea is to have two rootfs (and two rootfs data) in flash. I embed the kernel into squashfs, making rootfs self contained (as grub2 can read squashfs). If I give to sysupgrade a squashfs image, it writes alternately into the rootfs areas. It tries to boot the new flash once (like grub-once). If it works, mark it as permanent. If not, just reboot and the previous flash will be used.</p>
<p dir="ltr">Now, when I give a full xxx.img file, it overwrite all the system just like the normal openwrt image does (something like proprietary xxx_boot.img). Of course, this type of boot firmware does not have the fallback.</p>
<p dir="ltr">Regards,</p>
<br><div class="gmail_quote"><div dir="ltr">Em qui, 7 de jan de 2016 18:16, Arthur Davis <<a href="mailto:silpertan@gmail.com">silpertan@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">With failsafe upgrades, there always has to be "the thing that notices" when something goes wrong. With a wholesale upgrade, OpenWrt can't be that thing. The bootloader is probably the best candidate.<div><br></div><div>Also, I've worked on projects that used a separate supervisory processor that was able to dictate the boot image. In one case, it was a very powerful processor that had its own jobs in the system. In another case, it was very small and just watched out for system health. One way to dictate the boot image is to have the OpenWrt system ask via tftp, but there are probably other possibilities depending on your system. (And this probably doesn't really apply unless you are able to specify some fundamental bits of the hardware.)</div><div><br></div><div>Lastly, there is OpenWrt's failsafe mode which doesn't solve all of your concerns, but it should be noted:</div><div> <a href="https://wiki.openwrt.org/doc/howto/generic.failsafe" target="_blank">https://wiki.openwrt.org/doc/howto/generic.failsafe</a></div></div><div dir="ltr"><div><div><br></div><div>Arthur</div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 7, 2016 at 11:48 AM, Eric Schultz <span dir="ltr"><<a href="mailto:eschultz@prplfoundation.org" target="_blank">eschultz@prplfoundation.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Joshua,<br><br></div>I've had some similar interest in this topic. As far as I know, there isn't anything like this on OpenWrt. There might be some overlap with the discussion of automatic updates from last week as well.<br><br></div><div>Eric<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 7, 2016 at 11:44 AM, Joshua Judson Rosen <span dir="ltr"><<a href="mailto:jrosen@harvestai.com" target="_blank">jrosen@harvestai.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm trying to decide on a Linux-based OS to use in a project,<br>
and one of the features that I want is failsafe upgrades--<br>
such that failing to run an upgrade procedure to completion<br>
should be non-catastrophic, and automatically recoverable; the<br>
system should always be able to (re)boot into a state<br>
where it can run normally, either in the upgraded state<br>
or in the pre-upgrade state.<br>
<br>
One option that I've deal with is to keep two parallel<br>
system installs, upgrade whichever one you're not currently using,<br>
try to boot _that one_ after the upgrade finishes,<br>
and fall back to the last-known-good install<br>
if either the upgrade fails in the middle or the boot into<br>
the preferred install fails. IIRC, there's something like this<br>
available with Yocto; and, if I understand it correctly,<br>
NixOS also does something similar in spirit to this<br>
(though perhaps with a different granularity).<br>
<br>
Are there any provisions for doing something like that<br>
with OpenWRT?<span><font color="#888888"><br>
<span><font color="#888888"><br>
--<br>
"Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))."<br>
_______________________________________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org" target="_blank">openwrt-devel@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a><br>
</font></span></font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br><div><div dir="ltr">Eric Schultz, Community Manager, prpl Foundation<br><a href="http://www.prplfoundation.org" target="_blank">http://www.prplfoundation.org</a><br><a href="mailto:eschultz@prplfoundation.org" target="_blank">eschultz@prplfoundation.org</a><br>cell: <a href="tel:920-539-0404" value="+19205390404" target="_blank">920-539-0404</a><br>skype: ericschultzwi<br>@EricPrpl</div></div>
</font></span></div>
<br>_______________________________________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org" target="_blank">openwrt-devel@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org" target="_blank">openwrt-devel@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a><br>
</blockquote></div><div dir="ltr">-- <br></div><p dir="ltr">Luiz Angelo Daros de Luca<br>
<a href="mailto:luizluca@gmail.com">luizluca@gmail.com</a></p>