Upgrading CMG-EAM units from a local mirror

If your CMG-EAMs (or Platinum CMG-DCMs) only have access to a local network, you can create a local mirror of the Güralp software repository and have your EAMs/DCMs use this for upgrading. This procedure also applies to CMG-NAMs and CMG-NAM64s.

EAMs use the rsync protocol to update their firmware to the latest revision. rsync is an extraordinarily flexible tool but can be rather complex. The upgrade script on the EAM is a front-end to rsync which is used to hide this complexity and ensure the safe use of the protocol.

Setting up a mirror involves three steps:

  • Downloading the mirror content;
  • Setting up a local rsync server; and
  • Configuring the client EAMs to use the new server.

Instructions for Linux/Unix computers

Downloading the mirror content

The mirror can occupy a significant amount of disk space, depending on the which architectures you need to support. See the sections for each architecture (below) for the current space requirements. You should pick a disk partition with ample space in which to store your own copy. In order to simplify the download, we recommend that you start with an empty directory each time. If you wish to make a fresh copy after a new firmware release, it is much easier to create this in an empty directory than to "update" an existing mirror. You can keep multiple, simultaneous versions of the firmware if you wish and tell each EAM which version to use when upgrading.

The server on which you create the mirror should have access to the internet during the download step but does not need internet access while it is acting as an upgrade server. It does, of course, need to be accessible by your networked EAMs. It is possible to create the mirror content on a removeable disk attached to an internet-connected computer and then move the disk to a different computer when it is to be served.

Create the mirror directory and use the cd command to make it your current directory. As root, enter one or more of the following command sequences to download the mirror content. Each sequence downloads the files for a particular architecture. If you know, for example, that you will never want to upgrade a CMG-NAM64, you can omit the commands for this architecture.

Note: Be careful not to omit the final ‘.’ or the space before it in the rsync commands below.

CMG-DCMs

This architecture currently requires around 50MB of disk space for the mirror.

GSLSRC=rsync.guralp.com/platinum-stable/CMG-DCM-mk2x
rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC .

CMG-EAMs

This architecture currently requires around 54MB of disk space for the mirror.

GSLSRC=rsync.guralp.com/platinum-stable/CMG-DCM-mk4
rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC .

CMG-NAMs

This architecture currently requires around 94MB of disk space for the mirror.

GSLSRC=rsync.guralp.com/platinum-stable/CMG-NAM
rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC .

CMG-NAM64s

This architecture currently requires around 125MB of disk space for the mirror.

GSLSRC=rsync.guralp.com/platinum-stable/CMG-NAM64
rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC .

Setting up a local rsync server

Your local rsync server is configured by creating the file /etc/rsyncd.conf. If the serving host already runs an rsync server, you should modify this file (basically, add an extra module) in order to allow access from the EAMs to the mirror directory and we assume that you have the knowledge to do this without further assistance. This section covers setting up a new, dedicated rsync server.

You will need to choose a TCP port number which will not conflict with another service on your network. The port number should be greater than 1024 in order to avoid additional complexity. Consult your network administrator for an available port or simply try 61616 and, if you get an error saying that the port is in use when you attempt to start the server, choose a different random number in the range 49152 - 65535. 61616 will be used in the following example and should be replaced with the port number you have chosen or been allocated. If there are firewalls between your server and the EAMs, you will need to open channels through them for this port.

You will also need to choose a module name for the server. This can be any descriptive string but, for simplicity, it is best to stick to numbers, lower-case letters and hyphens (-). The name platinum-local-mirror has been used in the following example and should be replaced with the module name you have chosen.

Create the file /etc/rsyncd.conf with the following contents:

port = 61616
[platinum-local-mirror]
path = /path/to/your/local/mirror/directory
comment = GSL-EAM firmware
numeric ids = yes
log file = /path/to/writeable/log/file
timeout = 600
hosts allow = *

Consult the manual page for rsyncd.conf(5) for details of further options you can use in this file, including security improvements that you may wish to put in place.

Once the /etc/rsyncd.conf file is in place, you can start the rsync server with the command

sudo rsync --daemon

If you want to run the rsync server permanently, it is possible to start it via inetd, xinetd or an rc script. Consult the manual page for rsyncd.conf(5) for further details.

Configuring the client EAMs to use the new server

On each EAM to be upgraded, create the file /etc/conf.d/upgrade.local with the following content:

RSYNC_HOST="address.of.my.server"
RSYNC_PORT="61616"
RSYNC_MODULE="platinum-local-mirror"
replacing:
  • address.of.my.server with the DNS name or IP address of the mirror server;
  • 61616 with the port number you chose earlier; and
  • platinum-local-mirror with the module name you chose earlier;

The EAMs can now be updated from the mirror by using the upgrade command. Note that the files /etc/conf.d/upgrade.local on each EAM will not be disturbed by the upgrade process and, so, only need to be created once.

Instructions for Windows computers

The procedure for building a mirror site on a windows computer is essentially the same as for Linux/Unix, although the rsync program (and the cygwin library needed to run it) typically need to be installed and additional steps are required to run rsync as a service (or daemon, in Linux terminology). Instructions for setting up rsync in daemon mode under Windows are available here.

Once rsync is running as a daemon, you can follow the Unix/Linux instructions for setting up the mirror and client EAMs. Remember to retain the lines

use chroot = false
strict modes = false

at the top of /etc/rsyncd.conf on the server.

If you use Windows Firewall, you may need to configure it to allow incoming access to the port number that you have chosen.

Further Reading

rsync is a fascinating and elegant solution to many file transfer problems. Further information is available from the rsync documentation page.

Content and images © 2010 Güralp Systems unless otherwise stated. Comments to the webmaster.