Web UI to reboot to another partition (for Linksys/ZyXEL dual-partition routers) and to power off/power down

Hello, the process is exactly the same as for my older WRT3200acm. First, determine the current partition number(1 or 2) with command:

/usr/sbin/fw_printenv -n boot_part

Then boot to the opposite partition number:

/usr/sbin/fw_setenv boot_part 1 && reboot
or
/usr/sbin/fw_setenv boot_part 2 && reboot

If only these commands are needed, then it will be the same for the V2 version of the router as well.

Thanks for your prompt reply.

If these commands work, the luci app should work too. Can you check if there are labels on the partitions by running:

dd if="/dev/mtd21" bs=1 count=256
dd if="/dev/mtd22" bs=1 count=256
dd if="/dev/mtd23" bs=1 count=256
dd if="/dev/mtd24" bs=1 count=256

I keep forgetting if it should be kernel or rootfs which is queried for the labels, so please run all 4 commands.

PS. Maybe save the output with of=/tmp/mtdXX-file variable and open the output files in a hex editor to confirm exact location of the label if it exists there. My guess it would be after 32 bytes or 192 bytes.

This is a bit beyond my knowledge, so I am pasting what I see. I clicked on the "k" in the word "kernel" in images mtd21 and mtd23 so the address(0xA8) shows up on the bottom left. Hope it answers your question:

mtd21-file:

mtd22-file:

mtd23-file:

mtd24-file:

Thank you so much, you've done amazingly well, the luci-app-advanced-reboot 1.0.1-11 from my repository should support your router. If you use github and want to share your username, I'll be sure to mention it in the pull request I'm going to send to merge the code into OpenWrt repo after you can test it.

Thank you for guiding me through it. I am not a regular user of github and it shows... It took me a good 15 minutes to figure out what to download from there. No issues on the install. I was able to boot to the alternative partition twice without any issues:

Booting from NSS driver snapshot image to regular openwrt snapshot build(yes they both have the same kernel version) on partition # 1:

And then back to the NSS driver snapshot image from the regular openwrt snapshot on partition # 2:

Is there anything else I should check?

Could you please elaborate on the images you flashed? I'm guessing one of them is not an official OpenWrt, is it?

This router is not supported in the stable releases yet, only the snapshot builds. Partition # 1 has an ordinary snapshot build put together with the firmware selector (SNAPSHOT r26971).

Partition # 2 is a community build, based off the snapshot builds:

When booted into a community build, could you please capture the output of:

cat /etc/os-release

Here it is:

NAME="OpenWrt"
VERSION="SNAPSHOT"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt SNAPSHOT"
VERSION_ID="snapshot"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r0-794264ef"
OPENWRT_BOARD="qualcommax/ipq807x"
OPENWRT_ARCH="aarch64_cortex-a53"
OPENWRT_TAINTS="no-all"
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt SNAPSHOT r0-794264ef"

Thanks again for your prompt reply. At least the mystery of where does r0 come from is solved.

I don't have OpenWrt snapshot installed ATM, but this is how this file looks on OpenWrt release:

edge620 in ~ # cat /etc/os-release
NAME="OpenWrt"
VERSION="23.05.4"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt 23.05.4"
VERSION_ID="23.05.4"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r24012-d8dd03c46f"
OPENWRT_BOARD="x86/64"
OPENWRT_ARCH="x86_64"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt 23.05.4 r24012-d8dd03c46f"

Hi,

I have a Linksys MX4200 V2. Is it possible to support this too?

ubus call system board

{
	"kernel": "6.6.41",
	"hostname": "marvin",
	"system": "ARMv8 Processor rev 4",
	"model": "Linksys MX4200v2",
	"board_name": "linksys,mx4200v2",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "SNAPSHOT",
		"revision": "r26992-bbcd5111cb",
		"target": "qualcommax/ipq807x",
		"description": "OpenWrt SNAPSHOT r26992-bbcd5111cb"
	}
}

cat /tmp/sysinfo/board_name

linksys,mx4200v2

cat /proc/mtd

