easyddup a simple upgrade/downgrade utility

Post new topic   Reply to topic    DD-WRT Forum Index -> Contributions Upload
Goto page Previous  1, 2, 3, ... 19, 20, 21  Next
Author Message
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 1012

PostPosted: Sat Mar 06, 2021 5:42    Post subject: Reply with quote
yoyoma2 wrote:
What board variables exist?
Code:
nvram show | grep -i board

If there's no portable way for the script to automatically figure out the directory name for revisions for all vendors, how about a new board or revision argument eg:

easyddup.sh -b dlink-dir868l-revb

or

easyddup.sh -r revb

Still better than having to hack the script.

Code:

root@RB:~# nvram show | grep -i board
boardrev=0x1110
1:boardflags=0x30000000
size: 46449 bytes (19087 left)
pci/2/1/boardflags=0x30000000
boardtype=0x0646
pci/1/1/boardflags=0x80001200
pci/1/0/boardvendor=0x14E4
pci/1/1/boardvendor=0x14E4
boardflags2=0x00000000
pci/1/0/boardflags2=0x00100000
pci/1/1/boardflags2=0x00100000
0:boardvendor=0x14e4
pci/2/1/boardtype=0x621
1:boardvendor=0x14e4
0:boardflags=0x1000
boardflags=0x00000110
pci/2/1/boardvendor=0x14E4
0:boardflags2=0x100002
0:boardflags3=0x3
pci/2/1/boardnum=0
1:boardflags2=0x300002
1:boardflags3=0x0
DD_BOARD=Dlink-DIR868L
pci/2/1/boardrev=0x1450
pci/2/1/boardflags2=0x300002
pci/2/1/boardflags3=0x0
pci/1/0/boardflags=0x80001200
boardnum=24

I think -r is easier to type, but -b seems to be more powerful. Probably also need to warn the user because this can brick if there's typo.

