easyddup a simple upgrade/downgrade utility

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


Joined: 05 Oct 2008
Posts: 660
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Thu Oct 26, 2023 9:09    Post subject: Reply with quote
Error output at end.

root@R7800:~# cd /opt/easyddup
root@R7800:/opt/easyddup# easyddup.sh

All dd-wrt upgrade builds available online for 2023

1) 10-24-2023-r53763 <--- current
2) 10-26-2023-r53775

Current build: 53763
Select a build to install (or Q): 2
Selected 10-26-2023-r53775

Files in build 10-26-2023-r53775 for Netgear R7800

1) dd-wrt-webupgrade.bin
2) factory-to-ddwrt.img

Select a firmware file to install (or Q): 1
Selected dd-wrt-webupgrade.bin
Build not in local cache or -f option, downloading...
Downloading https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2023/10-26-2023-r53775/netgear-r7800/dd-wrt-webupgrade.bin ...

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 29.3M 100 29.3M 0 0 141k 0 0:03:32 0:03:32 --:--:-- 193k
Downloaded file OK.

WARNING THIS COULD BRICK YOUR ROUTER!!!

File to burn: ./fwcache/10-26-2023-r53775/netgear-r7800/dd-wrt-webupgrade.bin
Are you sure? Type YES to burn upgraded firmware: YES
Erase nvram y/n ? n
Save user settings restore point y/n ? y
Saving user settings restore point...
Burning ./fwcache/10-26-2023-r53775/netgear-r7800/dd-wrt-webupgrade.bin
WARNING: DO NOT INTERRUPT...
WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Done burning
Rebooting...
./easyddup.sh: line 519: /sbin/reboot: I/O error
root@R7800:/opt/easyddup#
root@R7800:/opt/easyddup# ls -l /sbin/reboot
ls: /sbin/reboot: I/O error
root@R7800:/opt/easyddup# /sbin/reboot ; echo $?
-sh: /sbin/reboot: I/O error
126
root@R7800:/opt/easyddup#

Now on to Linux Magic ...
Sponsor
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 936

PostPosted: Thu Oct 26, 2023 10:12    Post subject: Reply with quote
ArjenR49 wrote:
Error output at end.
Current build: 53763
This is not easyddup issue. Recent Atheros k6.1 devices have issues with reboot command, example:
Alozaros wrote:
Router Model Netgear R7800
Firmware Version DD-WRT v3.0-r53775 std (10/25/23)
Kernel Version Linux 6.1.59 #20 SMP Wed Oct 25 12:40:22 +07 2023 arm

update: CLI r53763> r53775
reset: NO
mode: Gateway
status: Operational 1h+
errors: same problems with CLI flash...(via SSh)

root@135bcll:/opt# reboot
-sh: chmod: I/O error
-sh: /tmp/.rc_shutdown: Permission denied
-sh: /sbin/reboot: I/O error

root@135bcll:/opt# echo u > /proc/sysrq-trigger
root@135bcll:/opt# echo s > /proc/sysrq-trigger
root@135bcll:/opt# echo b > /proc/sysrq-trigger

apart of it...router is operations...so far, so good... Thanks BS and Team !
Let's wait for k6.1 to settle down first before making any modification on other scripts. In the meantime, you can check for workarounds in the new build threads.

dale_gribble39 wrote:
Would it be possible for easyddup to use the alternative automatic CLI flashing method that saves the file as /tmp/firmware.bin so it works without having to use the reboot command?
yoyoma2 wrote:
The /tmp/firmware.bin method might work but seems like a bigger change given the years of testing with the current method.
What happens if there's not enough available RAM to copy firmware.bin to /tmp ?
_________________
▫ 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 🌟)


Last edited by IONK on Thu Oct 26, 2023 10:24; edited 1 time in total
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 362

PostPosted: Fri Oct 27, 2023 20:28    Post subject: Reply with quote
Thanks for all the feedback and ideas.

Since there's already a PREBURN_CB how about I add a POSTBURN_CB which could do the reboot in that special way if needed? If the new kernel stuff settles down and this problem disappears the new POSTBURN_CB could be commented out from the .ini file.
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 362

