MTD to flash stock via SSH?

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.)
Goto page 1, 2  Next
Author Message
Pumpino
DD-WRT Novice


Joined: 02 Jan 2019
Posts: 18

PostPosted: Thu Mar 26, 2020 10:58    Post subject: MTD to flash stock via SSH? Reply with quote
Partition 2 of my WRT1200AC has a very old (7th January 2018) dd-wrt build on it. It boots fine.

I've tried to flash both stock and various versions of dd-wrt to partition 1 whilst booted into partition 2.

Partition 1 on my WRT1200AC refuses to boot after restarting. It won't respond to pings.

I'd like to flash stock so that I can return to using OpenWrt on both partitions.

Since I'm unable to flash anything via the web UI, I'll need to do it via ssh.

Am I correct in thinking that I should use the MTD command?

In OpenWrt, I believe the syntax would be:
mtd -e kernel1 -r write FW_WRT1200AC_1.0.5.187766_prod.img kernel1

However, ls -l /dev/mtd* reveals an overwhelming array of partitions, so I'm not sure what would replace "kernel1" in the above syntax.

Any ideas?
Sponsor
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 908

PostPosted: Thu Mar 26, 2020 11:14    Post subject: Reply with quote
Have you considered upgrading DD-WRT and then flashing Linksys firmware from GUI?

I hesitate to tell you this, but linux and linux2 are partition 1 and 2. Don't brick your router.
Pumpino
DD-WRT Novice


Joined: 02 Jan 2019
Posts: 18

PostPosted: Thu Mar 26, 2020 11:48    Post subject: Reply with quote
blkt wrote:
Have you considered upgrading DD-WRT and then flashing Linksys firmware from GUI?


How? When I flash stock or a newer build of dd-wrt from partition 2, partition 1 won't boot. Basically, I can't use anything but the existing build of dd-wrt on partition 2.
Toombstone
DD-WRT Novice


Joined: 02 Feb 2020
Posts: 17

PostPosted: Thu Mar 26, 2020 14:43    Post subject: Reply with quote
Upgrade the DDWRT on you partition that boots and then try flashing Stock firmware ?
Pumpino
DD-WRT Novice


Joined: 02 Jan 2019
Posts: 18

PostPosted: Thu Mar 26, 2020 19:56    Post subject: Reply with quote
Toombstone wrote:
Upgrade the DDWRT on you partition that boots and then try flashing Stock firmware ?


How?! Flashing a new build of dd-wrt from partition 2 flashes it to partition 1. Partition 1 won't boot no matter what I flash to it - stock, or any build of dd-wrt.

Another question to someone - how can I get the stock firmware to /tmp? FTP doesn't allow the root user to login, and other users can't access /tmp. I can't use wget, as there's no internet access from within dd-wrt like there is with OpenWrt.

Alternatively, could I run mtd -e linux (or is it linux1?)just to erase partition 1, and that might allow me to flash stock to it via the GUI in dd-wrt on partition 2?
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 4493
Location: Texas, USA

PostPosted: Thu Mar 26, 2020 20:16    Post subject: Reply with quote
Did. You. Read. The. Sticky. On. Installation.
_________________
"Are you leaving anything out of the picture, or is your post complete with all information required for us to help you? If it is not complete, fix it now."
---------------------------------------------------------
E4200 v1 DD-WRT 42819 mega K3.x
R7000P DD-WRT 40270M kongac
R7800 DD-WRT 42819 std
E4200 v1 FreshTomato 2020.2
E4200 v1 FreshTomato 2020.3.development
R7000 FreshTomato 2020.3.development
E4200 v1 1.0.07.development
WRT3200ACM OpenWRT 18.06.8
---------------------------------------------------------
Linux User #377467 counter.li.org / linuxcounter.net
Pumpino
DD-WRT Novice


Joined: 02 Jan 2019
Posts: 18

PostPosted: Thu Mar 26, 2020 20:24    Post subject: Reply with quote
kernel-panic69 wrote:
Did. You. Read. The. Sticky. On. Installation.


Yes. It would be helpful if you were specific about which section I've apparently glossed over.

If it's about how to switch partitions, yes, I have done that via SSH. As soon as I direct it to boot partition 1, it fails and I have to power cycle it three times in order to boot from partition 2.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 4493
Location: Texas, USA

