Automated update script

Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.)
Author Message
Ah-Pin-Kor
DD-WRT User


Joined: 19 Sep 2015
Posts: 267

PostPosted: Tue Jul 30, 2019 7:12    Post subject: Reply with quote
For cron, you would have to insert a line like:
cd /tmp/mnt/smbshare
at the start of the script as cron's working dir may not be what your script wants.

_________________

Netgear R7800 kongpro 19.07 20190919 || Netgear R7000 36070M kongac (Client Bridge=5GHz, AP=2.4GHz with bridged VAP)
Linksys WRT32X davidc502 OpenWrt || Linksys WRT1200ACv1 Gargoyle 1.11.x
Linksys WRT1900ACSv2 dd-wrt 39956
Sponsor
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Sun Aug 04, 2019 19:49    Post subject: Reply with quote
Hi d0ug... You've inspired me to draft a script to do the simpler thing of finding and downloading a given release to my computer, transferring it to my router using scp, and then using ssh to pass along and execute the write TheDownloadedFile linux command.

But this has raised an interesting question in my mind. There has always been this idea that one needs to do an update over ethernet with no other cables attached to the router. But certainly I could (and have, in testing) do everything before the write... over wifi.

But what about the write... and the subsequent reboot? Once the flash is done, the running kernel then, I suppose, might be using the newly flashed filesystem (everything except /tmp), depending on which partition is being flashed), so the reboot command needs to work in that setting. Presumably it does work, or this would not be the flashing-from-ssh procedure that people post now and then. (Or - horrors! - does this procedure only work when flashing into the other partition?) Does this write... risk having interrupts (say from the switch controlling the WAN port) passed to the wrong code? Is this why the only-one-cable rule? Or is the rule really about the final reboot, which presumably should not be interrupted while sorting through the nvram variables and defaulting anything not properly assigned?

Thoughts?

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
PIZZEDMEOFF
DD-WRT User


Joined: 12 Dec 2017
Posts: 244
Location: FL

PostPosted: Mon Aug 05, 2019 3:05    Post subject: Reply with quote
my 2 cents on this is, this router is a wireless bridge here, and ive had it pretty loaded while flashing ( i have a server rack in here wired to it by eithernet cable ( not mission cricitcal ofcourse but its still a wireless bridge) and there is no friggin way im going to unhook this and take it all the way to the modem across the property here to flash everytime, ive been running this way for over 6 years and ive not had no problems! Flash away!
_________________
Downloads:
ftp site: ftp://ftp.dd-wrt.com/betas/2021
SVN Timeline:
https://svn.dd-wrt.com/timeline
Commands:
Misc: sleep 10;stopservice nas;stopservice wlconf;startservice wlconf;startservice nas
samba: { sleep 30; stopservice samba3; startservice samba3; } &

WRT1900ACv1:

WIFI: 2.4ghz: NG-mixed, 20mhz channel width, channel follows AP, WPA2-CCMP-128.
WIFI: 5ghz: AC/N mixed, 40mhz channel width, channel 100+upper, WPA2-CCMP-128.
Misc Info: WPA2 Personal: "CCMP-128 (AES)" Static IP's VIA Mac+Host, SFE Enabled, No Rebind, Strict, no-resolv. NOTE: this is now just a wireless access point so to speak but all settings still apply to what ever wireless person connects.
Ah-Pin-Kor
DD-WRT User


Joined: 19 Sep 2015
Posts: 267

PostPosted: Mon Aug 05, 2019 5:20    Post subject: Reply with quote
SurprisedItWorks wrote:

But what about the write... and the subsequent reboot? Once the flash is done, the running kernel then, I suppose, might be using the newly flashed filesystem (everything except /tmp), depending on which partition is being flashed), so the reboot command needs to work in that setting. Presumably it does work, or this would not be the flashing-from-ssh procedure that people post now and then. (Or - horrors! - does this procedure only work when flashing into the other partition?) Does this write... risk having interrupts (say from the switch controlling the WAN port) passed to the wrong code? Is this why the only-one-cable rule? Or is the rule really about the final reboot, which presumably should not be interrupted while sorting through the nvram variables and defaulting anything not properly assigned?

Thoughts?

The upgrade file has to be transferred to the router before write is invoked, whether by scp, ftp, wget or other ways. Thru wired or wifi doesn't matter as long as the file is completely transferred.
The write only writes to the flash. The running kernel doesn't run directly from flash but is uncompressed/copied from flash to ram during bootup and run from ram, so it's safe to run write while current kernel is running.

_________________

Netgear R7800 kongpro 19.07 20190919 || Netgear R7000 36070M kongac (Client Bridge=5GHz, AP=2.4GHz with bridged VAP)
Linksys WRT32X davidc502 OpenWrt || Linksys WRT1200ACv1 Gargoyle 1.11.x
Linksys WRT1900ACSv2 dd-wrt 39956
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Mon Aug 05, 2019 15:13    Post subject: Reply with quote
d0ug wrote:
I have done it multiple times and never had issues flashing ddwrt on routers over wifi

Ah-Pin-Kor wrote:
The upgrade file has to be transferred to the router before write is invoked, whether by scp, ftp, wget or other ways. Thru wired or wifi doesn't matter as long as the file is completely transferred.
The write only writes to the flash. The running kernel doesn't run directly from flash but is uncompressed/copied from flash to ram during bootup and run from ram, so it's safe to run write while current kernel is running.

Thanks to you both. That's really the best of all possible situations here. It seems I've been unnecessarily conservative re the connection-via-cable thing. Perhaps that restriction is only relevant re installing dd-wrt from the Linksys firmware? I did have horrible difficulties trying the latter with WAN connected. Never had a problem with the one cable only though.

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.) 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