I need some ideas on the final park of my fallback mechanism which I've mentioned here. My issue is really how to make the partitioning work
properly.

The goal is to, without modifying the board u-boot, and assuming
enough space for a backup system in flash, allow the system to
still boot to a recovery kernel, at which point some process
would (in my case anyway), be able to fetch the full image from
the network, and then restore the full system, via sysupgrade.
The goal is to be able to recovery reliably from a flash failure,
whether from user pulling power, or due to some of the transient
flash errors I continue to see.

I'm using WZR-HP-300HH/HN2, so there's 32MB of flash.  My image
is particularly large at ~10MB due to lots of stuff we pack
in for our application.  I have a "base" image which is
just enough for doing the above recovery at 2.3MB.

Due to some hardware reset issues (see previously threads), I can't
kexec directly into another kernel, but I kexec into an ar71xx
u-boot I made, then that u-boot can't load a kernel from flash.
That u-boot, I can put into the recovery image.

The factory u-boot will always load from flash offset 0x0060000,
so this should be the first kernel that is run, i.e, the
recovery image. This is also where the factory u-boot will
flash to for tftp.   So that will run, then kexec into
new u-boot/kernel.

Right now, I have modified the partition table to be:

#define KERNEL_FACTORY_SIZE 0x0100000 /* 4MB */
...
  }, {
    .name   = "kernel-backup",
    .offset   = 0x0060000,
    .size   = KERNEL_FACTORY_SIZE,
  }, {
    .name   = "kernel",
    .offset   = 0x0060000 + KERNEL_FACTORY_SIZE,
    .size   = 0x0100000,
  }, {
    .name   = "rootfs",
    .offset   = 0x0160000 + KERNEL_FACTORY_SIZE,
    .size   = 0x1e60000 - KERNEL_FACTORY_SIZE,

But as things stand, the kernel at kernel-backup will try to mount
rootfs, which isn't want I want.   Should I split up kernel-backup
into rootfs-backup, and modify the rootfs to be mounted (in
the kernel?).

I will note that I disabled the preinit part that tries
to mount jffs2 and do the overlay, since there's no point in
that for recovery, and I don't need to write to the filesystem.

Finally, for all this to hang together, we need to note that
the "real" system failed to boot, and then run a recovery
upon reboot to recovery.  Where would be the best place to
make a record of that fact?







_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to