easyddup a simple upgrade/downgrade utility

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions
Goto page 1, 2, 3, 4, 5, 6, 7  Next
Author Message
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 192

PostPosted: Thu Dec 26, 2019 4:48    Post subject: easyddup a simple upgrade/downgrade utility Reply with quote
WARNING: This is a beta version (updating firmware by any method has some risks).

Former Kong users know ddup. Here is easyddup, written from scratch, for BrainSlayer builds.

Features:

o Menu driven firmware download
o Secure https firmware download
o Automatic hardware identification (usually: see -r option)
o Caching of previous downloads
o Option to erase nvram or not
o Preserve basic settings (LAN and username/password)
o Possibity to save & automatically restore user settings
o Possibity to get email notifications of new builds
o Supports FAT and ext USB storage
o In place installation even if subnet not 192.168.1.x
o Store some basic settings in an ini file
o Multi-part setting for faster curl downloads

HELP NEEDED: The file nvram-dd-wrt.ini lists the user settings variables that are stored in the restore point. When you find settings that you regularly enter manually that are missing let me know and I'll add them or better yet make the changes and I'll integrate them. There will be a lot missing at first...

Credits:

Uses a modified version of this no longer maintained project. That project seemed to be quite a time saver as discussed here. The included QuickStart.txt file is from that project.

Used multipart curl download script from here and the progress reporting from here.

Got the basic idea and 50% of the easyddup name from Kong's ddup but no code.

Help:

easyddup -h

Easy ddd-wrt update Utility
easyddup.sh Version 0.9
Options: -h this help msg
-c Return count of available versions (does nothing)
-d Downgrade (default is to upgrade)
-f Force download even if build is cached
-m maxcount Search at most maxcount versions ahead/behind current
-n No firmware will be written but everything else is done
-p cache Path to local build cache (default ./fwcache)
-q Quiet (use with -c to check for updates silently)
-r rev Specify revision folder suffix (BRICK DANGER!!!)
-R rev Opposite of -r, revision suffix to strip
-w wipe individual cache items or -W to wipe all
-y xxxx Use year xxxx (default is current year)

Install:

mkdir -p /path/to/where/easyddup/subdirectory/is/wanted
cd /path/to/where/easyddup/subdirectory/is/wanted
cp /my/downloads/easyddup.tgz .
tar zxvf easyddup.tgz

The easyddup subdirectory is created and contains the required files.

Run:

You should already have a BrainSlayer build installed. (can sort of work from Kong).
You need USB storage but so beginners might want to read this guide.

To upgrade:

easyddup.sh

To downgrade:

easyddup.sh -d

To restore user settings:
After initial reboot, enable USB support and run nvram-restore-latest.sh or the restore script with the date/time of your choice. Reboot and your settings are back.

Tips:
o You can answer q to any prompt to quit
o Read the warning about passwords in QuickStart.txt
o Turning multi-part curl may speed up downloads considerably



inaction.gif
 Description:
easyddup in action doing an upgrade. Thanks @IONK
 Filesize:  437.64 KB
 Viewed:  614 Time(s)

inaction.gif



easyddup.png
 Description:
Screenshot of easyddup doing a downgrade.
 Filesize:  147.26 KB
 Viewed:  3788 Time(s)

easyddup.png



easyddup.tgz
 Description:
easyddup a simple upgrade/downgrade utility (2021-04-10)

Download
 Filename:  easyddup.tgz
 Filesize:  146.2 KB
 Downloaded:  276 Time(s)



Last edited by yoyoma2 on Sun Apr 11, 2021 2:02; edited 34 times in total
Sponsor
Alozaros
DD-WRT Guru


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

PostPosted: Thu Dec 26, 2019 8:44    Post subject: Reply with quote
basically this is CLI update option....sadly the good thing in it was to do a signature check but BS builds does not provide it...like Kong was...
So, i don't see a necessity of it, as update via CLI does the same thing apart of offering/showing the current/last updates to choose from...
if you have an access to FTP or Https update site, you can fairly choose an update...
The only clever option was to do an auto-update, the option that i was scared to use....
But anyway it's a good job you did there, nice to have more options for the general mass..

