Re: [OpenWrt-Devel] [PATCH V2] Fix for mvebu (WRT1900AC/WRT1200AC/etc) boot counter

2015-08-19 Thread Bjørn Mork
Rob Mosher writes: > +#define BOOTCOUNT_MAGIC 0x20110811 > + > +struct bootcounter { > + uint32_t magic; > + uint32_t count; > + uint32_t checksum; > +}; Maybe make it clear that these numbers are stored in little endian order? Or will that always be the native endianness? > +

Re: [OpenWrt-Devel] [PATCH V2] Fix for mvebu (WRT1900AC/WRT1200AC/etc) boot counter

2015-08-18 Thread Rob Mosher
Good point. It looks like Linksys actually just did the same thing as well in their firmware. Anyway, this patch is just to fix the boot counter, I'll submit another to leave auto recovery on. On 8/18/2015 9:00 PM, Claudio Leite wrote: * Rob Mosher (nyt-open...@countercultured.net) wrote: A

Re: [OpenWrt-Devel] [PATCH V2] Fix for mvebu (WRT1900AC/WRT1200AC/etc) boot counter

2015-08-18 Thread Claudio Leite
* Rob Mosher (nyt-open...@countercultured.net) wrote: > Auto recovery is enabled when flashing, so if it goes wrong, you can get > back to your previous image. Otherwise, I don't think there's a need for it > as all it does is switch which kernel/root partitions are booted which > shouldn't ever c

Re: [OpenWrt-Devel] [PATCH V2] Fix for mvebu (WRT1900AC/WRT1200AC/etc) boot counter

2015-08-18 Thread Rob Mosher
Auto recovery is enabled when flashing, so if it goes wrong, you can get back to your previous image. Otherwise, I don't think there's a need for it as all it does is switch which kernel/root partitions are booted which shouldn't ever change unless flashing (famous last words?). root@ZOMGWTF

Re: [OpenWrt-Devel] [PATCH V2] Fix for mvebu (WRT1900AC/WRT1200AC/etc) boot counter

2015-08-18 Thread Claudio Leite
* Rob Mosher (nyt-open...@countercultured.net) wrote: > +++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env > @@ -9,6 +9,7 @@ boot() { > case $(mvebu_board_name) in > > armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba) > fw_setenv auto_recovery

[OpenWrt-Devel] [PATCH V2] Fix for mvebu (WRT1900AC/WRT1200AC/etc) boot counter

2015-08-18 Thread Rob Mosher
The uboot boot counter was never reset after a successful boot. This patch prevents bootcmd and boot_part from becoming out of sync after a sysupgrade and ensures the proper partition is booted. Signed-off-by: Jonas Gorski Signed-off-by: Rob Mosher --- package/system/mtd/Makefile