PostPosted: Mon Oct 30, 2023 22:39    Post subject: Reply with quote
New version 0.9.4 (October 30th).

Changes:

With recent dd-wrt releases filesystem access is lost after writing the new firmware causing easyddup to fail to call /sbin/reboot at the end. Added a PREREBOOT_CB to easyddup.ini.sample which provides an alternate means to reboot. You'll need to copy these lines from easyddup.ini.sample to your easyddup.ini to use the prereboot callback.

alternate_reboot() {
echo Before magic SysRq key reboot
sleep 1 # allows previous messages to appear before reboot
echo s > /proc/sysrq-trigger
echo u > /proc/sysrq-trigger
echo b > /proc/sysrq-trigger
}
PREREBOOT_CB="alternate_reboot"

Upgrade:
checknewversion.sh

# set these correctly in your checknewversion.ini for updates to work
EASYDDUPSELFUPDATE=Y
FORUMUSER="myforumusername"
FORUMCRED='myforumpassword'

Ideas:
If anyone prefers the /tmp/firmware.bin method the PREBURN_CB could be used to burn & reboot that way instead. Share it if you do and have something that works well.
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 660
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Tue Oct 31, 2023 10:22    Post subject: Reply with quote
After updating the easyddup script, checking the settings in easyddup.ini and adding the extra lines to the other ini file, the upgrade to 53833 went fine.
These are the last lines concerning the upgrade in the SSH terminal:
File to burn: ./fwcache/10-31-2023-r53833/netgear-r7800/dd-wrt-webupgrade.bin
Are you sure? Type YES to burn upgraded firmware: YES
Erase nvram y/n ? n
Save user settings restore point y/n ? y
Saving user settings restore point...
Burning ./fwcache/10-31-2023-r53833/netgear-r7800/dd-wrt-webupgrade.bin
WARNING: DO NOT INTERRUPT...
WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Done burning
Processing callback alternate_reboot()
Before magic SysRq key reboot


The router booted to the new build, but the terminal prompt never came back. Probably more or less normal since the router booted. Sometimes in SSH sessions when a target disappears there's a message and the prompt does come back.

However the new script version works fine!
Thank you yoyoma!

PS:
it required just sending a return in the terminal to get the prompt back:
Processing callback alternate_reboot()
Before magic SysRq key reboot
client_loop: send disconnect: Broken pipe
arjen@NUC10i5:~$
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 362

PostPosted: Tue Oct 31, 2023 13:53    Post subject: Reply with quote
Super detailed feedback thanks! I should have mentioned the hitting enter thing since the first time I tested this the sleep 1 command wasn't there and several messages were missing and I thought the router froze earlier even before the alternate reboot stuff.

I've never used these magic sysrq things so thanks for teaching me something new guys.
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 660
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Thu Dec 07, 2023 8:56    Post subject: Reply with quote
Log output from my latest update, from build 54420 to 54475 just a few moments ago.
First I checked that I had already updated easyddup.

After updating the router, LAN/WAN seemd to have continued to work, but the router GUI gave a 404 error.
A few days ago I travelled from a location with an R7800 that I have updated every time a new build was posted, and I don't think those updates ended the same way as at the end of this log:

root@XR500:/opt/easyddup# cat VERSION.txt
0.9.4
root@XR500:/opt/easyddup# easyddup.sh

All dd-wrt upgrade builds available online for 2023

1) 12-04-2023-r54420 c <--- current
2) 12-07-2023-r54475

Current build: 54420
Select a build to install (or Q): 2
Selected 12-07-2023-r54475

Files in build 12-07-2023-r54475 for Netgear XR500

1) dd-wrt-webupgrade.bin
2) factory-to-ddwrt.img

Select a firmware file to install (or Q): 1
Selected dd-wrt-webupgrade.bin
Build not in local cache or -f option, downloading...
Downloading https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2023/12-07-2023-r54475/netgear-xr500/dd-wrt-webupgrade.bin ...

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 29.6M 100 29.6M 0 0 3313k 0 0:00:09 0:00:09 --:--:-- 3394k
Downloaded file OK.

WARNING THIS COULD BRICK YOUR ROUTER!!!