dev:    size   erasesize  name
mtd0: 00100000 00020000 "0:sbl1"
mtd1: 00100000 00020000 "0:mibib"
mtd2: 00080000 00020000 "0:bootconfig"
mtd3: 00080000 00020000 "0:bootconfig1"
mtd4: 00300000 00020000 "0:qsee"
mtd5: 00300000 00020000 "0:qsee_1"
mtd6: 00080000 00020000 "0:devcfg"
mtd7: 00080000 00020000 "0:devcfg_1"
mtd8: 00080000 00020000 "0:apdp"
mtd9: 00080000 00020000 "0:apdp_1"
mtd10: 00080000 00020000 "0:rpm"
mtd11: 00080000 00020000 "0:rpm_1"
mtd12: 00080000 00020000 "0:cdt"
mtd13: 00080000 00020000 "0:cdt_1"
mtd14: 00080000 00020000 "0:appsblenv"
mtd15: 00100000 00020000 "0:appsbl"
mtd16: 00100000 00020000 "0:appsbl_1"
mtd17: 00080000 00020000 "0:art"
mtd18: 00040000 00020000 "u_env"
mtd19: 00020000 00020000 "s_env"
mtd20: 00020000 00020000 "devinfo"
mtd21: 09600000 00020000 "kernel"
mtd22: 09000000 00020000 "rootfs"
mtd23: 09600000 00020000 "alt_kernel"
mtd24: 09000000 00020000 "alt_rootfs"
mtd25: 00200000 00020000 "sysdiag"
mtd26: 00080000 00020000 "0:ethphyfw"
mtd27: 0b800000 00020000 "syscfg"
mtd28: 00900000 00020000 "0:wififw"

fw_printenv

