Upgrading CMG-EAM units from a local mirror
If your CMG-EAMs, Platinum CMG-DCMs or CMG-NAM units only have access to a local network, you can create a local mirror of the Guralp software repository and have your EAMs/DCMs use this for upgrading. This procedure requires a machine running Linux to host the mirror repository.
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.
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. Start with an empty directory each time. If you wish to make a fresh copy after a new firmware release, remove the old copy first, so that you start in an empty directory. 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 removable disk attached to an Internet-connected computer and then move the disk to a different computer when it is to be served. Note: If you do this, the removable disk must be formatted with a proper file-system such as ext2, XFS or btrfs. FAT- or NTFS-formatted file-systems will not work correctly.
Create the mirror directory and use the cd command to make it your current directory. 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
There are currently two sets of firmware available for the CMG-EAM: a frozen image of build 3801 (for users who do not yet wish to upgrade to post 10,000 builds) and the latest build.
If you do not wish to upgrade beyond build 3801 yet, the files for build 3801 require around 53MB of storage space for the mirror. Use the following commands:
GSLSRC=rsync.guralp.com/platinum-stable/CMG-DCM-mk4
rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC .
If the systems being upgraded are already at build 10,000 or later, you only require the latest build, which occupies around 70MB of space. Use the following commands:
GSLSRC=rsync.guralp.com/platinum-stable/CMG-DCM-mk4-eabi
rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC .
If you are upgrading systems from earlier than build 3801 to the current build, you will need both sets of firmware, requiring around 123MB of storage. Use the following commands (note the additional punctuation):
GSLSRC='rsync.guralp.com/platinum-stable/CMG-DCM-mk4*'
rsync -EgHloprtv --exclude resolv.conf rsync://”$GSLSRC” .
For more information about upgrading from builds earlier than 3801 to the latest build, please see this page.
CMG-NAM-mk2 (1U rackmount)
This architecture currently requires around 94MB of disk space for the mirror.
GSLSRC=rsync.guralp.com/platinum-stable/CMG-NAM-mk2
rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC .
CMG-NAMs (3U rackmount)
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 .
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.
Further Reading
rsync is a fascinating and elegant solution to many file transfer problems. Further information is available from the rsync documentation page.