easyddup a simple upgrade/downgrade utility

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


Joined: 19 Aug 2011
Posts: 967

PostPosted: Sat Aug 28, 2021 16:17    Post subject: Reply with quote
slycordinator wrote:
In easyburn.sh, when the -n argument is passed, it sets the noburn variable to 1.

On lines 401-402, BURNIT gets set to yes whenever noburn equals 1.

the actual burning command is at line 458
here is my output when running with -n -f:
Code:
root@RB:~# update -n -f
Burn of firmware will not be done.

All dd-wrt upgrade builds available online for 2021

1)      08-25-2021-r47256 c      <--- current

Current build: 47256
Select a build to install (or Q): 1
********************************************************
***** WARNING: BUILD SELECTED IS ALREADY INSTALLED *****
********************************************************
Selected 08-25-2021-r47256

Files in build 08-25-2021-r47256 for Dlink-DIR868L reva

1)      dir868a-webflash.bin c  <--- auto selected
2)      factory-to-ddwrt.bin

Selected dir868a-webflash.bin
Build not in local cache or -f option, downloading...
Downloading https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/08-25-2021-r47256/dlink-dir868l-reva/dir868a-webflash.bin ...

Downloading in 8 parts: 25407488 / 25407488 bytes @ 1378 kb/s (100%)
Joining 8 parts: 8
Downloaded file OK.

WARNING THIS COULD BRICK YOUR ROUTER!!!

File to burn: /opt/easyddup/fwcache/08-25-2021-r47256/dlink-dir868l-reva/dir868a-webflash.bin
Processing callback write_report()
Callback write_report() completed.
Burning /opt/easyddup/fwcache/08-25-2021-r47256/dlink-dir868l-reva/dir868a-webflash.bin
WARNING: DO NOT INTERRUPT...
WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Skipping firmware burn.
Skipping reboot.
root@RB:~#

perhaps yoyoma2 can explain to you the flow of the script.

p/s: it's easyddup, not easyburn. some guy is going to have a good laugh.

_________________
▫ 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
slycordinator
DD-WRT Novice


Joined: 22 Aug 2020
Posts: 15

PostPosted: Sat Aug 28, 2021 16:54    Post subject: Reply with quote
Code:
root@DD-WRT:/tmp/whatever/easyddup# ./easyddup.sh -n -f
Burn of firmware will not be done.

All dd-wrt upgrade builds available online for 2021

1)      08-25-2021-r47256        <--- current

Current build: 47256
Select a build to install (or Q): 1
********************************************************
***** WARNING: BUILD SELECTED IS ALREADY INSTALLED *****
********************************************************
Selected 08-25-2021-r47256

Files in build 08-25-2021-r47256 for TP-Link ARCHER-C7 v2

1)      www.dd-wrt.com

Select a firmware file to install (or Q): 1
Selected www.dd-wrt.com
Build not in local cache or -f option, downloading...
Downloading https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/08-25-2021-r47256/tp-link-archer-c7-v2/http://www.dd-wrt.com ...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   415  100   415    0     0    320      0  0:00:01  0:00:01 --:--:--   320
Downloaded file OK.

WARNING THIS COULD BRICK YOUR ROUTER!!!

File to burn: ./fwcache/08-25-2021-r47256/tp-link-archer-c7-v2/www.dd-wrt.com
Erase nvram y/n ? n
Save user settings restore point y/n ? n
./easyddup.sh: line 452: tee: not found
WARNING: DO NOT INTERRUPT...
WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Skipping firmware burn.
Skipping reboot.


I think tee is included in larger builds and/or entware.
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 967

PostPosted: Sat Aug 28, 2021 17:00    Post subject: Reply with quote
slycordinator wrote:
Code:
root@DD-WRT:/tmp/whatever/easyddup# ./easyddup.sh -n -f
Burn of firmware will not be done.

All dd-wrt upgrade builds available online for 2021

1)      08-25-2021-r47256        <--- current