altkern=a680000
auto_recovery=yes
baudrate=115200
bdf_country=UK_ME_EU
boot_ver=1.0.03
bootargs=console=ttyMSM0,115200n8
bootcmd=if test $auto_recovery = no; then bootipq; elif test $boot_part = 1; then run bootpart1; else run bootpart2; fi
bootdelay=1
bootpart1=set bootargs $partbootargs && nand read $loadaddr $prikern $kernsize && bootm $loadaddr
bootpart2=set bootargs $partbootargs2 && nand read $loadaddr $altkern $kernsize && bootm $loadaddr
cmd0=init=/sbin/init rootfstype=squashfs ubi.mtd=22,2048 ubi.block=0,0 root=/dev/ubiblock0_0 rootwait ro
cmd1=init=/sbin/init rootfstype=squashfs ubi.mtd=24,2048 ubi.block=0,0 root=/dev/ubiblock0_0 rootwait ro
cmd2=mtdparts=qcom_nand.0:0x100000@0x0(0:SBL1),0x100000@0x100000(0:MIBIB),0x80000@0x200000(0:BOOTCONFIG),
cmd3=0x80000@0x280000(0:BOOTCONFIG1),0x300000@0x300000(0:QSEE),0x300000@0x600000(0:QSEE_1),0x80000@0x900000(0:DEVCFG),
cmd4=0x80000@0x980000(0:DEVCFG_1),0x80000@0xa00000(0:APDP),0x80000@0xa80000(0:APDP_1),0x80000@0xb00000(0:RPM),
cmd5=0x80000@0xb80000(0:RPM_1),0x80000@0xc00000(0:CDT),0x80000@0xc80000(0:CDT_1),0x80000@0xd00000(0:APPSBLENV),
cmd6=0x100000@0xd80000(0:APPSBL),0x100000@0xe80000(0:APPSBL_1),0x80000@0xf80000(0:ART),
cmd7=0x40000@0x1000000(u_env),0x20000@0x1040000(s_env),0x20000@0x1060000(devinfo),
cmd8=0x9600000@0x1080000(kernel),0x9000000@0x1680000(rootfs),0x9600000@0xa680000(alt_kernel),0x9000000@0xac80000(alt_rootfs),
cmd9=0x200000@0x13c80000(sysdiag),0x80000@0x13e80000(0:ETHPHYFW),0xb800000@0x13f00000(syscfg),0x900000@0x1f700000(0:WIFIFW)
eth1addr=e8:9f:80:e5:ef:75
eth2addr=E8:9F:80:E5:EF:75
eth3addr=E8:9F:80:E5:EF:75
eth4addr=E8:9F:80:E5:EF:75
eth5addr=E8:9F:80:E5:EF:75
ethact=eth0
ethaddr=e8:9f:80:e5:ef:75
fdt_high=0x4A400000
fdtcontroladdr=4a970b30
fileaddr=44000000
filesize=24a0000
flash_type=2
flashimg=tftpboot $loadaddr $image && nand erase $prikern $imgsize && nand write $loadaddr $prikern $filesize
flashimg2=tftpboot $loadaddr $image && nand erase $altkern $imgsize && nand write $loadaddr $altkern $filesize
image=FW_MX4200CF_2.0.5.210892_prod.img
imgsize=9600000
ipaddr=192.168.1.1
kernsize=600000
loadaddr=44000000
machid=801000d
maxpartialboots=3
mtddevname=fs
mtddevnum=0
mtdids=nand0=nand0
mtdparts=mtdparts=nand0:0x9000000@0xac80000(fs),
netmask=255.255.255.0
partbootargs=init=/sbin/init rootfstype=squashfs ubi.mtd=22,2048 ubi.block=0,0 root=/dev/ubiblock0_0 rootwait ro mtdparts=qcom_nand.0:0x100000@0x0(0:SBL1),0x100000@0x100000(0:MIBIB),0x80000@0x200000(0:BOOTCONFIG),0x80000@0x280000(0:BOOTCONFIG1),0x300000@0x300000(0:QSEE),0x300000@0x600000(0:QSEE_1),0x80000@0x900000(0:DEVCFG),0x80000@0x980000(0:DEVCFG_1),0x80000@0xa00000(0:APDP),0x80000@0xa80000(0:APDP_1),0x80000@0xb00000(0:RPM),0x80000@0xb80000(0:RPM_1),0x80000@0xc00000(0:CDT),0x80000@0xc80000(0:CDT_1),0x80000@0xd00000(0:APPSBLENV),0x100000@0xd80000(0:APPSBL),0x100000@0xe80000(0:APPSBL_1),0x80000@0xf80000(0:ART),0x40000@0x1000000(u_env),0x20000@0x1040000(s_env),0x20000@0x1060000(devinfo),0x9600000@0x1080000(kernel),0x9000000@0x1680000(rootfs),0x9600000@0xa680000(alt_kernel),0x9000000@0xac80000(alt_rootfs),0x200000@0x13c80000(sysdiag),0x80000@0x13e80000(0:ETHPHYFW),0xb800000@0x13f00000(syscfg),0x900000@0x1f700000(0:WIFIFW)
partbootargs2=init=/sbin/init rootfstype=squashfs ubi.mtd=24,2048 ubi.block=0,0 root=/dev/ubiblock0_0 rootwait ro mtdparts=qcom_nand.0:0x100000@0x0(0:SBL1),0x100000@0x100000(0:MIBIB),0x80000@0x200000(0:BOOTCONFIG),0x80000@0x280000(0:BOOTCONFIG1),0x300000@0x300000(0:QSEE),0x300000@0x600000(0:QSEE_1),0x80000@0x900000(0:DEVCFG),0x80000@0x980000(0:DEVCFG_1),0x80000@0xa00000(0:APDP),0x80000@0xa80000(0:APDP_1),0x80000@0xb00000(0:RPM),0x80000@0xb80000(0:RPM_1),0x80000@0xc00000(0:CDT),0x80000@0xc80000(0:CDT_1),0x80000@0xd00000(0:APPSBLENV),0x100000@0xd80000(0:APPSBL),0x100000@0xe80000(0:APPSBL_1),0x80000@0xf80000(0:ART),0x40000@0x1000000(u_env),0x20000@0x1040000(s_env),0x20000@0x1060000(devinfo),0x9600000@0x1080000(kernel),0x9000000@0x1680000(rootfs),0x9600000@0xa680000(alt_kernel),0x9000000@0xac80000(alt_rootfs),0x200000@0x13c80000(sysdiag),0x80000@0x13e80000(0:ETHPHYFW),0xb800000@0x13f00000(syscfg),0x900000@0x1f700000(0:WIFIFW)
partition=nand0,0
prikern=1080000
serverip=192.168.1.100
soc_hw_version=200d0200
soc_version_major=2
soc_version_minor=0
stderr=serial@78B3000
stdin=serial@78B3000
stdout=serial@78B3000
boot_part_ready=3
boot_part=2

Is there any other info you need?

Thanks

