]> git.ipfire.org Git - thirdparty/openwrt.git/commit
gemini: support upgrade on reference designs
authorLinus Walleij <linusw@kernel.org>
Wed, 21 Jan 2026 21:24:46 +0000 (22:24 +0100)
committerLinus Walleij <linusw@kernel.org>
Wed, 11 Feb 2026 07:47:45 +0000 (08:47 +0100)
commitdd8727dd67a91d3fd2a80b8893225d8815556328
treed398135a89fa33e947ac71559832d35deda22bcd
parent4a59012dbb704b334b19425ee8b53ba6bee7c6da
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
(cherry picked from commit 0b0cd4efe25d9ee73896c8fa3079074dbae2637d)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
target/linux/gemini/base-files/lib/upgrade/platform.sh
target/linux/gemini/image/Makefile