_________________
Atheros
TP-Link WR740Nv1 -----DD-WRT 45993 BS AP,NAT
TP-Link WR740Nv4 -----DD-WRT 44251 BS WAP/Switch
TP-Link WR1043NDv2 ---DD-WRT 46316 BS AP,NAT,AP Isolation,Ad-Block,Firewall,Local DNS,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 ---DD-WRT 46166 BS AP,NAT,AD/Block,Firewall,Local DNS,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 ---Gargoyle OS 1.12.0 AP,NAT,QoS,Quotas
Qualcomm/IPQ8065
Netgear R7800 -----DD-WRT 46259 BS AP,NAT,AD-Block,AP&Net Isolation,VLAN's,Firewall,Local DNS,DoT
Broadcom
Netgear R7000 -----DD-WRT 46259 BS AP,Wi-Fi OFF,NAT,AD-Block,Firewall,Local DNS,Forced DNS,VLAN's,DoT,VPN
-----------------------------------------------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 by mac913
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 7444
Location: Netherlands

PostPosted: Thu Dec 26, 2019 8:50    Post subject: Reply with quote
@yoyoma2, very nice work, congratulations!
_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
WireGuard Documents & Guides:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327397
OpenVPN Documents & Guides: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327398
IPSET: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327261
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 192

PostPosted: Thu Dec 26, 2019 15:16    Post subject: Reply with quote
Alozaros wrote:
basically this is CLI update option....So, i don't see a necessity of it

Lets compare my situation for a downgrade from problematic build:

With easyddup:

1) Run easyddup (my past builds are all cached) so visually it's obvious to return to any previous one. No download for cached ones so it's fast and easy on dd-wrt's servers.
2) Say 'y' to save/restore basic settings and erase nvram
3) After reboot run nvram-restore-latest.sh and reboot

Without easyddup:

1) Go to other building an retrieve router from difficult to access location.
2) Return to desk in office
3) Disconnect computer from network and connect to router
4) Find old stable build or hammer dd-wrt's servers and perform update with reset and reboot
5) Reconfigure my computer's LAN to 192.168.1.x subnet
6) Connect to the router and set the admin password and correct LAN settings and reboot.
7) Reconfigure my computer's LAN to correct LAN settings
8) Go through all of the dd-wrt settings that I use and re-enter them one by one. Turns out the most stable build was not one I had previously installed. Do not forget any or make any mistakes!
9) Reconnect computer to network
10) Return router to other building and reconnect everything

The huge gain is eliminating the time consuming/error prone step 8. For this to work for everyone, nvram-dd-wrt.ini will need some additions as mentioned in the OP.

As for signatures that's up to BS to provide them.
kernel-panic69
DD-WRT Guru


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

PostPosted: Thu Dec 26, 2019 16:04    Post subject: Reply with quote
Awesome work. Looking forward to seeing how this evolves.
_________________
Official Forum Rules, Guidelines & Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum. ---------------------- Linux User #377467 counter.li.org / linuxcounter.net


Last edited by kernel-panic69 on Fri Mar 19, 2021 18:57; edited 1 time in total
Alozaros
DD-WRT Guru


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

PostPosted: Thu Dec 26, 2019 17:04    Post subject: Reply with quote
yoyoma2 wrote:
Alozaros wrote:
basically this is CLI update option....So, i don't see a necessity of it

Lets compare my situation for a downgrade from problematic build:

With easyddup:

1) Run easyddup (my past builds are all cached) so visually it's obvious to return to any previous one. No download for cached ones so it's fast and easy on dd-wrt's servers.
2) Say 'y' to save/restore basic settings and erase nvram
3) After reboot run nvram-restore-latest.sh and reboot

Without easyddup:

1) Go to other building an retrieve router from difficult to access location.
2) Return to desk in office
3) Disconnect computer from network and connect to router
4) Find old stable build or hammer dd-wrt's servers and perform update with reset and reboot
5) Reconfigure my computer's LAN to 192.168.1.x subnet
6) Connect to the router and set the admin password and correct LAN settings and reboot.
7) Reconfigure my computer's LAN to correct LAN settings
Cool Go through all of the dd-wrt settings that I use and re-enter them one by one. Turns out the most stable build was not one I had previously installed. Do not forget any or make any mistakes!
9) Reconnect computer to network
10) Return router to other building and reconnect everything

The huge gain is eliminating the time consuming/error prone step 8. For this to work for everyone, nvram-dd-wrt.ini will need some additions as mentioned in the OP.