For the MX4200v2 as well. The model is SPNMX42 and it's distributed by Community Fibre in the UK but it's the same hardware.

The process to switch partitions is the same as for v1. fw_setenv boot_part 1 && reboot takes you to kernel while fw_setenv boot_part 2 && reboot takes you to alt_kernel.

ubus call system board
{
        "kernel": "6.6.41",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 4",
        "model": "Linksys MX4200v2",
        "board_name": "linksys,mx4200v2",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "SNAPSHOT",
                "revision": "r26996-73832e1a48",
                "target": "qualcommax/ipq807x",
                "description": "OpenWrt SNAPSHOT r26996-73832e1a48"
        }
}
cat /tmp/sysinfo/board_name
linksys,mx4200v2
cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "0:sbl1"
mtd1: 00100000 00020000 "0:mibib"
mtd2: 00080000 00020000 "0:bootconfig"
mtd3: 00080000 00020000 "0:bootconfig1"
mtd4: 00300000 00020000 "0:qsee"
mtd5: 00300000 00020000 "0:qsee_1"
mtd6: 00080000 00020000 "0:devcfg"
mtd7: 00080000 00020000 "0:devcfg_1"
mtd8: 00080000 00020000 "0:apdp"
mtd9: 00080000 00020000 "0:apdp_1"
mtd10: 00080000 00020000 "0:rpm"
mtd11: 00080000 00020000 "0:rpm_1"
mtd12: 00080000 00020000 "0:cdt"
mtd13: 00080000 00020000 "0:cdt_1"
mtd14: 00080000 00020000 "0:appsblenv"
mtd15: 00100000 00020000 "0:appsbl"
mtd16: 00100000 00020000 "0:appsbl_1"
mtd17: 00080000 00020000 "0:art"
mtd18: 00040000 00020000 "u_env"
mtd19: 00020000 00020000 "s_env"
mtd20: 00020000 00020000 "devinfo"
mtd21: 09600000 00020000 "kernel"
mtd22: 09000000 00020000 "rootfs"
mtd23: 09600000 00020000 "alt_kernel"
mtd24: 09000000 00020000 "alt_rootfs"
mtd25: 00200000 00020000 "sysdiag"
mtd26: 00080000 00020000 "0:ethphyfw"
mtd27: 0b800000 00020000 "syscfg"
mtd28: 00900000 00020000 "0:wififw"
fw_printenv
altkern=a680000
auto_recovery=yes
baudrate=115200
bdf_country=UK_ME_EU
boot_ver=1.0.03
bootargs=console=ttyMSM0,115200n8
bootcmd=if test $auto_recovery = no; then bootipq; elif test $boot_part = 1; then run bootpart1; else run bootpart2; fi
bootdelay=1
bootpart1=set bootargs $partbootargs && nand read $loadaddr $prikern $kernsize && bootm $loadaddr
bootpart2=set bootargs $partbootargs2 && nand read $loadaddr $altkern $kernsize && bootm $loadaddr
cmd0=init=/sbin/init rootfstype=squashfs ubi.mtd=22,2048 ubi.block=0,0 root=/dev/ubiblock0_0 rootwait ro
cmd1=init=/sbin/init rootfstype=squashfs ubi.mtd=24,2048 ubi.block=0,0 root=/dev/ubiblock0_0 rootwait ro
cmd2=mtdparts=qcom_nand.0:0x100000@0x0(0:SBL1),0x100000@0x100000(0:MIBIB),0x80000@0x200000(0:BOOTCONFIG),
cmd3=0x80000@0x280000(0:BOOTCONFIG1),0x300000@0x300000(0:QSEE),0x300000@0x600000(0:QSEE_1),0x80000@0x900000(0:DEVCFG),
cmd4=0x80000@0x980000(0:DEVCFG_1),0x80000@0xa00000(0:APDP),0x80000@0xa80000(0:APDP_1),0x80000@0xb00000(0:RPM),
cmd5=0x80000@0xb80000(0:RPM_1),0x80000@0xc00000(0:CDT),0x80000@0xc80000(0:CDT_1),0x80000@0xd00000(0:APPSBLENV),
cmd6=0x100000@0xd80000(0:APPSBL),0x100000@0xe80000(0:APPSBL_1),0x80000@0xf80000(0:ART),
cmd7=0x40000@0x1000000(u_env),0x20000@0x1040000(s_env),0x20000@0x1060000(devinfo),
cmd8=0x9600000@0x1080000(kernel),0x9000000@0x1680000(rootfs),0x9600000@0xa680000(alt_kernel),0x9000000@0xac80000(alt_rootfs),
cmd9=0x200000@0x13c80000(sysdiag),0x80000@0x13e80000(0:ETHPHYFW),0xb800000@0x13f00000(syscfg),0x900000@0x1f700000(0:WIFIFW)
eth1addr=e8:9f:80:xx:xx:xx
eth2addr=E8:9F:80:xx:xx:xx
eth3addr=E8:9F:80:xx:xx:xx
eth4addr=E8:9F:80:xx:xx:xx
eth5addr=E8:9F:80:xx:xx:x
ethact=eth0
ethaddr=e8:9f:80:xx:xx:xx
fdt_high=0x4A400000
fdtcontroladdr=4a970b30
fileaddr=44000000
filesize=24a0000
flash_type=2
flashimg=tftpboot $loadaddr $image && nand erase $prikern $imgsize && nand write $loadaddr $prikern $filesize
flashimg2=tftpboot $loadaddr $image && nand erase $altkern $imgsize && nand write $loadaddr $altkern $filesize
image=FW_MX4200CF_2.0.5.210892_prod.img
imgsize=9600000
ipaddr=192.168.1.1
kernsize=600000
loadaddr=44000000
machid=801000d
maxpartialboots=3
mtddevname=fs
mtddevnum=0
mtdids=nand0=nand0
mtdparts=mtdparts=nand0:0x9000000@0xac80000(fs),
netmask=255.255.255.0
partbootargs=init=/sbin/init rootfstype=squashfs ubi.mtd=22,2048 ubi.block=0,0 root=/dev/ubiblock0_0 rootwait ro mtdparts=qcom_nand.0:0x100000@0x0(0:SBL1),0x100000@0x100000(0:MIBIB),0x80000@0x200000(0:BOOTCONFIG),0x80000@0x280000(0:BOOTCONFIG1),0x300000@0x300000(0:QSEE),0x300000@0x600000(0:QSEE_1),0x80000@0x900000(0:DEVCFG),0x80000@0x980000(0:DEVCFG_1),0x80000@0xa00000(0:APDP),0x80000@0xa80000(0:APDP_1),0x80000@0xb00000(0:RPM),0x80000@0xb80000(0:RPM_1),0x80000@0xc00000(0:CDT),0x80000@0xc80000(0:CDT_1),0x80000@0xd00000(0:APPSBLENV),0x100000@0xd80000(0:APPSBL),0x100000@0xe80000(0:APPSBL_1),0x80000@0xf80000(0:ART),0x40000@0x1000000(u_env),0x20000@0x1040000(s_env),0x20000@0x1060000(devinfo),0x9600000@0x1080000(kernel),0x9000000@0x1680000(rootfs),0x9600000@0xa680000(alt_kernel),0x9000000@0xac80000(alt_rootfs),0x200000@0x13c80000(sysdiag),0x80000@0x13e80000(0:ETHPHYFW),0xb800000@0x13f00000(syscfg),0x900000@0x1f700000(0:WIFIFW)
partbootargs2=init=/sbin/init rootfstype=squashfs ubi.mtd=24,2048 ubi.block=0,0 root=/dev/ubiblock0_0 rootwait ro mtdparts=qcom_nand.0:0x100000@0x0(0:SBL1),0x100000@0x100000(0:MIBIB),0x80000@0x200000(0:BOOTCONFIG),0x80000@0x280000(0:BOOTCONFIG1),0x300000@0x300000(0:QSEE),0x300000@0x600000(0:QSEE_1),0x80000@0x900000(0:DEVCFG),0x80000@0x980000(0:DEVCFG_1),0x80000@0xa00000(0:APDP),0x80000@0xa80000(0:APDP_1),0x80000@0xb00000(0:RPM),0x80000@0xb80000(0:RPM_1),0x80000@0xc00000(0:CDT),0x80000@0xc80000(0:CDT_1),0x80000@0xd00000(0:APPSBLENV),0x100000@0xd80000(0:APPSBL),0x100000@0xe80000(0:APPSBL_1),0x80000@0xf80000(0:ART),0x40000@0x1000000(u_env),0x20000@0x1040000(s_env),0x20000@0x1060000(devinfo),0x9600000@0x1080000(kernel),0x9000000@0x1680000(rootfs),0x9600000@0xa680000(alt_kernel),0x9000000@0xac80000(alt_rootfs),0x200000@0x13c80000(sysdiag),0x80000@0x13e80000(0:ETHPHYFW),0xb800000@0x13f00000(syscfg),0x900000@0x1f700000(0:WIFIFW)
partition=nand0,0
prikern=1080000
serverip=192.168.1.100
soc_hw_version=200d0200
soc_version_major=2
soc_version_minor=0
stderr=serial@78B3000
stdin=serial@78B3000
stdout=serial@78B3000
boot_part_ready=3
boot_part=1
hexdump -C -n 256 /dev/mtd21
00000000  d0 0d fe ed 00 52 16 60  00 00 00 38 00 52 12 74  |.....R.`...8.R.t|
00000010  00 00 00 28 00 00 00 11  00 00 00 10 00 00 00 00  |...(............|
00000020  00 00 00 6c 00 52 12 3c  00 00 00 00 00 00 00 00  |...l.R.<........|
00000030  00 00 00 00 00 00 00 00  00 00 00 01 00 00 00 00  |................|
00000040  00 00 00 03 00 00 00 04  00 00 00 5c 66 a2 bb 78  |...........\f..x|
00000050  00 00 00 03 00 00 00 29  00 00 00 00 41 52 4d 36  |.......)....ARM6|
00000060  34 20 4f 70 65 6e 57 72  74 20 46 49 54 20 28 46  |4 OpenWrt FIT (F|
00000070  6c 61 74 74 65 6e 65 64  20 49 6d 61 67 65 20 54  |lattened Image T|
00000080  72 65 65 29 00 00 00 00  00 00 00 03 00 00 00 04  |ree)............|
00000090  00 00 00 0c 00 00 00 01  00 00 00 01 69 6d 61 67  |............imag|
000000a0  65 73 00 00 00 00 00 01  6b 65 72 6e 65 6c 2d 31  |es......kernel-1|
000000b0  00 00 00 00 00 00 00 03  00 00 00 1b 00 00 00 00  |................|
000000c0  41 52 4d 36 34 20 4f 70  65 6e 57 72 74 20 4c 69  |ARM64 OpenWrt Li|
000000d0  6e 75 78 2d 36 2e 36 2e  34 31 00 00 00 00 00 03  |nux-6.6.41......|
000000e0  00 51 5c 65 00 00 00 1b  1f 8b 08 00 00 00 00 00  |.Q\e............|
000000f0  02 ff ec ce bd 6a 93 61  18 00 d0 a7 f9 c0 41 94  |.....j.a......A.|
hexdump -C -n 256 /dev/mtd23
00000000  d0 0d fe ed 00 52 16 60  00 00 00 38 00 52 12 74  |.....R.`...8.R.t|
00000010  00 00 00 28 00 00 00 11  00 00 00 10 00 00 00 00  |...(............|
00000020  00 00 00 6c 00 52 12 3c  00 00 00 00 00 00 00 00  |...l.R.<........|
00000030  00 00 00 00 00 00 00 00  00 00 00 01 00 00 00 00  |................|
00000040  00 00 00 03 00 00 00 04  00 00 00 5c 66 a2 bb 78  |...........\f..x|
00000050  00 00 00 03 00 00 00 29  00 00 00 00 41 52 4d 36  |.......)....ARM6|
00000060  34 20 4f 70 65 6e 57 72  74 20 46 49 54 20 28 46  |4 OpenWrt FIT (F|
00000070  6c 61 74 74 65 6e 65 64  20 49 6d 61 67 65 20 54  |lattened Image T|
00000080  72 65 65 29 00 00 00 00  00 00 00 03 00 00 00 04  |ree)............|
00000090  00 00 00 0c 00 00 00 01  00 00 00 01 69 6d 61 67  |............imag|
000000a0  65 73 00 00 00 00 00 01  6b 65 72 6e 65 6c 2d 31  |es......kernel-1|
000000b0  00 00 00 00 00 00 00 03  00 00 00 1b 00 00 00 00  |................|
000000c0  41 52 4d 36 34 20 4f 70  65 6e 57 72 74 20 4c 69  |ARM64 OpenWrt Li|
000000d0  6e 75 78 2d 36 2e 36 2e  34 31 00 00 00 00 00 03  |nux-6.6.41......|
000000e0  00 51 5c 65 00 00 00 1b  1f 8b 08 00 00 00 00 00  |.Q\e............|
000000f0  02 ff ec ce bd 6a 93 61  18 00 d0 a7 f9 c0 41 94  |.....j.a......A.|

