Back to Stock Factory Firmware Linksys E4200 V2? OpenWrt FW to Linksys FW

omg... yeah that was it. did this

root@OpenWrt:/tmp/sysupgrade-linksys-viper# dd if=/tmp/FW_E4200v2_2.1.41.164606.
img of=kernel bs=1 count=2692560
2692560+0 records in
2692560+0 records out

Good. You can now continue with @mk24 procedure.

ok, finally got it done and made. sadly... everything failed. tried the GUI in the browser, gave the same error as before. then did the normal non-force through putty, same with that. did the forced install, same as the rest with breathing light lol. really did have my hopes up on that attempt lol.

@Hegabo thanks for helping me with that also.

1 Like

Please use "Preformatted text </>" for logs, scripts, configs and general console output.
grafik

Please edit your postings accordingly.

1 Like

If you want to try do dd on the mtd anyway, I've dumped my Linksys partitions "kernel" and "rootfs" reset to default factory settings: (But since it doesn't work because my version has bad mapping, I've removed the link).

Make sure that you dd it on the inactive partition. If you are running on Partition 1, then kernel/rootfs should go on mtd5/mtd6. If you are running on Partition 2 then it should go on mtd3/mdt4.

After using SCP to put kernel.bin and rootfs.bin on /tmp of the working OpenWrt partition, blast the adequate mtd partitions:

dd if=/tmp/kernel.bin of=/dev/mtdXX
dd if=/tmp/rootfs.bin of=/dev/mtdYY

Replace XX (kernel) and YY (rootfs) with the partitions that you've determined as being inactive for your case.

However, I must admit that my dumps look the same as the result from the work of mk24.

ok, so since i'm ON/Using partition 1(As it states in the " Advanced Reboot"), Partition 2 is the inactive one I've been trying this on.
so, would this be correct for my case? also after entering this, what do i do after if it does anything? just being sure as this one to me feels iffy for some reason and i don't want to mess up both partitions as i'd have to figure that out lol.

dd if=/tmp/kernel.bin of=/dev/mtd3
dd if=/tmp/rootfs.bin of=/dev/mtd4

If partition 1 is active, that means it is currently running from mtd3/mtd4. You need to blast mtd5/mtd6 not the ones you've mentionned. So that should be:

dd if=/tmp/kernel.bin of=/dev/mtd5
dd if=/tmp/rootfs.bin of=/dev/mtd6

Keep in mind that this is my understanding of the thing as I've never did that before.

If all goes well, you should use the "Advanced Reboot" to reboot onto the other partition.

well, tried it and this is what i got lol.

root@OpenWrt:~# dd if=/tmp/kernel.bin of=/dev/mtd5
dd: writing '/dev/mtd5': No space left on device
5377+0 records in
5376+0 records out

soooo.... yeah. not sure if i should even try the other one though either if that one comes up. or should i just copy over one at a time and run the command since the space is so limited?

Something seems wrong here as @DjiPi kernel.bin file is 27 MB in size. The kernel partition is only about 2.5 MB.

I'm running on LEDE Reboot 17.01.1, maybe that release had a bad partition mapping?

root@LEDE-E4200:/tmp# dd if=/dev/mtd5 of=kernel.bin
53248+0 records in
53248+0 records out
root@LEDE-E4200:/tmp# ls -la
drwxrwxrwt   16 root     root           460 Aug 24 21:48 .
drwxr-xr-x    1 root     root           480 Jan  1  1970 ..
(...)
-rw-r--r--    1 root     root      27262976 Aug 24 21:48 kernel.bin
(...)
drwxr-xr-x    2 root     root            40 Aug 24 21:45 tmp
root@LEDE-E4200:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00020000 "u-boot"
mtd1: 00020000 00020000 "u_env"
mtd2: 00020000 00020000 "s_env"
mtd3: 01a00000 00020000 "kernel1"
mtd4: 01760000 00020000 "ubi"
mtd5: 01a00000 00020000 "kernel2"
mtd6: 01760000 00020000 "rootfs2"
mtd7: 04a00000 00020000 "syscfg"

Overlap confirmed

Thu Aug 24 21:45:48 2017 kern.notice kernel: [    0.889479] Creating 8 MTD partitions on "orion_nand":
Thu Aug 24 21:45:48 2017 kern.notice kernel: [    0.894647] 0x000000000000-0x000000080000 : "u-boot"
Thu Aug 24 21:45:48 2017 kern.notice kernel: [    0.901330] 0x000000080000-0x0000000a0000 : "u_env"
Thu Aug 24 21:45:48 2017 kern.notice kernel: [    0.907315] 0x0000000a0000-0x0000000c0000 : "s_env"
Thu Aug 24 21:45:48 2017 kern.notice kernel: [    0.913312] 0x000000200000-0x000001c00000 : "kernel1"
Thu Aug 24 21:45:48 2017 kern.notice kernel: [    0.919524] 0x0000004a0000-0x000001c00000 : "ubi"
Thu Aug 24 21:45:48 2017 kern.notice kernel: [    0.925354] 0x000001c00000-0x000003600000 : "kernel2"
Thu Aug 24 21:45:48 2017 kern.notice kernel: [    0.931591] 0x000001ea0000-0x000003600000 : "rootfs2"
Thu Aug 24 21:45:48 2017 kern.notice kernel: [    0.937771] 0x000003600000-0x000008000000 : "syscfg"

Yes it looks like the kernel partition overlaps the rootfs. Which is how the file turned out as well. (the kernel.bin contains kernel + rootfs) The kernel should work if you use only the first part, which is what likely happens anyway if you write until the partition is full then have it choke.

It is up to you to continue with the mtd6. Since my device is running on overlapped partitions, on an older LEDE release, that’s why the kernel partition got messed up, but yours has cut the bad part of it by running out of space on mtd5, which is a good thing.

The rootfs dd is an experimentation that you could go on with, or not if you find that too risky.

yeah i went ahead and tried it anyways. but sadly, no difference.

Let me get back to you when I'll be properly installed on OpenWrt.

well, make sure you load up the linksys firmware and do it from there or you'll be stuck with me lmao.

That's what I'm doing since my firsts tryouts. Always flashed from that Linksys firmware to have a backup solution.

yeah, i just didn't know it'd change the other partition for the openwrt update process and that's what screwed me lmao. also didn't know this trying to get back to stock factory was a huge issue and never i guess... encountered yet... but i guess in a way... good thing it happened. already finding things out that need to be changed or attended too.

A good thing here is that a community wanted to help out with suggestions and that is nice to see, I even learned to create the sysupgrade-tar nice. I'd thought you went back to stock by now, but at least the router still is functional after all said and done. regards onefreeman

You probably should get yourself a good serial to usb adapter, open the thing and tap the serial port in order to see why it's failing when booting up the Linksys partition. My guess is that it fails checksum.

You can probably get away without soldering if you find a way to do it.

Yes, it is possible to connect to it via serial without huge effort. I had to do it once to unbrick mine. There's a few details here but as far as I remember it was no problem.

http://www.wolfteck.com/2014/03/01/candyhouse-serial/