gemini: support upgrade on reference designs
The Gemini reference design-derived devices uses a partition
format which is predictable and we can exploit this to offer
some proper upgrade path.
The kernel for these contains a hack to use this partition
format unaltered by combining the partitions "Kern" and "Ramdisk"
to one image with all of the kernel+ramdisk in memory.
Then the "Application" which is used for the rootfs go into its
own partition.
Standard flash layout:
Kern 2048k |
Ramdisk 6144k | = 9216k
Application 6144k | = 15360k
Following the pattern of the factory image we create three
images named zImage, rd.gz and hddapp.tgz (these filenames
are misleading! They are just required by the old firmware.)
and flash each individually with "mtd" during upgrades.
Since the IB-4220-V has a different layout with a bigger kernel
space we parameterize this so we can handle this too. (More
fixes are needed for that device though.)
A way to upgrade older OpenWrt on these platforms to the latest
and greatest will be to copy the file
target/linux/gemini/base-files/lib/upgrade/platform.sh
to /lib/upgrade/platform.sh
on your running system and then run sysupgrade from the image
produced after this patch.
The script is picky to sanity check the partitions before
commencing upgrade.
This was tested with a full sysupgrade on the iTian SQ201.
Link: https://github.com/openwrt/openwrt/pull/21680
Signed-off-by: Linus Walleij <linusw@kernel.org>