Zum Inhalt springen
Die Artikel im Archiv-Namespace sind veraltet und werden nur noch aus historischen Gründen aufbewahrt.

Archiv:Kamikaze/RemoteUpdate

Aus wiki.freifunk.net

Snapshots ab der Version 2009/06/30 07:14 haben das Kommandozeilenprogramm "remote-update" zum automatischen Update der Firmware integriert. Zur Zeit werden die Architekturen "brcm-2.4", "atheros" und experimentell "ar71xx" unterstützt.

Benutzung

Das Programm unterstützt mehrere Betriebsmodi und einige Optionen um das Verhalten zu steuern.

Auf Update prüfen

Um auf die Verfügbarkeit von Firmware-Updates zu prüfen, reicht es das Programm mit der "-c" Option auszuführen.

Beispiel für aktuelle Firmware:

root@OpenWrt:~# remote-update -c
Architecture: brcm-2.4
Repository:   http://dev.luci.freifunk-halle.net/freifunk-snapshots
Local version 200906300714 is up to date

Beispiel für verfügbares Update:

root@OpenWrt:~# remote-update -c
Architecture: brcm-2.4
Repository:   http://dev.luci.freifunk-halle.net/freifunk-snapshots
Update available!
Local:  200906271718
Remote: 200906300714
--
Freifunk Snapshot
Built 2009/06/30 07:14 on ff0
OpenWrt 8.09.1 (r16280)
LuCI Branch 0.9 (r4947)

Image nur herunterladen

Ruft man das Programm mit der "-w" Option auf, so wird das Image nur heruntergeladen aber nicht geflasht. Dies ist nützlich, um das passende Image für das jeweilige Gerät herauszufinden.

Beispiel:

root@OpenWrt:~# remote-update -w
Architecture: brcm-2.4
Repository:   http://dev.luci.freifunk-halle.net/freifunk-snapshots

About to download openwrt-brcm-2.4-squashfs.trx. Continue? [y] 
Downloading openwrt-brcm-2.4-squashfs.trx ... done
Verifying openwrt-brcm-2.4-squashfs.trx ... done
Image saved in '/tmp/remote-upgrade.img'

Interaktives Firmware-Update

Wird das Programm ohne weitere Argumente aufgerufen, lädt es zunächst das Image herunter und startet anschließend den Flash-Vorgang:

root@OpenWrt:~# remote-update 
Architecture: brcm-2.4
Repository:   http://dev.luci.freifunk-halle.net/freifunk-snapshots

About to download openwrt-brcm-2.4-squashfs.trx. Continue? [y] 
Downloading openwrt-brcm-2.4-squashfs.trx ... done
Verifying openwrt-brcm-2.4-squashfs.trx ... done

Keep configuration files? [y] 

About to start flashing!
Hit <Enter> to continue or <Ctrl-C> to abort.

Stopping service lucid ... done
Starting sysupgrade in background ... done
root@OpenWrt:~# Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.

Image von bestimmter Adresse laden

Möchte man ein anderes Image benutzen und nicht das Repository, so kann man eine andere Adresse mit Hilfe des "-u" Parameters angeben. Falls unter der angegebenen Adresse keine "md5sums" Datei verfügbar ist, sollte die Image-Prüfung mittels "-v" Parameter abgeschaltet werden:

root@OpenWrt:~# remote-update -v -u http://download.berlin.freifunk.net/kamikaze/brcm-2.4/openwrt-brcm-2.4-squashfs.trx 

About to download openwrt-brcm-2.4-squashfs.trx. Continue? [y] 
Downloading openwrt-brcm-2.4-squashfs.trx ... done

Keep configuration files? [y] 

About to start flashing!
Hit <Enter> to continue or <Ctrl-C> to abort.

Stopping service lucid ... done
Starting sysupgrade in background ... done
root@OpenWrt:~# Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.

Weitere Optionen

Es gibt noch eine Reihe weitere Optionen um das Programmverhalten zu steuern. Nachfolgend ist die eingebaute Hilfe abgebildet:

root@OpenWrt:~# remote-update -h

Usage:
  remote-update -h
  remote-update -c
  remote-update -w
  remote-update [-d] [-n] [-v] [-y] [-s <sleep seconds>] [-u <update url>]

Actions:
  -h    Display this help message and exit.
  -c    Check for firmware update and exit.
  -w    Fetch image and exit, do not perform flash write.

Options:
  -d    Do not detach from terminal.
  -n    Do not backup configuration.
  -v    Skip verification of downloaded image.
  -y    Assume defaults for all questions.

  -s <seconds>
    Sleep given amount of seconds before invoking firmware burn.
    If ommitted and '-y' is not used, 5 seconds are assumed.

  -u <url>
    Fetch firmware image from given url. A file "md5sums" is expected
    in the same remote directory. If there is no such file, use -v to
    suppress verification.

Technische Details

  • Das Repository ist in /etc/config/freifunk unter der Sektion config defaults upgrade, Option repository konfiguriert.
  • Der Shell-Source-Code liegt in /usr/sbin/remote-update.