Current build: 47256
Select a build to install (or Q): 1
********************************************************
***** WARNING: BUILD SELECTED IS ALREADY INSTALLED *****
********************************************************
Selected 08-25-2021-r47256

Files in build 08-25-2021-r47256 for TP-Link ARCHER-C7 v2

1)      www.dd-wrt.com

Select a firmware file to install (or Q): 1
Selected www.dd-wrt.com
Build not in local cache or -f option, downloading...
Downloading https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/08-25-2021-r47256/tp-link-archer-c7-v2/http://www.dd-wrt.com ...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   415  100   415    0     0    320      0  0:00:01  0:00:01 --:--:--   320
Downloaded file OK.

WARNING THIS COULD BRICK YOUR ROUTER!!!

File to burn: ./fwcache/08-25-2021-r47256/tp-link-archer-c7-v2/www.dd-wrt.com
Erase nvram y/n ? n
Save user settings restore point y/n ? n
./easyddup.sh: line 452: tee: not found
WARNING: DO NOT INTERRUPT...
WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Skipping firmware burn.
Skipping reboot.

in easyddup.ini please set
EDDUP_HARDWARE_FOLDER="tplink_archer-c7-v2"
EDDUP_EXPECTED_FW_SIZE_MIN=14000000
EDDUP_EXPECTED_FW_SIZE_MAX=28000000
and try again

the fw sizes above may need further adjustment, but those values are good enough for now

_________________
▫ 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 🌟)
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 967

PostPosted: Sat Aug 28, 2021 17:07    Post subject: Reply with quote
slycordinator wrote:
I think tee is included in larger builds and/or entware.
as a quick fix you can safely remove those tee commands from easyddup.sh, they're for logging purpose.
_________________
▫ 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: 373

PostPosted: Sat Aug 28, 2021 23:18    Post subject: Reply with quote
slycordinator wrote:
In easyburn.sh, when the -n argument is passed, it sets the noburn variable to 1.

On lines 401-402, BURNIT gets set to yes whenever noburn equals 1.
The BURNIT variable just makes the utility go through the motions of burning and noburn skips the lowlevel firmware writing and the reboot. So with the -n option, YES we want to go through the motions but we don't want to actually burn. Those features were written at different times so granted less confusing variable names could have been chosen.

Does your build have which? (try "which which") I was thinking of using 'which tee' to see if tee is available.
slycordinator
DD-WRT Novice


Joined: 22 Aug 2020
Posts: 15

PostPosted: Sun Aug 29, 2021 0:07    Post subject: Reply with quote
type is generally preferable to which for scripts, as type is a builtin.
slycordinator
DD-WRT Novice


Joined: 22 Aug 2020
Posts: 15

PostPosted: Sun Aug 29, 2021 0:28    Post subject: Reply with quote
IONK wrote:
in easyddup.ini please set
EDDUP_HARDWARE_FOLDER="tplink_archer-c7-v2"
EDDUP_EXPECTED_FW_SIZE_MIN=14000000
EDDUP_EXPECTED_FW_SIZE_MAX=28000000
and try again

the fw sizes above may need further adjustment, but those values are good enough for now


Code:
root@DD-WRT:/tmp/easyddup# ./easyddup.sh -n -f
Burn of firmware will not be done.

All dd-wrt upgrade builds available online for 2021

1)      08-25-2021-r47256 c      <--- current

Current build: 47256
Select a build to install (or Q): 1
********************************************************
***** WARNING: BUILD SELECTED IS ALREADY INSTALLED *****
********************************************************
Selected 08-25-2021-r47256

Files in build 08-25-2021-r47256 for TP-Link ARCHER-C7 v2

1)      factory-to-ddwrt-IL.bin
2)      factory-to-ddwrt-US.bin
3)      factory-to-ddwrt.bin
4)      tplink_archer-c7-v2-IL.bin
5)      tplink_archer-c7-v2-US.bin c
6)      tplink_archer-c7-v2.bin