File to burn: ./fwcache/12-07-2023-r54475/netgear-xr500/dd-wrt-webupgrade.bin
Are you sure? Type YES to burn upgraded firmware: YES
Erase nvram y/n ? n
Save user settings restore point y/n ? y
Saving user settings restore point...
Burning ./fwcache/12-07-2023-r54475/netgear-xr500/dd-wrt-webupgrade.bin
WARNING: DO NOT INTERRUPT...
WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Done burning
./easyddup.sh: line 517: /bin/sync: I/O error
Rebooting...
./easyddup.sh: line 520: /sbin/reboot: I/O error
root@XR500:/opt/easyddup#


Before rebooting the router manually or in whatever way I can, I try to post this for yoyoma to read.
Lately I have had to reboot the R7800 in the previous location after every update because the update would leave the thumbdrive optware fs dirty. My shutdown script repairs it.
It remains to be seen how this XR500 behaves.
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 936

PostPosted: Thu Dec 07, 2023 9:01    Post subject: Reply with quote
ArjenR49 wrote:
Log output from my latest update, from build 54420 to 54475 just a few moments ago.
First I checked that I had already updated easyddup.

After updating the router, LAN/WAN seemd to have continued to work, but the router GUI gave a 404 error.
A few days ago I travelled from a location with an R7800 that I have updated every time a new build was posted, and I don't think those updates ended the same way as at the end of this log:

WAIT FOR BURN TO COMPLETE (at least 5 minutes)
Done burning
./easyddup.sh: line 517: /bin/sync: I/O error
Rebooting...
./easyddup.sh: line 520: /sbin/reboot: I/O error
root@XR500:/opt/easyddup#


Before rebooting the router manually or in whatever way I can, I try to post this for yoyoma to read.
Lately I have had to reboot the R7800 in the previous location after every update because the update would leave the thumbdrive optware fs dirty. My shutdown script repairs it.
It remains to be seen how this XR500 behaves.

K6.1 has issue, you need the "alternate_reboot" (uncomment the #PREREBOOT_CB line):
yoyoma2 wrote:
New version 0.9.4 (October 30th).

Changes:

With recent dd-wrt releases filesystem access is lost after writing the new firmware causing easyddup to fail to call /sbin/reboot at the end. Added a PREREBOOT_CB to easyddup.ini.sample which provides an alternate means to reboot. You'll need to copy these lines from easyddup.ini.sample to your easyddup.ini to use the prereboot callback.

alternate_reboot() {
echo Before magic SysRq key reboot
sleep 1 # allows previous messages to appear before reboot
echo s > /proc/sysrq-trigger
echo u > /proc/sysrq-trigger
echo b > /proc/sysrq-trigger
}
PREREBOOT_CB="alternate_reboot"

I suspect the fs dirty is also because of K6.1 issue. Options: use K4.19 or wait till K6.1 issues are fixed.

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


Joined: 05 Oct 2008
Posts: 660
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Thu Dec 07, 2023 10:19    Post subject: Reply with quote
It was my fault. I had updated easyddup, but not edited easyddup.ini. In fact on this router I didn't have easyddup.ini, yet. So I copied the sample file and edited the new easyddup.ini according to the instructions and comparing to the easyddup.ini file on my R7800.
Boldly changing some other settings as well.
Next upgrade should be more streamlined. We can wait for it ...

This latest upgrade restored the Internet LED functionality ...
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 362

PostPosted: Thu Dec 07, 2023 14:55    Post subject: Reply with quote
Glad you got it working (thanks @IONK). Just curious what does /nr mean in your location? "near"?
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 660
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Thu Dec 07, 2023 20:04    Post subject: Reply with quote
yoyoma2 wrote:
Glad you got it working (thanks @IONK). Just curious what does /nr mean in your location? "near"?


Yes, near Alkmaar, the city with the weekly cheese market. Also the first city in the Low Lands to keep the Spanish outside the city walls over 400 years ago in the 80-year war of independence Wink Hence 'Alcmaria Victrix' ...
Goto page Previous  1, 2, 3 ... 18, 19, 20 Display posts from previous:    Page 20 of 20
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