[SOLVED] upgrade firmware from cli

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page Previous  1, 2
Author Message
strange
DD-WRT User


Joined: 18 Jun 2006
Posts: 229

PostPosted: Tue Aug 16, 2022 1:50    Post subject: Reply with quote
Thank you @the-joker, good info. Just please don't test me on it in the future. Laughing
_________________
Netgear XR500 - Gateway
R6700 v3 - Station Bridge
Sponsor
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6435
Location: UK, London, just across the river..

PostPosted: Tue Aug 16, 2022 7:15    Post subject: Reply with quote
strange wrote:
Thank you @the-joker, good info. Just please don't test me on it in the future. Laughing


At the end the GUI flash(WEB flash) stops some running processes in order to flash, shut down and reboot nicely, where with CLI update you don't have this chance...so GUI flash is one idea safer/better...but must be done over RJ-45...(LAN port) to be 101% safe... Cool
I do the CLI flash and sometimes suffer from, not enough memory to flash...as my 1043v2 is getting old and overwhelmed...same for 4MB flash devices with low ram of 32MB CLI flash is a challenge...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55779 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue Aug 16, 2022 9:41    Post subject: Reply with quote
@alozaros, if you enable console_debug=1 and flash via CLI you will see that some processes are terminated before the flash starts via CLI. This was improved to not show anything the system doesn't have, but it went something like this a dozen or more builds ago on all routers.

Code:
# cd /tmp && write a.trx linux
umount -r -f /jffs
/sbin/service snmp stop
/sbin/service pppoeserver stop
/sbin/service olsrd stop
/sbin/service upnp stop
/sbin/service freeradius stop
/sbin/service transmission stop
/sbin/service plex stop


But it didn't matter if you had those running or not or even if they existed on your system, as stated this was improved to only show what system has, but the behavior is the same, processes are stopped running or not at flash time no matter CLI or not.

On an unrelated note build 08-15-2022-r49741 the service and process handlers were refactored (a fancy word for re-written) dnsmasq and others aren't constantly restarted instead they force reload any configurations that may have changed this improved the boot performance and the log noise is much reduced.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5695

PostPosted: Tue Aug 16, 2022 13:15    Post subject: Reply with quote
Alozaros wrote:
there is a small detail to write command.....& at the end

write dd-wrt-webupgrade.bin linux &
It is basic linux knowledge everyone can see a linux commands manual background jobs bg, and fg process management.
I do a understand concern but stopped counting after 200 flashes EA8500 wireless command-line flash method without &.
Router models with unstable wireless configs there is always LAN Ethernet. Maybe later, try to keep CLI Flash line simple.
bushant wrote:
Depending whether your hardware has curl you can make it even easier.

Code:
cd /tmp
curl -o firmware.bin https://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2022/08-13-2022-r49681/netgear-r8500/netgear-r8500-webflash.bin


Go fix a sandwich while your router upgrades.
Yes exactly this is the way to specify output file, lowercase o. I should have mentioned this. curl -o firmware.bin {file URL}
strange wrote:
I have done this a couple of times already on both of my routers and everything has worked fine. What is the importance of adding the & after 'write'? Also, what about the 5 minute wait? It is not part of the WIKI.
See Installation#Method_3:_Flashing_with_Command_Line or CLI Flash line, but it seems many overlook embedded links.
strange wrote:
And then there is the '-O '. Does it matter if it goes before or after the web address? I've seen it both ways.
https://curl.se/docs/manual.html
https://curl.se/docs/manpage.html#-o
https://curl.se/docs/manpage.html#-O
https://everything.curl.dev/usingcurl/downloads
https://everything.curl.dev/usingcurl/downloads/storing
https://everything.curl.dev/usingcurl/downloads/url-named
https://everything.curl.dev/usingcurl/downloads/content-disp
fox95 wrote:
I just did a upgrade with wget ftp to the /tmp folder and didnt use the -O and everything seems to be fine.
This is how wget works when not specifying an output file, also keep in mind wget is different than curl so see the manual.
wget uses -O (not -o lowercase outputs error log) to specify output filename but very important to download one file only!
fox95 wrote:
Note: the https:// download link will not work with wget
Yes I tried to warn you to use http without s, command line flash wiki covers this & build thread CLI Flash plus (http only).
fox95 wrote:
This is the link to the ftp files:

http://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2022/08-03-2022-r49626/
ftp instead of download1 for http is pointless and confusing thanks (BEST LINK TO USE) claim, a 4th link arbitrarily added.
Downloads: HTTPS, FTP as well as http variant are correct download links listed in every build thread also downloads wiki.
strange
DD-WRT User


Joined: 18 Jun 2006
Posts: 229

PostPosted: Tue Aug 16, 2022 15:12    Post subject: Reply with quote
Thank you to all of the gurus helping out here and the links to the pages that you provided. I now know the difference between -o and -O and the proper syntax for there use. I am a cookbook linux user, sometimes I bake a cake without knowing why all of the ingredients are mixed together in a certain way. I just do the copy and paste thing. @blkt says, do this, this and this. I do this, this and this...vola! Cake! Without actually knowing what I did. Laughing
_________________
Netgear XR500 - Gateway
R6700 v3 - Station Bridge
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue Aug 16, 2022 19:56    Post subject: Reply with quote
/me sighs and rolls eyes.

As long as you don't try to feed me THAT proverbial cake! Wink

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 372

PostPosted: Wed Aug 17, 2022 15:16    Post subject: Reply with quote
Surprised none of the experts suggested the nohup command. People could just use easyddup and these endless supply of threads about where, what, how to download and where, how to install would be moot.
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Wed Aug 17, 2022 15:57    Post subject: Reply with quote
And no matter how many threads there are about a particular subject, there will be just one more and another and..., easyddup or no, so there are several ways to flash via CLI, even without CLI/Web Interface.

easyddup is a good alternative but not for the novice users, who already afraid of opening a terminal or have no clue what they are typing into it, so imagine how these people must feel when they download easyddup and extract half a dozen scripts.

There are many ways in any case to run a script/command after terminal closes, I mentioned screen, and in addition to nohup and the & there are several others.

Long live the intrawebs.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
strange
DD-WRT User


Joined: 18 Jun 2006
Posts: 229

PostPosted: Wed Aug 17, 2022 17:04    Post subject: Reply with quote
I'm still going through the 15 pages of info before I ask any questions about easyddup. It does look intriguing though.
_________________
Netgear XR500 - Gateway
R6700 v3 - Station Bridge
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1929

PostPosted: Wed Aug 17, 2022 17:35    Post subject: Reply with quote
yoyoma2 wrote:
Surprised none of the experts suggested the nohup command. People could just use easyddup and these endless supply of threads about where, what, how to download and where, how to install would be moot.

If we were at a point where firmware upgrades were trivial enough to not result in any bricks, implementing a similar function into the webUI to seamlessly provide this functionality (automatic upgrade) would be a good addition. The problem is that it doesn't fit all scenarios, e.g. EA6900 with Asus (XWRT-Vortex) CFE. There would have to be other things fixed first so that the upgrade process doesn't arbitrarily try to write to a partition that does not exist (linux2). Ideally, the ultimate solution would be to have a modified stock CFE that re-maps the flash so the 32k nvram bug is squashed after initial flash of DD-WRT -OR- the upgrade process would have to automatically double-flash a virgin EA-series device so both partitions are flashed, apparently.

In regards to your nohup comment, this or something similar must be what you're suggesting:
Code:
write -nohup netgear-r8500-webflash.bin linux

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions 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 can attach files in this forum
You can download files in this forum