PostPosted: Thu Mar 26, 2020 21:05    Post subject: Reply with quote
You can force it to flash to the "good" partition to upgrade. Your only other option is serial recovery and flashing both partitions back to stock firmware.
_________________
"Are you leaving anything out of the picture, or is your post complete with all information required for us to help you? If it is not complete, fix it now."
---------------------------------------------------------
E4200 v1 DD-WRT 42819 mega K3.x
R7000P DD-WRT 40270M kongac
R7800 DD-WRT 42819 std
E4200 v1 FreshTomato 2020.2
E4200 v1 FreshTomato 2020.3.development
R7000 FreshTomato 2020.3.development
E4200 v1 1.0.07.development
WRT3200ACM OpenWRT 18.06.8
---------------------------------------------------------
Linux User #377467 counter.li.org / linuxcounter.net
Pumpino
DD-WRT Novice


Joined: 02 Jan 2019
Posts: 18

PostPosted: Thu Mar 26, 2020 21:06    Post subject: Reply with quote
kernel-panic69 wrote:
You can force it to flash to the "good" partition to upgrade.


How?

When I flash it from the GUI, it doesn't report that the flash is unsuccessful. It simply doesn't boot to it when I manually restart it after the flash.
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 908

PostPosted: Thu Mar 26, 2020 23:55    Post subject: Reply with quote
You have WRT1200AC V1, right?

cd /tmp

wget http://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2020/03-25-2020-r42803/linksys-wrt1200ac/ddwrt-linksys-wrt1200ac-webflash.bin

write ddwrt-linksys-wrt1200ac-webflash.bin linux

ubootenv set boot_part 1

reboot


Last edited by blkt on Fri Mar 27, 2020 0:01; edited 2 times in total
Pumpino
DD-WRT Novice


Joined: 02 Jan 2019
Posts: 18

PostPosted: Thu Mar 26, 2020 23:57    Post subject: Reply with quote
blkt wrote:
You have WRT1200AC V1, right?

cd /tmp

wget http://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2020/03-25-2020-r42803/linksys-wrt1200ac/ddwrt-linksys-wrt1200ac-webflash.bin

write ddwrt-linksys-wrt1200ac-webflash.bin linux

ubootenv set boot_part 1

reboot


Yes, I have v1.

Like I said, I have no internet connection from within ssh, despite it being configured correctly. I'm not sure if that's typical of dd-wrt to not have internet access from within ssh.
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 908

PostPosted: Fri Mar 27, 2020 0:02    Post subject: Reply with quote
Do NOT manually restart after a GUI flash, it does that for you automatically.

Consider a hardware reset and reconfigure your settings, while powered on hold the red reset button for 10 seconds.
Pumpino
DD-WRT Novice


Joined: 02 Jan 2019
Posts: 18

PostPosted: Fri Mar 27, 2020 0:06    Post subject: Reply with quote
blkt wrote:
Do NOT manually restart after a GUI flash, it does that for you automatically.

Consider a hard reset and reconfigure your settings, while powered on hold the red reset button for 10 seconds.


I left it 20 minutes last night and it didn't restart after the flash was completed. I checked via ssh and the uptime was the same.

I've tried resetting. The reset button doesn't work after powering on with partition 1 set, and resetting partition 2 simply resets partition 2 to factory defaults.

Are you saying that I should have internet access from within ssh if it's configured correctly?
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 908

PostPosted: Fri Mar 27, 2020 0:09    Post subject: Reply with quote
Both partitions share the same nvram space for configuration.

If you can access the web on your computer, you should also be able to use wget.
Pumpino
DD-WRT Novice


Joined: 02 Jan 2019
Posts: 18

PostPosted: Fri Mar 27, 2020 0:12    Post subject: Reply with quote
blkt wrote:
Both partitions share the same nvram space for configuration.

If you can access the web on your computer, you should also be able to use wget.


OK, so I've reset partition 2 many times, so that should have reset partition 1. Partition 1 must have had a bad flash.

I'll have another go at configuring the internet. I use it as a NAS rather than a router, so I disabled DHCP, set a static IP in the same subnet, and set the gateway to 192.168.1.254, which is the IP of my 5G router.
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.) All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum