/sys/fs/pstore looks to be empty. I used "vi /sys/fs/pstore".
It's a folder /sys/fs/pstore/
and if there are files in there, look at those and delete them. As long as they are present the device will boot into recovery mode, to get your attention and look what happened.
Thanks to you and @daniel, I managed to get factory.bin uploaded via TFTP. However, when attempting to execute the command mtd erase factory && mtd write factory 0x48000000 0 0x80000
per the Hard Recovery instructions, I'm greeted with a MTD device factory not found, ret -19
. Would this be a relatively easy fix in my syntax? I was attempting to install the latest snapshot, if that helps.
This means you are using bl31-uboot.fip
which already expects factory
data as UBI volume and no longer defines an MTD partition for that. That is most likely also the reason why UBI cannot be attached in U-Boot. From that we can conclude that your device has never run the v1.1.x installer and you probably also won't have to re-write factory data (as long as you never booted or installed any OpenWrt snapshot after commit 6aec3c7b5b).
The fix for OKD in your case is simple: Use bl31-uboot.fip
of 23.05.4 and use that to write bl2
preloader from 22.03.0 (which is before the OKD bug was introduced). That should resolve OKD issue and you are fine until you want to switch to upcoming OpenWrt releases or snapshots after commit 6aec3c7b5b -- for that you will then have to run the installer again, to update bootloader and move factory
and fip
into UBI.
I've found in my previous testing that running the snapshot fip with flash data still stored in the stable layout will (or at least previously would) cause the router to load (and format, if necessary) UBI at the offset it is told to use. Given that the device in question clearly did not do so, is it safe to assume you have modified the initial environment to ensure it won't automatically format upon first boot?
The device has never booted a new (as in: FIP-in-UBI) OpenWrt snapshot, just run U-Boot, and there I have dropped the ubi_format
macro to prevent this from happening by accident (traces of calling it still exist I see now that I look at it...)
Awesome! I managed to get back in and restore my router to OpenWRT 23.05.4. I'm gonna try and put together a dedicated guide for this that anyone can look at, rather than having to have you guys constantly point people back to different threads within this post. I'd love to try and make life easier for all of us, especially given the headache this is. I genuinely appreciate you guys, @daniel and @grauerfuchs, for guiding me along through this.
My router is stuck in recovery OpenWrt SNAPSHOT r18125-b764cb9e5b.
when I tried to upgrade to 22.03.7. Any way i can get the sys image working from recovery?
I don't mind losing my settings and config. Any way I can get to the release build instead of the snapshot if that is possible?
@daniel The installer README contains this:
WARNING #2 Re-flashing the installer when the device is already using UBI flash layout will erase the previously backed up bootchain, which in most cases would be the vendor/official one.
As we step towards OpenWRT where pretty much everyone will need to do a second UBI installer re-flash, is it worth investing time in making it possible to retain the vendor/official bootchain in the boot_backup partition?
I performed a pstore clean and power cycle and it booted to the latest recovery!! 6.6.45 next flashing the snapshot sysupgrade should work
edit: It all worked out with the latest snapshot!!
Would be hard to determine whether the contents in the backup volume is correct. After all, this backup volume can be changed or even removed by end users.
There’s also an issue in that the backup made there was incomplete for certain earlier installer versions. @patrakov please take this into account since I saw earlier you were wondering about going back to stock and back or something like that.
Don't forget how old the stock firmware is at this point. Since the manufacturer considers the device past end-of-life, we may not get much if any updates from them, either. How many major security issues have been found in the packages since the last stock release?
By the way does it matter that that information is lost? I don't really understand the significance of that.
It might. I haven't bothered to tear apart the stock firmware to see what all is used or where it is stored, but I do know that there were some other things in the factory partition beyond the radio EEPROMs and the MAC addresses. Not only that, but there were also partitions containing text identifiers and data about the particular unit (likely for warranty support), separate configuration information, the boot image flag, and other things.
Yes, if missing this causes the stock firmware when restored to show in a rather weird and unusual way: Neither as RT3200 nor as E8450, but as (never existent) "AX3200" with yet another theme and some non-working elements in the Web UI. It's good enough to re-flash OpenWrt on it, but not good enough to re-sell the device with stock firmware.
I don't think this would be easily possible, or even possible at all, as the size of the ubi
partition changes, which makes the old UBI content inaccessible when booting a kernel with the new layout. It's either or at this point in Linux, and there isn't any way to dynamically change MTD partitions at run-time afaik.
I think I have an idea on how it could be done, but I have concerns on whether the device has enough memory to do it or even whether or not it could be parsed without having to use custom patches to do so. Regardless, it would take a lot of work and likely be a high risk to the stability of the upgrade script given how many things could go wrong. Not only that, but there would be virtually no return on investment for it, since you could probably count on one hand the number of people that even notice, let alone actually make use of it.
All in all, I agree it's probably not something worth doing except by those masochistic few that want to try and perform the transition manually and figure out all of the quirks of the process along the way.
Hi @daniel
I has actually to 22.03 on m'y router
IS possible to flash directly to23.05.4 witouth broken brick thé router
Thanks for your réponse
See this post