openwrt/target/linux
Jeff Kletsky b3770eaca3 mtd: base-files: Unify dual-firmware devices (Linksys)
Consistently handle boot-count reset and upgrade across
ipq40xx, ipq806x, kirkwood, mvebu

Dual-firmware devices often utilize a specific MTD partition
to record the number of times the boot loader has initiated boot.

Most of these devices are NAND, typically with a 2k erase size.
When this code was ported to the ipq40xx platform, the device in hand
used NOR for this partition, with a 16-byte "record" size. As the
implementation of `mtd resetbc` is by-platform, the hard-coded nature
of this change prevented proper operation of a NAND-based device.

* Unified the "NOR" variant with the rest of the Linksys variants

* Added logging to indicate success and failure

* Provided a meaningful return value for scripting

* "Protected" the use of `mtd resetbc` in start-up scripts so that
   failure does not end the boot sequence

* Moved Linksys-specific actions into common `/etc/init.d/bootcount`

For upgrade, these devices need to determine which partition to flash,
as well as set certain U-Boot envirnment variables to change the next
boot to the newly flashed version.

* Moved upgrade-related environment changes out of bootcount

* Combined multiple flashes of environment into single one

* Current-partition detection now handles absence of `boot_part`

Runtime-tested: Linksys EA8300

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[checkpatch.pl fixes, traded split strings for 80+ chars per line]
2019-05-18 13:43:51 +02:00
..
apm821xx kernel: bump 4.19 to 4.19.42 2019-05-13 19:17:41 +02:00
ar7 kernel: bump 4.9 to 4.9.153 2019-01-28 18:17:32 +01:00
ar71xx ar71xx: Fix network setup for TP-Link Archer C25 v1 2019-05-15 13:34:24 +02:00
arc770 treewide: use wpad-basic for not small flash targets 2018-10-16 15:07:41 +01:00
archs38 treewide: use wpad-basic for not small flash targets 2018-10-16 15:07:41 +01:00
armvirt kernel: Remove CONFIG_COMPAT 2019-05-11 17:15:41 +02:00
at91 kernel: Activate CONFIG_SYN_COOKIES for all targets 2019-05-11 17:15:41 +02:00
ath25 kernel: bump 4.14 to 4.14.79 2018-11-05 16:00:00 +01:00
ath79 ath79: drop unused/incomplete dts 2019-05-17 21:41:42 +02:00
bcm53xx build: add a config option for enabling a testing version of the target kernel 2019-05-11 11:37:10 +02:00
brcm47xx build: add a config option for enabling a testing version of the target kernel 2019-05-11 11:37:10 +02:00
brcm63xx brcm63xx: fixup broken patch after kernel bump 2019-05-14 13:15:11 +02:00
brcm2708 kernel: bump 4.14 to 4.14.118 2019-05-13 19:17:41 +02:00
cns3xxx kernel: bump 4.19 to 4.19.42 2019-05-13 19:17:41 +02:00
gemini kernel: Move some DSA config options to generic config 2019-05-14 21:11:58 +02:00
generic kernel: Move some DSA config options to generic config 2019-05-14 21:11:58 +02:00
imx6 kernel: Move some DSA config options to generic config 2019-05-14 21:11:58 +02:00
ipq40xx mtd: base-files: Unify dual-firmware devices (Linksys) 2019-05-18 13:43:51 +02:00
ipq806x mtd: base-files: Unify dual-firmware devices (Linksys) 2019-05-18 13:43:51 +02:00
ixp4xx kernel: bump 4.9 to 4.9.160 2019-02-25 17:33:16 +01:00
kirkwood mtd: base-files: Unify dual-firmware devices (Linksys) 2019-05-18 13:43:51 +02:00
lantiq lantiq/xrx200: enable initramfs images 2019-05-15 13:34:23 +02:00
layerscape kernel: bump 4.14 to 4.14.118 2019-05-13 19:17:41 +02:00
malta malta: Deactivate MIPS O32 and N32 support 2019-05-14 21:50:42 +02:00
mediatek kernel: Remove CONFIG_COMPAT 2019-05-11 17:15:41 +02:00
mpc85xx build: add a config option for enabling a testing version of the target kernel 2019-05-11 11:37:10 +02:00
mvebu mtd: base-files: Unify dual-firmware devices (Linksys) 2019-05-18 13:43:51 +02:00
mxs mxs: disable unused serial drivers 2019-03-11 19:35:43 +01:00
octeon octeon: Deactivate MIPS O32 and N32 support 2019-05-14 21:50:42 +02:00
octeontx kernel: Remove CONFIG_COMPAT 2019-05-11 17:15:41 +02:00
omap kernel: Deactivate CONFIG_BINFMT_MISC 2019-05-11 17:15:41 +02:00
orion treewide: use wpad-basic for not small flash targets 2018-10-16 15:07:41 +01:00
oxnas kernel: bump 4.14 to 4.14.108 2019-03-27 10:48:59 +01:00
pistachio kernel: bump 4.14 to 4.14.91 2019-01-07 17:09:06 +01:00
ramips ramips: Add support for ZBT WE826-E 2019-05-17 21:41:43 +02:00
rb532 kernel: bump 4.14 to 4.14.86 2018-12-10 11:48:44 +01:00
samsung kernel: Do not set CONFIG_DEVMEM or CONFIG_DEVKMEM 2019-05-11 17:15:41 +02:00
sunxi kernel: Deactivate CONFIG_BINFMT_MISC 2019-05-11 17:15:41 +02:00
tegra tegra: add vendor string to device name 2019-05-15 13:34:23 +02:00
uml kernel: Deactivate CONFIG_BINFMT_MISC 2019-05-11 17:15:41 +02:00
x86 x86: Activate CONFIG_X86_SMAP 2019-05-11 17:15:41 +02:00
zynq zynq: make title consistent for all devices 2019-05-17 21:41:43 +02:00
Makefile