Select a firmware file to install (or Q): 5
Selected tplink_archer-c7-v2-US.bin
Build not in local cache or -f option, downloading...
Downloading https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/08-25-2021-r47256/tplink_archer-c7-v2/tplink_archer-c7-v2-US.bin ...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15.6M  100 15.6M    0     0  1490k      0  0:00:10  0:00:10 --:--:-- 2008k
Downloaded file OK.

WARNING THIS COULD BRICK YOUR ROUTER!!!

File to burn: ./fwcache/08-25-2021-r47256/tplink_archer-c7-v2/tplink_archer-c7-v2-US.bin
Erase nvram y/n ? n
Save user settings restore point y/n ? n
./easyddup.sh: line 452: tee: not found
WARNING: DO NOT INTERRUPT...
WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Skipping firmware burn.
Skipping reboot.
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 967

PostPosted: Sun Aug 29, 2021 1:31    Post subject: Reply with quote
slycordinator wrote:
IONK wrote:
in easyddup.ini please set
EDDUP_HARDWARE_FOLDER="tplink_archer-c7-v2"
EDDUP_EXPECTED_FW_SIZE_MIN=14000000
EDDUP_EXPECTED_FW_SIZE_MAX=28000000
and try again

the fw sizes above may need further adjustment, but those values are good enough for now


Code:
root@DD-WRT:/tmp/easyddup# ./easyddup.sh -n -f
Burn of firmware will not be done.

All dd-wrt upgrade builds available online for 2021

1)      08-25-2021-r47256 c      <--- current

Current build: 47256
Select a build to install (or Q): 1
********************************************************
***** WARNING: BUILD SELECTED IS ALREADY INSTALLED *****
********************************************************
Selected 08-25-2021-r47256

Files in build 08-25-2021-r47256 for TP-Link ARCHER-C7 v2

1)      factory-to-ddwrt-IL.bin
2)      factory-to-ddwrt-US.bin
3)      factory-to-ddwrt.bin
4)      tplink_archer-c7-v2-IL.bin
5)      tplink_archer-c7-v2-US.bin c
6)      tplink_archer-c7-v2.bin

Select a firmware file to install (or Q): 5
Selected tplink_archer-c7-v2-US.bin
Build not in local cache or -f option, downloading...
Downloading https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/08-25-2021-r47256/tplink_archer-c7-v2/tplink_archer-c7-v2-US.bin ...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15.6M  100 15.6M    0     0  1490k      0  0:00:10  0:00:10 --:--:-- 2008k
Downloaded file OK.

WARNING THIS COULD BRICK YOUR ROUTER!!!

File to burn: ./fwcache/08-25-2021-r47256/tplink_archer-c7-v2/tplink_archer-c7-v2-US.bin
Erase nvram y/n ? n
Save user settings restore point y/n ? n
./easyddup.sh: line 452: tee: not found
WARNING: DO NOT INTERRUPT...
WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Skipping firmware burn.
Skipping reboot.
  • do you have EDDUP_AUTO_SELECT_FILE='tplink_archer-c7-v2-US.bin' in your easyddup.ini? I see that you still need to manually select the fw file.
  • your fw download speed is already fast, but you can try EDDUP_USE_MULTIPART=8 to see if it can be even faster.

slycordinator wrote:
type is generally preferable to which for scripts, as type is a builtin.
  • what's the output of "type tee"?
  • Entware has coreutils-tee.

_________________
▫ 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 🌟)
slycordinator
DD-WRT Novice


Joined: 22 Aug 2020
Posts: 15

PostPosted: Sun Aug 29, 2021 1:50    Post subject: Reply with quote
IONK wrote:
  • do you have EDDUP_AUTO_SELECT_FILE='tplink_archer-c7-v2-US.bin' in your easyddup.ini? I see that you still need to manually select the fw file.
  • your fw download speed is already fast, but you can try EDDUP_USE_MULTIPART=8 to see if it can be even faster.