Thanks for the PR @innovara !

@stangri is there any chance that you can push version 12 including support for the MX4200v2 to your repos?

1 Like

Just did, thank you for your contribution and reminder!

Hi @stangri and @ScottHW
Anything new about support for the Linksys EA6350 v4?
https://openwrt.org/toh/linksys/ea6350_v4

ubus call system board
{
"kernel": "5.15.167",
"hostname": "AccessPoint",
"system": "MediaTek MT7621 ver:1 eco:3",
"model": "Linksys EA6350 v4",
"board_name": "linksys,ea6350-v4",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "23.05.5",
"revision": "r24106-10cc5fcd00",
"target": "ramips/mt7621",
"description": "OpenWrt 23.05.5 r24106-10cc5fcd00"
}
}

cat /tmp/sysinfo/board_name
linksys,ea6350-v4

cat /proc/mtd
dev: size erasesize name
mtd0: 00080000 00020000 "boot"
mtd1: 00040000 00020000 "u_env"
mtd2: 00040000 00020000 "factory"
mtd3: 00040000 00020000 "s_env"
mtd4: 00040000 00020000 "devinfo"
mtd5: 00400000 00020000 "kernel"
mtd6: 02400000 00020000 "ubi"
mtd7: 00400000 00020000 "alt_kernel"
mtd8: 02400000 00020000 "alt_rootfs"
mtd9: 00100000 00020000 "sysdiag"
mtd10: 02d00000 00020000 "syscfg"

