Commit Graph

7 Commits

Author SHA1 Message Date
Bjørn Mork 5fb51d4516 ipq806x: sysupgrade: drop unnecessary UBI to UBI logic
The purpose of this code seems to be to avoid issues caused
by partially overwriting an existing UBI partition, where some
of the erase counters would be reset but not the unmodified
ones.  This problem has been solved in a more generic way by
the UBI EOF marker. This ensures that any old PEBs after the
marker are properly initialized.  It is therefore unnecessary
to erase the whole partition before flashing a new OpenWrt
factory image.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-12-03 12:23:02 +01:00
Samantha Collard 0f910a8c4c ipq806x: EA8500 fix boot partition detection
Remove extraneous code that disabled boot partition detection.

Fixes: b3770eaca3 ("mtd: base-files: Unify dual-firmware devices (Linksys)")
Signed-off-by: Samantha Collard <sammyrc34@gmail.com>
2020-05-31 15:44:05 +02:00
Adrian Schmutzler d94a3f328f ipq806x: Replace backticks by $(...)
This replaces deprecated backticks by more versatile $(...) syntax.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-08-31 12:08:23 +02:00
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
Matthias Schiffer 08a94ecaee
ipq806x: upgrade: fix RAMFS_COPY_*
RAMFS_COPY_* are moved to platform.sh toplevel. The unneeded
linksys_preupgrade function is removed, and the nand_do_upgrade call is
moved to platform_do_upgrade.

Fixes: 30f61a34b4 "base-files: always use staged sysupgrade"
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2017-07-11 17:19:23 +02:00
Adrian Panella d700c120bf ipq806x: EA8500 fix sysupgrade over stock firmware
When running sysupgrade for the first time over the second partition
(that still had stock firmware) the rootfs wasn't flashed as there
wasn't enough space.
This happend because stock also uses UBI, but the volume name wasn't
recognised and wasn't deleted before flashing.

Signed-off-by: Adrian Panella <ianchi74@outlook.com>
2016-12-20 09:35:37 +01:00
Adrian Panella 3d067c0132 ipq806x: base-files: add support for Linksys EA8500
Signed-off-by: Adrian Panella <ianchi74@outlook.com>
2016-06-13 22:51:42 +02:00