In your reply you wrote that it should be EDDUP_HARDWARE_FOLDER, which apparently is a typo.


IONK wrote:
  • what's the output of "type tee"?
  • Entware has coreutils-tee.
On my router:
Code:
root@DD-WRT:~# type tee
tee: not found


In debian:
$ type tee
tee is /usr/bin/tee

But for just checking for its existence, you can do something like:
if type tee >/dev/null 2>&1; then (stuff); fi
or put it in a function istelf
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 967

PostPosted: Sun Aug 29, 2021 1:52    Post subject: Reply with quote
slycordinator wrote:
IONK wrote:
  • do you have EDDUP_AUTO_SELECT_FILE='tplink_archer-c7-v2-US.bin' in your easyddup.ini? I see that you still need to manually select the fw file.
  • your fw download speed is already fast, but you can try EDDUP_USE_MULTIPART=8 to see if it can be even faster.

In your reply you wrote that it should be EDDUP_HARDWARE_FOLDER, which apparently is a typo.
you need both lines for auto-select to fully work on your router:
EDDUP_AUTO_SELECT_FILE='tplink_archer-c7-v2-US.bin'
EDDUP_HARDWARE_FOLDER="tplink_archer-c7-v2"

_________________
▫ 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 🌟)
slycordinator
DD-WRT Novice


Joined: 22 Aug 2020
Posts: 15

PostPosted: Sun Aug 29, 2021 2:04    Post subject: Reply with quote
Code:
root@DD-WRT:/tmp/easyddup# ./easyddup.sh -n -f
Burn of firmware will not be done.

All dd-wrt upgrade builds available online for 2021

1)      08-25-2021-r47256 c      <--- current

Current build: 47256
Select a build to install (or Q): 1
********************************************************
***** WARNING: BUILD SELECTED IS ALREADY INSTALLED *****
********************************************************
Selected 08-25-2021-r47256

Files in build 08-25-2021-r47256 for TP-Link ARCHER-C7 v2

1)      factory-to-ddwrt-IL.bin
2)      factory-to-ddwrt-US.bin
3)      factory-to-ddwrt.bin
4)      tplink_archer-c7-v2-IL.bin
5)      tplink_archer-c7-v2-US.bin c  <--- auto selected
6)      tplink_archer-c7-v2.bin

Selected tplink_archer-c7-v2-US.bin
Build not in local cache or -f option, downloading...
Downloading https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/08-25-2021-r47256/tplink_archer-c7-v2/tplink_archer-c7-v2-US.bin ...

Downloading in 8 parts: 16449564 / 16449564 bytes @ 1338 kb/s (100%)
Joining 8 parts: 8
Downloaded file OK.

WARNING THIS COULD BRICK YOUR ROUTER!!!

File to burn: ./fwcache/08-25-2021-r47256/tplink_archer-c7-v2/tplink_archer-c7-v2-US.bin
Erase nvram y/n ? n
Save user settings restore point y/n ? n
./easyddup.sh: line 452: tee: not found
WARNING: DO NOT INTERRUPT...
WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Skipping firmware burn.
Skipping reboot.


Seems to be all working now, aside from not having tee but that's not a biggie.

I'll look at the scripts closer sometime to see if I can add further automation, like how DD_BOARD can give you most of the information that's used in both of those variables.
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 967

PostPosted: Sun Aug 29, 2021 2:22    Post subject: Reply with quote
slycordinator wrote:
Code:
root@DD-WRT:/tmp/easyddup# ./easyddup.sh -n -f
Burn of firmware will not be done.

All dd-wrt upgrade builds available online for 2021

1)      08-25-2021-r47256 c      <--- current

Current build: 47256
Select a build to install (or Q): 1
********************************************************
***** WARNING: BUILD SELECTED IS ALREADY INSTALLED *****
********************************************************
Selected 08-25-2021-r47256

Files in build 08-25-2021-r47256 for TP-Link ARCHER-C7 v2

