easyddup a simple upgrade/downgrade utility

Post new topic   Reply to topic    DD-WRT Forum Index -> Contributions Upload
Goto page Previous  1, 2, 3 ... 20, 21, 22, 23  Next
Author Message
Mrutin
DD-WRT Novice


Joined: 06 Mar 2024
Posts: 3

PostPosted: Fri Mar 08, 2024 3:27    Post subject: Reply with quote
Thanks, working fine now.
Currently running a dangerous auto update with easyddup.ini
Code:
EDDUP_ERASE_NVRAM=N
EDDUP_SAVE_SETTINGS=Y
EDDUP_AUTO_CONFIRM=Y
EDDUP_AUTO_SELECT_LATEST=Y
EDDUP_AUTO_SELECT_FILE='asus_rt-ac68u-firmware.trx'
EDDUP_HARDWARE_FOLDER="asus-rt-ac68u"


And a cron job of
Code:
01 01 * * * root /opt/easyddup/easyddup.sh


This will of course break my router if the latest build is bad - which I expect to occur quite often. Any thoughts on how to decrease the risk of using a bad build?

Currently considering a heuristic based on how long the latest build has existed (e.g. more than 10 days should mean nothing horribly wrong with the build in general).
Sponsor
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 401

PostPosted: Fri Mar 08, 2024 15:25    Post subject: Reply with quote
Mrutin wrote:
Currently considering a heuristic based on how long the latest build has existed (e.g. more than 10 days should mean nothing horribly wrong with the build in general).

Good idea. Something like below that defaults to zero and prevents showing bleeding edge builds.

#EDDUP_WAIT_FOR_DAYS=7

If you do something general please share and all could benefit.


Last edited by yoyoma2 on Thu Mar 14, 2024 12:27; edited 1 time in total
Mrutin
DD-WRT Novice


Joined: 06 Mar 2024
Posts: 3

PostPosted: Thu Mar 14, 2024 10:12    Post subject: Reply with quote
Code:
--- easyddup.sh   2024-03-14 08:31:01.774393075 +0100
+++ easyddup.ageverify.sh   2024-03-14 08:33:53.391410260 +0100
@@ -225,6 +225,14 @@
       exit 0
    fi
    selection=$(echo "$builds" | tail -n +$fid | head -n 1)
