[Battlemesh] minus 4 days: I have improved the `owrtflash` script for mass deployment. Feedback is welcomed!

Bernd Naumann bernd at kr217.de
Thu Jul 30 23:05:38 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi at all,

I've spend the last two days to improve and clean up `owrtflash-ng`

- From the README.md:
"""owrtflash-ng.sh can be used to flash OpenWrt en mass on multiple
devices nearly at once, which are connected to a client at the same
switch."""

It features and supports i.e. flash via **http**-, **telnet**[1]- or
**ssh**-protocol over a **factory**-, **openwrt**-, or
**custom**[2]-firmware.


For what reason you ask? I.e. to deploy a bunch of routers with as
/little mechanical turk work/ as possible, to bootstrap a wibed
testbed or something like this.


The full README can be found at
https://github.com/L337hium/owrtconfig/blob/master/README.md#features

I dropped some notes about the limits of the tool and how to use it.
Documentation is not complete, yet. I just wanted to drop the info
about the existence of the tool early, so it might be found
interesting by others. I would like to test and use the tool for the
deployment of a wibed network next week.

An example run of the tools looks like this:

# Flashes a custom openwrt build over a virgin configured openwrt
# time ./owrtflash-ng.sh --nodes 0142 --from openwrt --to custom --sudo
2015-07-31 00:11:56 [info]  Checking for `sudo`
[sudo] password for ed:
2015-07-31 00:12:00 [info]  Checking requirements passed.
2015-07-31 00:12:00 [info]  Checking for `sudo`
2015-07-31 00:12:00 [log]   Loop over nodes '0142'.
2015-07-31 00:12:00 [log]   Next device in list: '0142'.
2015-07-31 00:12:00 [info]  *** 0142: Load node config file.
2015-07-31 00:12:00 [info]  *** 0142: Load generic defaults.
2015-07-31 00:12:00 [info]  *** 0142: Load hardware defaults for
'tl-wr841n-v8'.
2015-07-31 00:12:00 [info]  *** 0142: Load OpenWrt defaults.
2015-07-31 00:12:00 [info]  Resetting network
2015-07-31 00:12:00 [info]  *** 0142: Setting client IP to 192.168.1.100
.
2015-07-31 00:12:00 [info]  *** 0142: Setting arp table entry for
192.168.1.1 to a0:f3:c1:05:8a:c2.
2015-07-31 00:12:00 [info]  *** 0142: Testing network connection to
192.168.1.1 via arping.
2015-07-31 00:12:01 [info]  *** 0142: Network status: OK
2015-07-31 00:12:01 [info]  *** 0142: Load generic defaults.
2015-07-31 00:12:01 [info]  *** 0142: Load hardware defaults for
'tl-wr841n-v8'.
2015-07-31 00:12:01 [info]  *** 0142: Load OpenWrt defaults.
2015-07-31 00:12:01 [log]   *** 0142: Setting password via `telnet`.
2015-07-31 00:12:27 [info]  *** 0142: Checking `ssh` remote shell
login (Try 1/5).
2015-07-31 00:12:31 [log]   *** 0142: Checking `ssh` passed.
2015-07-31 00:12:31 [log]   *** 0142: Trying to flash with
'/home/ed/src/owrtconfig/firmware-images/openwrt/tl-wr841n-v8-sysupgrade
.bin'...
2015-07-31 00:12:36 [info]  *** 0142: Checking `ssh` remote shell
login (Try 1/5).
2015-07-31 00:12:38 [log]   *** 0142: Checking `ssh` passed.
2015-07-31 00:12:38 [info]  *** 0142: Installing `nohup.sh` to "0142"...
2015-07-31 00:12:41 [info]  *** 0142: Copying
"/home/ed/src/owrtconfig/firmware-images/openwrt/tl-wr841n-v8-sysupgrade
.bin"
to "0142"...
2015-07-31 00:12:48 [log]   *** 0142: Starting `sysupgrade`...
2015-07-31 00:12:48 [info]  Resetting network
2015-07-31 00:12:48 [log]   Loop over nodes finished.
2015-07-31 00:12:48 [info]  Exit

real    0m51.598s

For reasons _set_password_via_telnet hanged for a while on this run...
Normally you need around 15 seconds to _flash_over_openwrt_via_ssh,
and approximately 3 seconds to _flash_over_factory_via_http!

Feedback and more model support is highly appreciated!
Don't wonder about some old files in the repo, I still have to clean
up stuff which is not needed any more, because I totally rewrote the
original scripts, and started with a few different strategies which
turned out as not that good. But for now I thing it looks usable and
enhanceable.

Good night,
Bernd

- -- 
Bernd Naumann <bernd at kr217.de>

PGP:   0xA150A04F via pool.sks-keyservers.net
XMPP:  bn at weimarnetz.de

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVuq3CAAoJEEYW3OihUKBPdEAQAKeiCjVy+wpmrxktku5AwSw8
kYHGFtCoyJ807ATgOr/fRQ3GHvjNZgRWyvcxZTxN3vM8+iWHtoOx6hbW6mB+aqa4
JevS6kYej7QjqESHY2BA+cTRIEe4EYeE/6UDP6qVrTguh+S+tk/cT1oc8b52JDXB
WjEKuRE5VZ9lTUTASXA1MoOShuIfaqeynGjvXYAymt+Z2L6K4j0yOjFmI72vO2xL
2DkeKi9fk+kP2w5lGAW4iYiMs90aS1gTXpUgYQmgJcEeWTbNTepfr23wziVNQ24E
zYg1IigHH1ufHteqNbjoMpO69KsxqoKuxwimRouPIKuUhZWNg0pPJOMPkPbi2kPI
vtESoO4nDtqKvfMoYgt1sprt92huwOUGZr0PQmUbd6MPJ3CoAJDBRee2l4f/ReEM
VuHpAWLuHIgzSqjYzmZHLOcnGfTHNRABTRaHuBizMtwCi8b4tgZacPw/89J417re
foX0EkMT29Y6hCEjQuEfByPY17QAzQJd3Ut2FCf4wnQllT0yACCdgG98UJzxuNy8
yZfvy9VYHqfkB64h2r7/upNPHve0STh+nF4+u1xOW1f1olivH1ofuNA0d71cdXhF
L8AyxRZIYjAPEPIrzQV/vmzdOUikD7uAJgC5OcWiU4gFgUNbRRU96fcMLo+d90lZ
7VyRzh+zwrgWCpdfEiDH
=S2Qs
-----END PGP SIGNATURE-----


More information about the Battlemesh mailing list