fw_printenv
bootcmd=tftp
bootdelay=5
baudrate=115200
ethaddr="00:AA:BB: : : "
ipaddr=192.168. .
serverip=192.168. .
auto_recovery=yes
boot_ver=0.0.2
BootType=3
boot_part_ready=3
boot_part=1
stdin=serial
stdout=serial
stderr=serial
bootargs=console=ttyS1,115200n8 root=/dev/mtdblock6 ro rootfstype=jffs2 init=/sbin/init

Unless you can find the commit for this device and it says otherwise, the only way to make it boot into B partition would be to set the failed boot count in the S_ENV partition to 3. Without access to device it's impossible for me to know how the failed boot count is stored there.

If you want to provide the S_ENV partition dumps after 1, 2 failed boots and once it's been erased, I can give the support a shot within a few weeks.

Isn't it enough to change boot_part u-boot env to boot from the second partition?

Thank you for your fast reply, stangri. I'm looking into how I can help.

If I unterstand correctly, you need a hexdump similar like innovara and Jruuu provided for their devices?

As you are talking about S_ENV I would need to do a hexdump for mtd3 in my case, after each reboot? Or would you need the kernel (mtd5) and alternative kernel (mtd7) like innovara did?

If that's the things you need, I'll take a look into it within the next few days. Otherwise any hint what I have to look into is much appreciated.

The entries in the S_ENV partition look like this:

0x1800  11 08 11 20 00 00 00 00  11 08 11 20              |... ....... |
0x2000  11 08 11 20 01 00 00 00  12 08 11 20              |... ....... |
0x2800  11 08 11 20 00 00 00 00  11 08 11 20              |... ....... |
0x3000  11 08 11 20 01 00 00 00  12 08 11 20              |... ....... |
0x3800  11 08 11 20 00 00 00 00  11 08 11 20              |... ....... |
0x4000  11 08 11 20 01 00 00 00  12 08 11 20              |... ....... |
0x4800  11 08 11 20 02 00 00 00  13 08 11 20              |... ....... |
0x5000  11 08 11 20 03 00 00 00  14 08 11 20              |... ....... |
0x5800  11 08 11 20 00 00 00 00  11 08 11 20              |... ....... |