realtek: merge Zyxel GS1900 firmware partitions
authorSander Vanheule <sander@svanheule.net>
Sat, 21 Sep 2024 13:09:34 +0000 (15:09 +0200)
committerSander Vanheule <sander@svanheule.net>
Sun, 22 Dec 2024 10:09:42 +0000 (11:09 +0100)
The dual-boot partition layout for the Zyxel GS1900 switches results in
6.9MB for both kernel and rootfs. Depending on the package selection,
this may already leave no space for the user overlay.

Merge the two firmware partitions, effectively dropping dual boot
support with OpenWrt. This results in a firmware partition of 13.9MB,
which should leave some room for the future.

To maintain install capabilites on new devices, an image is required
that still fits inside the original partition. The initramfs is used as
factory install image, so ensure this meets the old size constraints.
The factory image can be flashed via the same procedure as vendor images
when reverting to stock, can be installed from stock, or can be launched
via tftpboot.

Link: https://github.com/openwrt/openwrt/issues/16439
Link: https://github.com/openwrt/openwrt/pull/16442
Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi
target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts
target/linux/realtek/image/common.mk

index 5993c1b798dfcd8cf6f437be984b4b69e2c17e23..b985c4bc8e499df79ff3cde0fe7a422b7242bfb4 100644 (file)
                        };
                        partition@b260000 {
                                label = "firmware";
-                               reg = <0x260000 0x6d0000>;
+                               reg = <0x260000 0xda0000>;
                                compatible = "openwrt,uimage", "denx,uimage";
                                openwrt,ih-magic = <0x83800000>;
                        };
-                       partition@930000 {
-                               label = "runtime2";
-                               reg = <0x930000 0x6d0000>;
-                       };
                };
        };
 };
index f049274889a94823b39d49d3450f6d550efe1062..9844dc2180ff3645df27e88f9b1ce825b2f79685 100644 (file)
                        };
                        partition@260000 {
                                label = "firmware";
-                               reg = <0x260000 0x6d0000>;
+                               reg = <0x260000 0xda0000>;
                                compatible = "openwrt,uimage", "denx,uimage";
                                openwrt,ih-magic = <0x83800000>;
                        };
-                       partition@930000 {
-                               label = "runtime2";
-                               reg = <0x930000 0x6d0000>;
-                       };
                };
        };
 };
index 27fcea86ece99bc75a7d2597d241a0793e6af250..d9647dbc07288efaf50cfcdc7ab642c39dc62615 100644 (file)
@@ -57,13 +57,17 @@ define Device/hpe_1920
 endef
 
 define Device/zyxel_gs1900
+  DEVICE_COMPAT_VERSION := 2.0
+  DEVICE_COMPAT_MESSAGE := Dual firmware paritition merged due to size constraints. \
+       Upgrade requires a new factory install. Regular sysupgrade is not possible.
   DEVICE_VENDOR := Zyxel
-  IMAGE_SIZE := 6976k
+  IMAGE_SIZE := 13952k
   UIMAGE_MAGIC := 0x83800000
   KERNEL_INITRAMFS := \
        kernel-bin | \
        append-dtb | \
        libdeflate-gzip | \
        zyxel-vers | \
-       uImage gzip
+       uImage gzip | \
+       check-size 6976k
 endef