As for signatures that's up to BS to provide them.



1. too much bias in this compere
2. cli update eliminates all those struggles described above
3. normally cli update keeps all the settings, but you can erase them if so
4. i haven't seen stable build, all is beta
5. Kongs ddup was great only cause sig checks
6. if you push BS to provide sig it will be great way to update firmware... plus...
7. Kong was saying that he provides sig check only because his auto ddup
could be exploited

_________________
Atheros
TP-Link WR740Nv1 -----DD-WRT 45993 BS AP,NAT
TP-Link WR740Nv4 -----DD-WRT 44251 BS WAP/Switch
TP-Link WR1043NDv2 ---DD-WRT 46316 BS AP,NAT,AP Isolation,Ad-Block,Firewall,Local DNS,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 ---DD-WRT 46166 BS AP,NAT,AD/Block,Firewall,Local DNS,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 ---Gargoyle OS 1.12.0 AP,NAT,QoS,Quotas
Qualcomm/IPQ8065
Netgear R7800 -----DD-WRT 46259 BS AP,NAT,AD-Block,AP&Net Isolation,VLAN's,Firewall,Local DNS,DoT
Broadcom
Netgear R7000 -----DD-WRT 46259 BS AP,Wi-Fi OFF,NAT,AD-Block,Firewall,Local DNS,Forced DNS,VLAN's,DoT,VPN
-----------------------------------------------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 by mac913
kernel-panic69
DD-WRT Guru


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

PostPosted: Thu Dec 26, 2019 17:34    Post subject: Reply with quote
@Alozaros, current CLI update methods can be exploited. That is why <Kong> added the cryptographic signature and check. It would be great if we could get BS to cryptographically sign firmware images to verify them, though.
_________________
Official Forum Rules, Guidelines & Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum. ---------------------- Linux User #377467 counter.li.org / linuxcounter.net
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 192

PostPosted: Thu Dec 26, 2019 17:58    Post subject: Reply with quote
kernel-panic69 wrote:
@Alozaros, current CLI update methods can be exploited.
Note that easyddup uses https only.
kernel-panic69
DD-WRT Guru


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

PostPosted: Thu Dec 26, 2019 18:11    Post subject: Reply with quote
yoyoma2 wrote:
kernel-panic69 wrote:
@Alozaros, current CLI update methods can be exploited.
Note that easyddup uses https only.


That is one step in the correct direction, but crypto signature would be great as an added measure of security.

_________________
Official Forum Rules, Guidelines & Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum. ---------------------- Linux User #377467 counter.li.org / linuxcounter.net
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 192

PostPosted: Thu Dec 26, 2019 19:31    Post subject: Reply with quote
@Alozaros: Erasing nvram is just better. Sure most things work most of the time but I simply prefer the best option. You do what you prefer.