_________________
▫ RSS feed for DD-WRT releases (2024): https://rsseverything.com/feed/7d36ab68-7733-46c3-bd8a-9c54c5cef08c.xml
easyddup - A simple upgrade/downgrade utility by yoyoma2 --- as featured in 📌 Reference Links, stickies retired back to forum (Moderator's Pick 🌟)
Sponsor
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 377

PostPosted: Sat Mar 06, 2021 19:17    Post subject: Reply with quote
Perhaps one of those board numbers identifies the the revision but nothing obvious. Does dd-wrt itself display the revision in Status Router or Sys-Info? If not, I'll add an argument.
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 377

PostPosted: Sat Mar 06, 2021 21:58    Post subject: Reply with quote
New version posted in OP.

Changes:

Add -r option as discussed. Example:

easyddup.sh -r reva

Tested as well as I could with a router that doesn't need a revision argument.

If you use an email notification script based on the sample checknewversion.sh you'll need to edit that script where it calls easyddup.sh to add the -r.

The warning you suggested is in the -h and in the Readme.txt.

Also added a check to fail if no files are found instead of asking the user to pick from an empty list. Confused
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 1012

PostPosted: Sun Mar 07, 2021 7:29    Post subject: Reply with quote
yoyoma2 wrote:
Perhaps one of those board numbers identifies the the revision but nothing obvious. Does dd-wrt itself display the revision in Status Router or Sys-Info? If not, I'll add an argument.

Status page doesn't show rev number
yoyoma2 wrote:
New version posted in OP.

Changes:

Add -r option as discussed. Example:

easyddup.sh -r reva

Tested as well as I could with a router that doesn't need a revision argument.

If you use an email notification script based on the sample checknewversion.sh you'll need to edit that script where it calls easyddup.sh to add the -r.

The warning you suggested is in the -h and in the Readme.txt.

Also added a check to fail if no files are found instead of asking the user to pick from an empty list. Confused

I've added this to the startup script to save my lazy a**
Quote:
echo "alias update='/opt/easyddup/easyddup.sh -r reva'" > /tmp/root/.profile

Everything are ok for me. Do you want to update the info in the first post?

actually I still hack the script a bit so that it can auto select the firmware file in the folder, disable erasing nvram, enable saving user settings, and burn FW without confirmation, just to save my lazy a**
It would be great to have all these options in a separate .ini file

_________________
▫ RSS feed for DD-WRT releases (2024): https://rsseverything.com/feed/7d36ab68-7733-46c3-bd8a-9c54c5cef08c.xml
easyddup - A simple upgrade/downgrade utility by yoyoma2 --- as featured in 📌 Reference Links, stickies retired back to forum (Moderator's Pick 🌟)
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 377

PostPosted: Sun Mar 07, 2021 18:07    Post subject: Reply with quote
Updated the initial post, thanks for the reminder and the feedback.

Good idea to create an update alias. Good suggestion to create an ini file to avoid questions that you always answer the same way.
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 377

PostPosted: Sun Mar 07, 2021 21:35    Post subject: Reply with quote
New version posted in OP (March 7th).

Changes:

First attempt at a config file to avoid some mundane questions. The comments and variable names in the new file easyddup.ini.sample should make it self explanatory.
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 1012

PostPosted: Mon Mar 08, 2021 3:08    Post subject: Reply with quote
Thanks for the update.
Do you have any plan in the future to add the option for cURL to split the download into multiple parts?
Somehow cURL download speed is only ~300kB/s while downloading from web browser is 2MB/s

_________________
▫ RSS feed for DD-WRT releases (2024): https://rsseverything.com/feed/7d36ab68-7733-46c3-bd8a-9c54c5cef08c.xml
easyddup - A simple upgrade/downgrade utility by yoyoma2 --- as featured in 📌 Reference Links, stickies retired back to forum (Moderator's Pick 🌟)
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 377

PostPosted: Mon Mar 08, 2021 6:08    Post subject: Reply with quote
What happens to the load average on dd-wrt during the download? Https/SSL does use some CPU. You could echo the curl command run by easyddup and paste it on a pc and see if it's any faster.

I have no plans for easyddup but tweaking a few lines as recently is ok. I mostly use local builds and easyddup is for official builds. I still use the email notification feature to know how far behind I'm falling.

If anyone wants to put it up on gitlab/github and improve it that would be great. Hopefully I could be a co-maintainer.
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 1012

PostPosted: Mon Mar 08, 2021 7:58    Post subject: Reply with quote
yoyoma2 wrote:
What happens to the load average on dd-wrt during the download? Https/SSL does use some CPU. You could echo the curl command run by easyddup and paste it on a pc and see if it's any faster.

Load average while downloading is 0.05
My USB drive is slow, maybe it also affects the download speed, but I don't know how to test USB speed with dd-wrt
On PC: Average Dload = 3747k
On DIR-868L Rev.A1: Average Dload = 230k

_________________
▫ RSS feed for DD-WRT releases (2024): https://rsseverything.com/feed/7d36ab68-7733-46c3-bd8a-9c54c5cef08c.xml
easyddup - A simple upgrade/downgrade utility by yoyoma2 --- as featured in 📌 Reference Links, stickies retired back to forum (Moderator's Pick 🌟)
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 377

PostPosted: Mon Mar 08, 2021 14:05    Post subject: Reply with quote
What if you run the same curl command manually from the router's /tmp directory so output.bin is on the fast ramdisk instead of the USB drive?

You could also install entware's version of curl to see if it's any faster than dd-wrt's curl.

There are certainly much more knowledgable curl experts on this forum who could chime in...
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 1012

PostPosted: Mon Mar 08, 2021 17:29    Post subject: Reply with quote
yoyoma2 wrote:
What if you run the same curl command manually from the router's /tmp directory so output.bin is on the fast ramdisk instead of the USB drive?

You could also install entware's version of curl to see if it's any faster than dd-wrt's curl.

There are certainly much more knowledgable curl experts on this forum who could chime in...


ddwrt curl with output.bin in /tmp directory doesn't have much difference in speed

entware curl with output.bin in /tmp directory also doesn't have much difference in speed

I found this script https://github.com/paramaggarwal/multipart but I have no knowledge to convert from bash to shell

_________________
▫ RSS feed for DD-WRT releases (2024): https://rsseverything.com/feed/7d36ab68-7733-46c3-bd8a-9c54c5cef08c.xml
easyddup - A simple upgrade/downgrade utility by yoyoma2 --- as featured in 📌 Reference Links, stickies retired back to forum (Moderator's Pick 🌟)
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 377

PostPosted: Tue Mar 09, 2021 0:02    Post subject: Reply with quote
New version posted in OP (March 8th).

Changes:

Stuck the multipart script you found into easyddup.sh. You must enable it with the new easyddup.ini keyword EDDUP_USE_MULTIPART and set it to the number of parts to use (script was hardcoded to 20). It seems faster to me.

Just to increase our confidence, without burning, try with and without multipart and run md5sum on both files to confirm it's the same.
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 1012

PostPosted: Tue Mar 09, 2021 1:14    Post subject: Reply with quote
yoyoma2 wrote:
New version posted in OP (March 8th).

Changes:

Stuck the multipart script you found into easyddup.sh. You must enable it with the new easyddup.ini keyword EDDUP_USE_MULTIPART and set it to the number of parts to use (script was hardcoded to 20). It seems faster to me.

Just to increase our confidence, without burning, try with and without multipart and run md5sum on both files to confirm it's the same.
Suggestions:
- because BS didn't include MD5 in his releases, it's better to have a very simple check on the file size after combining all parts (and also check the return code of each curl process?)
- add option to specify where to store the parts: I think it's (marginally?) faster to store the parts on RAM disk, then redirect the output file of the combine command to the fwcache folder. This may not be possible for devices with small amount of RAM, so it's up to you to consider if it's worth to implement.
- unfortunately the built-in progress bar of curl cannot be used any more, hopefully someone can come up with another way to display the progress (maybe checking the size of each part while the download is ongoing?)

_________________
▫ RSS feed for DD-WRT releases (2024): https://rsseverything.com/feed/7d36ab68-7733-46c3-bd8a-9c54c5cef08c.xml
easyddup - A simple upgrade/downgrade utility by yoyoma2 --- as featured in 📌 Reference Links, stickies retired back to forum (Moderator's Pick 🌟)
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 377

PostPosted: Tue Mar 09, 2021 15:26    Post subject: Reply with quote
New version posted in OP (March 9th).

Changes:

Added a file size check to the multipart stuff.

Notes:

The md5sum checks I made between multipart and regular downloads always match.

Since that multipart script stores temp files in the current directory, an alias such as this could do the trick.

alias update='cd /tmp ; /opt/easyddup/easyddup.sh -r reva ; cd -'

Is it fast with multipart now? Then the progress status doesn't matter as much. I can't do more than tweak a few lines.

What's the smallest number of parts that's still fast enough? I'll make that the default in the sample ini file.
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 1012

PostPosted: Tue Mar 09, 2021 17:27    Post subject: Reply with quote
yoyoma2 wrote:
Since that multipart script stores temp files in the current directory, an alias such as this could do the trick.

alias update='cd /tmp ; /opt/easyddup/easyddup.sh -r reva ; cd -'
with this alias I can't send additional params like update -f -n , and because it's already saved in the ramdisk, I'm happy without cd
yoyoma2 wrote:
Is it fast with multipart now? Then the progress status doesn't matter as much. I can't do more than tweak a few lines.
without multipart it takes more than 90sec to complete. with multipart it can finish as fast as within 30sec.
Do you mind if I suggest a way to clean up the duplicated nvram backup files? Laughing
yoyoma2 wrote:
What's the smallest number of parts that's still fast enough? I'll make that the default in the sample ini file.
for me i'm ok with 16. probably it depends on the FW size, CPU speed and internet connection speed.

EDIT: I measured the total time needed to execute the script (including checking for new version and backing up nvram). The time for downloading only is much shorter, about 10sec for 24.7MB
Do you need a GIF file showing your script in action for demo purpose? I think this script doesn't get as much attention as it deserves.

_________________
▫ RSS feed for DD-WRT releases (2024): https://rsseverything.com/feed/7d36ab68-7733-46c3-bd8a-9c54c5cef08c.xml
easyddup - A simple upgrade/downgrade utility by yoyoma2 --- as featured in 📌 Reference Links, stickies retired back to forum (Moderator's Pick 🌟)
Goto page Previous  1, 2, 3, ... 19, 20, 21  Next Display posts from previous:    Page 2 of 21
Post new topic   Reply to topic    DD-WRT Forum Index -> Contributions Upload 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