I have 2 Linksys WRT32X devices which have dual partitions with the OEM firmware on the primary and OpenWRT 19.07.2 on the secondary. Unfortunately, I am having multiple issues and they seem to be related to the dual partition layout.
Here's what I've noticed so far:
I cannot perform an upgrade while running from OpenWRT. I've tried via Luci and the command line. Both appear to upload the firmware fine, but upon reboot, I still have the same firmware loaded in both partitions.
I am able to force the active partitions to swap by using the 3 quick reboot trick.
I am able to upgrade the secondary (OpenWRT) partition by booting to the primary (OEM) partition and doing a standard install.
I installed luci-app-advanced-reboot and it correctly reports what is installed in both partitions. However, clicking the button to reboot to the alternate partition only results in a reboot without switching active partitions.
After reading the X32 OpenWRT page, I tried running "/usr/sbin/fw_printenv -n boot_part" with these results:
Warning: Bad CRC, using default environment
## Error: "boot_part" not defined
Does this mean that something in the bootloader environment has been clobbered? The odd thing is both devices have the same issue, so I doubt it's a random fluke. I can use the 3 quick boot workaround, but I'd prefer to fix the issue before I somehow end up with 2 bricked routers. Has anyone else seen this behavior?
If serial access reset uboot env from uboot prompt.
From OEM move to a more recent OpenWrt stable to see if that changes behaviour
ssh change partition
#!/bin/sh
#hacked from /lib/upgrade/linksys.sh
cur_boot_part=`/usr/sbin/fw_printenv -n boot_part`
target_firmware=""
if [ "$cur_boot_part" = "1" ]
then
target_firmware="kernel2"
fw_setenv boot_part 2
fw_setenv bootcmd "run altnandboot"
elif [ "$cur_boot_part" = "2" ]
then
target_firmware="kernel1"
fw_setenv boot_part 1
fw_setenv bootcmd "run nandboot"
fi
# re-enable recovery so we get back if the new firmware is broken
fw_setenv auto_recovery yes
echo "$target_firmware"
reboot
When you say "reset uboot env from uboot prompt" do you mean this procedure?
If the root cause is the uboot env needs to be reset, how would it have gotten that way? I want to make sure I don't end up back here again if possible. Since both of my devices have this problem, I suspect they were caused by the same sequence of events.
The "3 quick reboot" reference was regarding the built in method for forcing an active partition switch. Since it's one of the "approved" ways of accomplishing this, I would hope that it doesn't contribute to a corrupt uboot env.
but the layouts do differ. Are you able to flash an OEM image from OEM. I don't recall when venom came in the pipe, but there were some changes along the way.
That's one thing I have not tried yet. I don't see why it wouldn't work since I was able to flash OpenWRT from OEM. I'll give it a shot and report back.
Other than verifying that I can boot both OEM partitions, is there anything else that I should check while in that configuration?
I finally had a chance to try various flashing scenarios using the OEM firmware. I double checked log files each time to verify which partition was currently active.
Start - OEM (primary) and OpenWRT (secondary)
Test 1 - Boot to OEM (primary) and flash OEM to secondary - Success
Test 2 - Boot to OEM (secondary) and flash OEM to primary - Success
Test 3 - Boot to OEM (secondary) and flash OpenWRT to primary - Success
Test 4 - Boot to OpenWRT (primary) and use Advanced Reboot to boot into OEM (secondary) - Success
Test 5 - Boot to OpenWRT (primary) and flash OpenWRT to secondary - Success
This is rather odd since test 4 and 5 failed prior. The only difference was OpenWRT was operating from the primary partition rather than the secondary partition as before. Because of this, I tried the following:
Test 6 - Boot to OpenWRT (secondary) and use Advanced Reboot to boot into OpenWRT (primary) - Success
Test 7 - Boot to OpenWRT (secondary) and flash OpenWRT to Primary - Success
Now I am confused as these are the exact scenarios that failed before. Perhaps flashing the OEM firmware to both partitions cleared the error.
While I am glad to have the situation resolved, it would have been nice to know what actually fixed it. Thank you all for the help and suggestions.