Alozaros wrote:
2. cli update eliminates all those struggles described above
3. normally cli update keeps all the settings, but you can erase them if so
Tell me how to access my router remotely after it has the wrong subnet.
Alozaros wrote:
4. i haven't seen stable build, all is beta
I wasn't clear. All builds are obviously beta but reading individual build threads informs you which ones are more "stable" than others.
Alozaros wrote:
5. Kongs ddup was great only cause sig checks
6. if you push BS to provide sig it will be great way to update firmware... plus...
7. Kong was saying that he provides sig check only because his auto ddup
could be exploited
Well easyddup uses https only (Kong's ddup used http). Microsoft uses https only for downloading Win10 ISO's so it will be difficult to convince BS that more security is needed for dd-wrt.

No one is forcing anyone to use easyddup although help improving it would be greatly appreciated as mentioned in the OP. The old underlying nvram save/restore tool revived by easyddup, was so appreciated that it generated over 800 mostly positive comments so it can't be all bad.
Alozaros
DD-WRT Guru


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

PostPosted: Thu Dec 26, 2019 22:05    Post subject: Reply with quote
erasing nvram before and after is not the best option in the world....
well its good for the developers, but it fries the nvram, i destroyed an old 1043v2 like that, doing a
rests before and after, nope its not necessary unless
there are serious changes, mem locations changes or so...I do not recommend over doing it...its BAD

and yep will be more than happy to see easyddup in action again and BS supporting it.... Twisted Evil Rolling Eyes

_________________
Atheros
TP-Link WR740Nv1 -----DD-WRT 45993 BS AP,NAT
TP-Link WR740Nv4 -----DD-WRT 44251 BS WAP/Switch
TP-Link WR1043NDv2 ---DD-WRT 46316 BS AP,NAT,AP Isolation,Ad-Block,Firewall,Local DNS,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 ---DD-WRT 46166 BS AP,NAT,AD/Block,Firewall,Local DNS,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 ---Gargoyle OS 1.12.0 AP,NAT,QoS,Quotas
Qualcomm/IPQ8065
Netgear R7800 -----DD-WRT 46259 BS AP,NAT,AD-Block,AP&Net Isolation,VLAN's,Firewall,Local DNS,DoT
Broadcom
Netgear R7000 -----DD-WRT 46259 BS AP,Wi-Fi OFF,NAT,AD-Block,Firewall,Local DNS,Forced DNS,VLAN's,DoT,VPN
-----------------------------------------------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 by mac913
Alozaros
DD-WRT Guru


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

PostPosted: Thu Dec 26, 2019 22:14    Post subject: Reply with quote
kernel-panic69 wrote:
@Alozaros, current CLI update methods can be exploited. That is why <Kong> added the cryptographic signature and check. It would be great if we could get BS to cryptographically sign firmware images to verify them, though.


yep i know ... Twisted Evil Evil or Very Mad tried that in the past...
but now we all trust BS...FTP and https site...it is what it is...

back in the days there was a thread about if someone
corrupts a flash file and adds a code to it, than that code will get into the BS mess, and that code has only a 1% chance to work... Embarassed heheehe...
so if you dont trust the source, than do not flash.. stay at home next to the stove its X mass..

_________________
Atheros
TP-Link WR740Nv1 -----DD-WRT 45993 BS AP,NAT
TP-Link WR740Nv4 -----DD-WRT 44251 BS WAP/Switch
TP-Link WR1043NDv2 ---DD-WRT 46316 BS AP,NAT,AP Isolation,Ad-Block,Firewall,Local DNS,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 ---DD-WRT 46166 BS AP,NAT,AD/Block,Firewall,Local DNS,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 ---Gargoyle OS 1.12.0 AP,NAT,QoS,Quotas
Qualcomm/IPQ8065
Netgear R7800 -----DD-WRT 46259 BS AP,NAT,AD-Block,AP&Net Isolation,VLAN's,Firewall,Local DNS,DoT
Broadcom
Netgear R7000 -----DD-WRT 46259 BS AP,Wi-Fi OFF,NAT,AD-Block,Firewall,Local DNS,Forced DNS,VLAN's,DoT,VPN
-----------------------------------------------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 by mac913
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 192

PostPosted: Fri Jan 03, 2020 3:16    Post subject: Reply with quote
Uploaded a new version of easyddup in the OP. The description of the attachment includes the date of the version. Although easyddup.sh -h prints a version number, it won't be changed for every tweak during alpha.

Changes:

Add a check to see if there are no builds available for the requested year. This helps in the first few days of the year before a single build is available or if an invalid year is attempted: easyddup.sh -y 1984
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 192

PostPosted: Thu Jan 09, 2020 3:24    Post subject: Reply with quote
New version posted in OP.

Changes:

Added option -n which prevents burning the firmware (kind of like gnu make -n goes through the motions without executing commands). You won't be asked to continue with an all caps YES and you won't reboot at the end unless you answer y to erasing nvram and writing the firmware is skipped at the end.

This is useful if you want to download new builds to your local cache but don't want to burn it just yet. More importantly you can create a restore point without upgrading your firmware. You can also tweak which variables are stored in the restore point without burning the firmware.

BTW the warning about bricking your router is there but it hasn't happened once here even while writing easyddup.
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 192

PostPosted: Thu Feb 04, 2021 0:23    Post subject: Reply with quote
New version posted in OP.

Changes:

Strip letters from version number.

While fixing samba 3.6 in the community build, I used a working copy with modifications in which case subversion adds a trailing 'M' to the version number. This broke the email notifications of new dd-wrt builds. Irrelevant fix unless you build your own dd-wrt version with modifications.
Goto page 1, 2, 3, 4, 5, 6, 7  Next Display posts from previous:    Page 1 of 7
Post new topic   Reply to topic    DD-WRT Forum 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