+   if [ "$EDDUP_AUTO_SELECT_LATEST" == "Y" ] && [ "$EDDUP_AUTO_SELECT_MIN_AGE" -gt "0" ]; then
+      selection_date=$(echo "$selection" | awk -F'-' '{print $3"-"$1"-"$2}')
+      age_seconds=$(( $(date '+%s') - $(date -d "$selection_date" '+%s') ))
+      if [ "$age_seconds" -lt "$EDDUP_AUTO_SELECT_MIN_AGE" ]; then
+         echo "EDDUP_AUTO_SELECT_MIN_AGE is $EDDUP_AUTO_SELECT_MIN_AGE and age is $age_seconds. Quitting"
+         exit 0
+      fi
+   fi
    selected_revision=${selection##*r}
    if [ $buildno -gt $selected_revision ] && \
            [ "$EDDUP_AUTO_SELECT_LATEST" == "Y" -o "$EDDUP_AUTO_SELECT_LATEST" == "y" ];then

And then this in the ini
Code:
EDDUP_AUTO_SELECT_MIN_AGE=259200 #72h in seconds


This version only affects auto updates and prevents the update if the release is too new.
I decided against hiding releases from users as it would not make a difference as they would just see broken releases later (unless the broken release was pulled), this would not help my auto-update scenario.
I realize that this may not match other use cases, so feel free to adapt this.

Also, any reason for not using github? would be nice
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 401

PostPosted: Thu Mar 14, 2024 18:22    Post subject: Reply with quote
New version 0.9.5 (March 14th).

Changes:

Include @Mrutin's feature that allows EDDUP_AUTO_SELECT_LATEST to have a waiting period to avoid automatically installing potentially bad builds. See easyddup.ini.sample for example use:

Code:
EDDUP_AUTO_SELECT_MIN_AGE=259200 #72h in seconds

Thank you @Mrutin, great idea and implementation!

Upgrade automatically with checknewversion.sh or download/install manually.
JavaOops
DD-WRT Novice


Joined: 02 Jan 2016
Posts: 20

PostPosted: Thu May 09, 2024 17:31    Post subject: Download location for latest eassyddupe? Reply with quote
I have the old 0.9 version. Where do we get the latest version from?
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 2066

PostPosted: Thu May 09, 2024 17:47    Post subject: Reply with quote
JavaOops wrote:
I have the old 0.9 version. Where do we get the latest version from?

From the OP of this thread: easyddup 0.9.5 a simple upgrade/downgrade utility (2024-03-14) The linked file is updated every time a new version is released:
Code:
Last edited by yoyoma2 on Thu Mar 14, 2024 12:49; edited 55 times in total

_________________
"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
JavaOops
DD-WRT Novice


Joined: 02 Jan 2016
Posts: 20

PostPosted: Thu May 09, 2024 17:51    Post subject: New version Reply with quote
Thanks!
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 401

PostPosted: Thu May 09, 2024 19:22    Post subject: Re: Download location for latest eassyddupe? Reply with quote
JavaOops wrote:
I have the old 0.9 version. Where do we get the latest version from?
You have 0.9 so you still have to manually update once but version 0.9.1 and beyond has a self update feature built into checknewversion.sh. Page 15 of this thread explains how to enable it (find EASYDDUPSELFUPDATE).

Trick:
Once you have the self-update capable current version 0.9.5 you can pretend to have 0.9.4 with:
Code:
echo 0.9.4 > VERSION.txt

If self-update is configured correctly the following with bring VERSION.txt back to 0.9.5
Code:
# checknewversion.sh
Upgrading easyddup from version 0.9.4 to version 0.9.5
Getting latest easyddup package from dd-wrt forum.
Installing and running new easyddup version 0.9.5
scar
DD-WRT User


Joined: 22 Sep 2008
Posts: 62

PostPosted: Sun Nov 03, 2024 7:54    Post subject: Reply with quote
Wow thanks!1  Think this will work to update v3.0-r30880 std (11/14/16) to current? 😅
_________________
Current
WRT1900ACSv2 - v3.0

Past
WRT54GLv1.1 - v24-sp2 micro
WRT600Nv1.1 - v24-sp2 mega (+DIY detach antennas)
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 401

PostPosted: Sun Nov 03, 2024 14:20    Post subject: Reply with quote
Probably but it was made in 2019 so not sure it runs on a 2016 dd-wrt version. Try running with -n
Code:
./easyddup.sh -n
and say no to the question about erasing nvram. It will go through the motions but won't actually upgrade the firmware.

If all goes well and you actually want to upgrade then lose the -n and say yes to erasing nvram since it's such a big jump in versions.
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 401

PostPosted: Wed Apr 23, 2025 15:15    Post subject: Reply with quote
New version 0.9.6 (April 23rd).

Changes:

The checknewversion.sh script now fails to login to the forum to update easyddup even with the proper credentials. The forum server must be more strict than before. This used to be a fatal error but now the script will continue and still provide email notification about new dd-wrt versions.

Setting the following in your checknewversion.ini file will avoid error messages.
EASYDDUPSELFUPDATE=N

I don't think auto-updating easyddup is worth the effort of fixing this.
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 1183

PostPosted: Wed Apr 23, 2025 15:29    Post subject: Reply with quote
yoyoma2 wrote:
New version 0.9.6 (April 23rd).

Changes:

The checknewversion.sh script now fails to login to the forum to update easyddup even with the proper credentials. The forum server must be more strict than before. This used to be a fatal error but now the script will continue and still provide email notification about new dd-wrt versions.

Setting the following in your checknewversion.ini file will avoid error messages.
EASYDDUPSELFUPDATE=N

I don't think auto-updating easyddup is worth the effort of fixing this.
I suspect ddwrt server blocks all non-standard user agents (bot/scraper/etc.) My custom script suddenly stopped working a few months ago until I set curl user agent to Chrome. So probably one workaround is to add a new variable to allow users to set the custom header for curl calls in easyddup, default is blank.
_________________
▫ RSS feed for DD-WRT releases (2025): 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: 401

PostPosted: Wed Apr 23, 2025 19:30    Post subject: Reply with quote
New version 0.9.7 (April 23rd).

Thanks @IONK !!!

Changes:

Added a USERAGENT variable to checknewversion.ini.sample and easyddup self-updates work again. Users still need to get this version manually and make sure their checknewversion.ini has the USERAGENT line from the sample file for future self-updates to work.
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 1183

PostPosted: Sat Apr 26, 2025 17:43    Post subject: Reply with quote
@yoyoma2:
Regarding the config EDDUP_EXPECTED_FW_SIZE_MAX in easyddup.ini, do you think it's a good idea to implement the following:
- if EDDUP_EXPECTED_FW_SIZE_MAX=somenumber then everything is as previous versions,
- if EDDUP_EXPECTED_FW_SIZE_MAX=auto then the max allowed fw size is dynamically retrieved from the output of 'cat /proc/mtd'

Reason: I can't remember for which router, but I had to manually increase the EDDUP_EXPECTED_FW_SIZE_MAX a few times for the increasing fw file size to pass the check. Hard-coding a number may not be a good idea because the developer may quietly adjust the partition size in the future.

Example output of 'cat /proc/mtd':
phantom4 wrote:
IONK wrote:
kernel-panic69 wrote:
[...] Generally, reading the output of 'cat /proc/mtd' should give you an idea. [...]

For my D-Link DIR-868L Rev.A1:
Code:
BusyBox v1.37.0 (2025-04-24 01:22:04 +07) built-in shell (ash)

root@RB:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00010000 "boot"
mtd1: 00010000 00010000 "nvram_cfe"
mtd2: 00010000 00010000 "nvram"
mtd3: 02000000 00020000 "linux"
mtd4: 01e2ffa0 00020000 "rootfs"
mtd5: 06000000 00020000 "ddwrt"
root@RB:~#


For my Netgear XR500:
Code:
BusyBox v1.37.0 (2025-04-24 01:00:43 +07) built-in shell (ash)

root@AP:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00c80000 00020000 "qcadata"
mtd1: 00500000 00020000 "APPSBL"
mtd2: 00080000 00020000 "APPSBLENV"
mtd3: 00140000 00020000 "art"
mtd4: 00140000 00020000 "artbak"
mtd5: 01e00000 00020000 "linux"
mtd6: 019c0000 00020000 "rootfs"
mtd7: 00200000 00020000 "nvram"
mtd8: 0a680000 00020000 "ddwrt"
mtd9: 00780000 00020000 "reserved"
root@AP:~#


Does it mean my XR500 has less space for firmware than my DIR-868L (31,457,280 bytes vs 33,554,432 bytes)?

P/S: your RSS feed link for 2024 & 2023 in your signature are broken.


FYI:

Netgear R6250:

Code:
cat /proc/mtddev:    size   erasesize  name
mtd0: 00080000 00020000 "boot"
mtd1: 00180000 00020000 "nvram"
mtd2: 01c80000 00020000 "linux"
mtd3: 01aa0000 00020000 "rootfs"
mtd4: 00020000 00020000 "board_data"
mtd5: 06000000 00020000 "ddwrt"


Netgear R7000:

Code:
cat /proc/mtddev:    size   erasesize  name
mtd0: 00080000 00020000 "boot"
mtd1: 00180000 00020000 "nvram"
mtd2: 02000000 00020000 "linux"
mtd3: 01e20000 00020000 "rootfs"
mtd4: 00040000 00020000 "board_data"
mtd5: 05dc0000 00020000 "ddwrt"

_________________
▫ RSS feed for DD-WRT releases (2025): 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: 401

PostPosted: Sat Apr 26, 2025 20:09    Post subject: Reply with quote
IONK wrote:
- if EDDUP_EXPECTED_FW_SIZE_MAX=auto then the max allowed fw size is dynamically retrieved from the output of 'cat /proc/mtd'

On routers with multiple linux partitions do all have the same size? Otherwise EDDUP_TARGET_PARTITION would have to be used when parsing /proc/mtd.

It makes sense that no EDDUP_EXPECTED_FW_SIZE_MAX larger than the target partition size should be allowed.
Goto page Previous  1, 2, 3 ... 20, 21, 22, 23  Next Display posts from previous:    Page 21 of 23
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