1)      factory-to-ddwrt-IL.bin
2)      factory-to-ddwrt-US.bin
3)      factory-to-ddwrt.bin
4)      tplink_archer-c7-v2-IL.bin
5)      tplink_archer-c7-v2-US.bin c  <--- auto selected
6)      tplink_archer-c7-v2.bin

Selected tplink_archer-c7-v2-US.bin
Build not in local cache or -f option, downloading...
Downloading https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/08-25-2021-r47256/tplink_archer-c7-v2/tplink_archer-c7-v2-US.bin ...

Downloading in 8 parts: 16449564 / 16449564 bytes @ 1338 kb/s (100%)
Joining 8 parts: 8
Downloaded file OK.

WARNING THIS COULD BRICK YOUR ROUTER!!!

File to burn: ./fwcache/08-25-2021-r47256/tplink_archer-c7-v2/tplink_archer-c7-v2-US.bin
Erase nvram y/n ? n
Save user settings restore point y/n ? n
./easyddup.sh: line 452: tee: not found
WARNING: DO NOT INTERRUPT...
WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Skipping firmware burn.
Skipping reboot.


Seems to be all working now, aside from not having tee but that's not a biggie.

I'll look at the scripts closer sometime to see if I can add further automation, like how DD_BOARD can give you most of the information that's used in both of those variables.
  • I see that you're running easyddup from /tmp/ folder. Just a reminder: that folder is on RAM and will be cleared on every reboot.
  • for your case, EDDUP_USE_MULTIPART=8 seems to be slower than tradtional curl, so it's better to remove/comment that line from your easyddup.ini
  • for fully automated operation, you can add/uncomment the following options in easyddup.ini:
    Code:
    EDDUP_ERASE_NVRAM=N
    EDDUP_SAVE_SETTINGS=N
    EDDUP_AUTO_CONFIRM=Y
    EDDUP_AUTO_SELECT_LATEST=Y
    Note that when EDDUP_AUTO_SELECT_LATEST=Y, the script will terminate if the current fw is already the latest version.
  • can you share the output of
    Code:
    nvram show | grep -i board
    If there's some additional board info in nvram then yoyoma2 can use that to auto select the fw folder/image file.
    Is there any other automation you have in mind? it may be already done/partially done by some of us, or yoyoma2 may decide to expand his easyddup script if the idea is good.
    For me, I have a call-back script to do the following tasks:
    • Backup full nvram to bin file (@yoyoma2 sorry I'm lazy to figure out which variables to add to nvram-dd-wrt.ini)
    • Update/upgrade Entware packages
    • Write a report file so that I can copy/paste to the "new build" topic. The report file is sent to my email address after reboot.
    • Remove old downloaded fw files, only keep the latest 3 versions, so that the USB disk won't get full. @yoyoma2 do you think it's good to add this option to easyddup.sh?


_________________
▫ 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 🌟)
slycordinator
DD-WRT Novice


Joined: 22 Aug 2020
Posts: 15

PostPosted: Sun Aug 29, 2021 2:51    Post subject: Reply with quote
I was only running it in /tmp testing it.

Thanks for the help
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 373

PostPosted: Mon Aug 30, 2021 12:20    Post subject: Reply with quote
slycordinator wrote:
type is generally preferable to which for scripts, as type is a builtin.
I'm not a script person so thanks for the tip. Will use type...

@IONK I like your idea of limiting the cache entries to save USB drive space. Do you have some working lines of code to share?
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 967

PostPosted: Mon Aug 30, 2021 12:24    Post subject: Reply with quote
yoyoma2 wrote:
@IONK I like your idea of limiting the cache entries to save USB drive space. Do you have some working lines of code to share?
Code:
   # only keep the last 3 FW folders
   find "$EASYDDUPDIR/fwcache/" -type d | sort | head -n -6 | tail -n +2 | xargs -r rm -r
not refined but at least it's working for me
_________________
▫ 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 ... 9, 10, 11 ... 19, 20, 21  Next Display posts from previous:    Page 10 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