ACM3200 Upgrades and partitions

Hi,
i'm sorry it his has been discussed a lot of times, but i cannot find really clear infos.

After having tried an r7800 with its really easy flash/restore procedures , and after having decided to give back to amazon my r7800 ( defective unit i guess) , i'm considering an acm3200.

Before buying, i'm evaluating all its restore/unbrick procedures. (you never know..)

From what i've learned, acm3200 has 2 partitions.
I can decide from which to boot in 2 ways

  1. within shell of openwrt with ubootenv set boot_boot part 1/2
  2. power/cycle(3 times) repeated in a specific way

Ok, i think all this is correct.

Now.
Let's assume i have
partition 1 STOCK firmware
partition 2 OWRT

If my active partition is 1, and i flash an upgraded stock firmware, will it overwrite partition 2? ( i guess yes..)

If my active partition is 2, and i flash an OWRT , will it overwrite partition 1 or 2 ?

Can i decide which partition to overwrite from shell? and from Luci?

So, i guess i cannot keep an updated linksys firmware , as it defaults to overwrite partition 2, but i should be able to keep an updated OWRT, overwriting always partition 2, and keep partition 1 for safety.

If i have 2 partitions with OWRT, is it possible to flash original stock firmware, or do i have to use the USB2TTL interface?

Thank you, and sorry for RTFM questions..
Bye

As far as I know, the update procedure always overwrites the other partition. If you are currently using partitioin 1, partition 2 is updated and vice versa. Which has the nice effect, if an update goes wrong, you can always fall back to your latest working setup on the other partition.

What you could do if you want to keep stock on partition 1 and openwrt on partition 2: Boot to the other partition and update the first on from there. Example: you want to update openwrt, boot to stock, and update openwrt (on partition 2) from there. But this way, no settings will be saved, and you will have to start from scratch. Or play back your backups.

Your last question: You should be able to flash stock from openwrt, but I haven't tried that myself, since I didn't have a reason to do so.

2 Likes

Yes, you can flash the OEM firmware back from OpenWrt. Image type check in the sysupgrade process will fail, but you can "force" the sysupgrade (even from LuCI in the current master). No need for USB serial cable.

Like MagicSimi said, the sysupgrade always writes to the other partition and will keep the current one as fallback option. That goes for both Linksys OEM firmware and for OpenWrt.

You can not select on sysupgrade time which partition you writeto, so trying to keep stock firmware in one and Openwrt in the other would be quite cumbersome (as you would lose settings in each sysupgrade as you would need to use Linksys firmware to flash Openwrt again).

1 Like

Ok,
that's clear now. Thank you.

I was not really sure because i read this post
https://forum.archive.openwrt.org/viewtopic.php?id=67607&p=1#p338569

and you can read, in the Villeneuve post (code block), that setting the current firmware partition, prior to flashing he can decide where to flash. ( so.. i think that setting current partition to number 1, he can flash on number 2)

If setting boot partition, decides also which partition NOT to flash, we have a way (only for OWRT) to flash where in which partition we desire..

Thank you

I used to do a little trick on these, using the script as an example (here is one I wrote a few years ago based off his):

#!/bin/sh
# Hacked from /lib/upgrade/linksys.sh (then taken from anomeome and hacked even further)
 
cur_boot_part=`/usr/sbin/fw_printenv -n boot_part`
target_firmware=""
if [ "$cur_boot_part" = "1" ]
then
    target_firmware="Switching to Kernel/Partition 2"
    fw_setenv boot_part 2
    fw_setenv bootcmd "run altnandboot"
elif [ "$cur_boot_part" = "2" ]
then
    target_firmware="Switching to Kernel/Partition 1"
    fw_setenv boot_part 1
    fw_setenv bootcmd "run nandboot"
fi
# Re-enable recovery so we get back in case the new firmware ist kaput
fw_setenv auto_recovery yes
echo "$target_firmware"
 
# Add option to reboot now or later
read -p "Are you ready to reboot now? y or n = " CONT
if [ "$CONT" = "y" ]; then
    echo "Rebooting now"
    reboot
elif [ "$CONT" = "yes" ]; then
    echo "Rebooting now"
    reboot
else
    echo "Exiting for manual reboot"
fi

This gives you the ability to at least choose "y or n" (or yes / no) to reboot, or wait. So, if you were to run this once (choosing not to reboot), it would change the partitions from 1 to 2, or 2 to 1. Then, you could flash effectively overwriting the current partition as the system thinks it's the "other". Be careful though, as if you run this script again and again and again, you could forget what partition was active to start with :slight_smile:

1 Like

so it's possible, at least in the partition containing owrt :slight_smile:

Thank you

Correct, at least it used to be.

The other way people normally juggle it is from within OpenWRT, set your partitions to boot to the alt partition (which would be linksys image). Then from within the linksys image flash the factory openwrt image of whatever new version you want. You can juggle it that way.

I think @stangri made a nice LuCi menu for juggling this too called Advanced Reboot.

1 Like

You can toggle boot_part in uboot-env without rebooting, that should fool the upgrade code enough.

For the ZyXEL NBG6817 I'm evaluating the root=/dev/mmcblk0p5 kernel parameter from /proc/cmdline to extract the currently-booted-rootfs:

This also allows (optionally) fooling the upgrade to overwrite the current partition set, instead of the alternative one:

1 Like

Exactly what I mean. That's why I added the option in my script to not reboot immediately. Flip the switch, flash, reboot.

1 Like

Perfect.
Everything is clear now!
Thank you

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