How to custom flash layout for Linksys dual firmware - EA6350v3 ipq4018

Linksys routers generally have dual firmware, and so does the EA6350 v3. This dual firmware design has its benefits, but I don't really need it.This is kind of waste, and it is not very friendly to openwrt users.

The most important thing for me is to have enough storage space available without considering exroot. Not too much, about 40M is fine.With the default layout, after installing the OpenWrt branch there is only about 20M left to install packages.

I would like to build a custom layout firmware, as shown below.

Without any precise guidelines, I tried to make the following changes to the qcom-ipq4018-ea6350v3.dts file ( snapshot 19.07.7).

    ...
	flash@1 {
		status = "okay";
		compatible = "spi-nand";
		reg = <1>;
		spi-max-frequency = <24000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			kernel@0 {
				label = "kernel";
				reg = <0x00000000 0x04700000>;
			};
			rootfs@300000 {
				label = "rootfs";
				reg = <0x00300000 0x04400000>;
			};
			alt_kernel@4700000 {
				label = "alt_kernel";
				reg = <0x04700000 0x00900000>;
			};
			alt_rootfs@4a00000 {
				label = "alt_rootfs";
				reg = <0x04a00000 0x00600000>;
			};
			sysdiag@5000000 {
				label = "sysdiag";
				reg = <0x05000000 0x00100000>;
			};
			syscfg@5100000 {
				label = "syscfg";
				reg = <0x05100000 0x02F00000>;
			};
			/* 0x00000000 - 0x08000000: 128 MiB */
		};
	};
...

Based on snapshot and 19.07.7, I compiled two firmwares and tested them. After inspection with dmesg and /proc/mtd, I was convinced that although the install looked "successful", but the layout did not change as I expected.

I have used this method to successfully re-layout the unused space of WNDR 3700 v4. But apparently, the luck didn't come again. I am newbie to OpenWrt, and I was wondering if there is a way to achieve my goal.

Thanks!

After many attempts, I confirmed that I got the layout I want on this device.

The partition parameters given in the previous article seem to be suitable for now.

A little summary:

The partitioning scheme I used seems to destroy any of the OEM dual firmware.

If both firmware are damaged, without the help of tftp, there is currently no chance to return to the OEM firmware.

My original idea is that the large partition is used as a common partition, and the small partition is used as a spare. Both partitions can boot normally. But the current situation is that the large partition (mtd11) looks normal, but the small partition mtd13 is used no matter what Neither the factory nor the upgrade image can be written successfully.

It is very difficult to implement this solution based on manual analysis and operation. You need to guess the mtd number of the current "kernel" partition. You also need to build a firmware that can definitely boot normally. And other difficulties. In view of this, I don't recommend you to try .

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.