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: 646
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: 893

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 (2023): https://politepol.com/fd/bdQnjdZgyaln
easyddup - A simple upgrade/downgrade utility by yoyoma2 --- as featured in 📌 List of reference threads, how-tos, and otherwise (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: 358

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: 358

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: 646
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: 358

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.
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