Upgrading pre-EABI EAMs with unreliable Internet connections

This procedure only applies when the current firmware build is 3801 or lower. If your current build is greater than 3801, please follow this link instead.

In order to upgrade from release 3801 (or earlier) of Platinum to the most recent stable release, there is an extra step required on EAM units. This is because of a change to the Linux system architecture (ABI), which necessitates replacing each file on the unit. A special script has been added to the 3801 release to do this so the system must first be brought up to build 3801 before it can be upgraded to the latest release. For more information about the ABI changes, please see the Background section of this document.

If your EAM, DM24SxEAM or *TDE instrument has a slow or intermittent Internet connection, there is a possibility of problems occurring during any firmware upgrades. The system can enter a fault state when an upgrade takes a significantly long time or is interrupted. To guard against this, it is possible to download a mirror copy of the firmware onto the file-system of the EAM itself. It can then upgrade itself using this copy as the upgrade source. The process is essentially identical to using a local mirror site with the exception that it uses the device itself as its own mirror server.

The system should have access to the Internet during the download steps but it does not need Internet access while it is actually upgrading. If the download process is interrupted, it can be easily restarted and it will continue from the point at which it failed. The operation of the device is not affected during the download (other than by creating a bandwidth requirement) so this process can be repeated safely and incrementally until it is complete.

Platinum systems 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.

To upgrade one of these systems using itself as its own upgrade mirror involves seven steps:

  1. Downloading the build 3801 mirror content ;
  2. Setting up the system as a local rsync server ;
  3. Configuring the system to use itself as an upgrade server ;
  4. Performing the upgrade to 3801 ;
  5. Downloading the most recent mirror content ;
  6. Re-starting the rsync server ;
  7. Performing the EABI upgrade to the latest release .

If your system is already running firmware build 3801, you can skip steps one, four and six.

The procedure is slightly different for systems with different architectures so the instructions have been split into separate sets. This set only covers EAMs, DM24SxEAM and *TDE instruments with early firmware, as explained in the note above. If you are attempting to upgrade an EAM with more modern firmware (>3801), a MkⅡ NAM or an Affinity, please select one of the links below:

Downloading the build 3801 mirror content

It is essential to ensure that sufficient space is available before starting the download step.

The mirror content occupies a significant amount of disk space, so it is important to check the available space before proceeding. To check the space available, log on to the command line of your system and type the command

df -h

The output will normally consist of a table with one line of content, such as:

EAM1234 ~ # df -h Filesystem Size Used Available Use% Mounted on /dev/root 512.0M 190.3M 321.8M 37% / EAM1234 ~

If more than one line is displayed, look for the row where the value in the Mounted on column is /. The free space is shown in the Available column of the same row. In the example above, it is 321.8 MB

These systems require around 100 MB of free space to store the larger of the two upgrade images. Only proceed if you have enough space.

Next, enter the following command sequence to download the build 3801 mirror content. This content includes the commands necessary to perform the EABI upgrade, which we will perform later.

mkdir /home/Pt-firmware-mirror.local cd /home/Pt-firmware-mirror.local GSLSRC=rsync.guralp.com/platinum-stable/CMG-DCM-mk4 rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC .
Be careful not to omit the final ‘.’ or the space before it in the rsync command above.

These commands download the appropriate firmware image from Güralp’s server. If a command fails for any reason, it can be repeated. It causes no harm to repeat this command even if it appears to have succeeded.

The final output from a successful download looks like this (although the numbers may be different):

⋮ CMG-DCM-mk4/var/spool/recdata/ CMG-DCM-mk4/var/spool/recdata/.keep CMG-DCM-mk4/var/spool/to-rdisk/ CMG-DCM-mk4/var/spool/to-rdisk/.keep CMG-DCM-mk4/var/tmp/ CMG-DCM-mk4/var/tmp/.keep sent 26,713 bytes received 49,956,440 bytes 6,664,420.40 bytes/sec total size is 49,856,630 speedup is 1.00 EAM1234 ~ #

A repeated download, after a successful download, looks like this (although the numbers may be different):

EAM1234 ~ # rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC . receiving incremental file list sent 289 bytes received 41,859 bytes 84,296.00 bytes/sec total size is 49,856,630 speedup is 1,182.89 EAM1234 ~ #

Problems?

The most common problems experienced at this stage are:

rsync reports “Temporary failure in name resolution

If you see error messages like

rsync: getaddrinfo: rsync.guralp.com 873: Temporary failure in name resolution rsync error: error in socket IO (code 10) at clientserver.c(122) [receiver=3.0.2]

it means that the Domain Name Service (DNS) client is misconfigured. If you are running DHCP, this may be a problem with your DHCP server not providing the address of a nameserver (or providing an incorrect one). If you are using static addressing, check and correct the nameserver by editing the file /etc/resolv.conf. Please contact if you need advice with this step.

rsync reports “Network is unreachable

If you see error messages like

rsync: failed to connect to rsync.guralp.com: Network is unreachable (101) rsync error: error in socket IO (code 10) at clientserver.c(122) [receiver=3.0.2]

it means that the network routing is misconfigured. If you are running DHCP, this may be a problem with your DHCP server not providing a default route (or providing an incorrect one). If you are using static addressing, check and correct the default route using the “Interfaces” short-cut from the “Networking” menu of the web interface.

rsync reports “rsync error

If you see error messages like

rsync error: received SIGINT, SIGTERM or SIGHUP (code 20) at rsync.c(541)

the most common cause is a firewall blocking traffic on the rsync port. Ask your network administrator to permit the EAM to open TCP connections to host rsync.guralp.com on port 873.

Setting up an rsync server

The rsync server is configured by creating the file /etc/rsyncd.conf using the following commands:

cat >/etc/rsyncd.conf <<EOF port = 61616 [platinum-local-mirror] path = /home/Pt-firmware-mirror.local comment = Platinum firmware numeric ids = yes log file = /var/log/rsync.log timeout = 600 hosts allow = * uid = 0 gid = 0 EOF

You should also create a back-up copy for use later, so enter:

cp /etc/rsyncd.conf /etc/rsyncd.conf.local

Once these files are in place, you should start the rsync server with the command

rsync --daemon

Configuring the upgrade system to use the local server

Create the file /etc/conf.d/upgrade.local using the following commands:

cat >/etc/conf.d/upgrade.local <<EOF RSYNC_HOST="localhost" RSYNC_PORT="61616" RSYNC_MODULE="platinum-local-mirror" RSYNC_ADDITIONAL_OPTS="--no-delay-updates --delete-during --exclude /etc/rsyncd.conf" EOF

Perform the upgrade to build 3801

The system can now be updated from the mirror by using the upgrade command. It is recommended that this be performed in the "screen" environment, which will protect the underlying process if the connection is lost during the upgrade. A lost connection might otherwise terminate the upgrade part-way through, which could render the hardware unbootable.

To proceed, type the command

screen

The screen program will print a page-full of start-up information followed by [Press Space or Return to end.]". Press spacebar to continue: you will be presented with the command prompt again. Now enter the command

upgrade

to initiate the process.

If you do lose connection to the EAM during the upgrade process, the upgrade will continue to run in the background if it can. If this happens, log in again when possible and issue the command

screen -RR

You should then be able to resume your session from where you were disconnected.

Once the upgrade has completed successfully, the system should be rebooted, either by using the web interface or, from the command-line, with the command reboot

Downloading the most recent mirror content;

Once the system has rebooted, log in again.

A reboot after a firmware upgrade takes a lot longer than a normal reboot because various post-upgrade scripts need to run and a new SSH host key needs to be generated. This process can take several minutes.
It is essential to ensure that sufficient space is available before starting the second download step.

Again, the mirror content occupies a significant amount of disk space, so it is important to check the available space before proceeding. To check the space available, log on to the command line of your system and type the command

df -h

The output will normally consist of a table with one line of content, such as:

EAM1234 ~ # df -h Filesystem Size Used Available Use% Mounted on /dev/root 512.0M 190.3M 321.8M 37% / EAM1234 ~

If more than one line is displayed, look for the row where the value in the Mounted on column is /. The free space is shown in the Available column of the same row. In the example above, it is 321.8 MB

These systems require around 100 MB of free space to store the second upgrade images. If you do not have enough space at this point, delete the previous mirror content with the command:

cd /home/Pt-firmware-mirror.local rm -r CMG-DCM-mk4/

Check the available space again to ensure that it is safe to proceed. If you do not have enough space, contact for advice.

Now enter the following command sequence to download the mirror content for the EABI upgrade:

cd /home/Pt-firmware-mirror.local GSLSRC=rsync.guralp.com/platinum-stable/CMG-DCM-mk4-eabi rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC .
Be careful not to omit the final ‘.’ or the space before it in the rsync command above.

These commands download the appropriate firmware image from Güralp’s server. If a command fails for any reason, it can be repeated. It causes no harm to repeat this command even if it appears to have succeeded.

The final output from a successful download looks like this (although the numbers may be different):

⋮ CMG-DCM-mk4-eabi/var/spool/recdata/.keep CMG-DCM-mk4-eabi/var/spool/to-rdisk/ CMG-DCM-mk4-eabi/var/spool/to-rdisk/.keep CMG-DCM-mk4-eabi/var/tmp/ CMG-DCM-mk4-eabi/var/tmp/.keep sent 52,768 bytes received 91,126,040 bytes 6,753,985.78 bytes/sec total size is 90,933,054 speedup is 1.00 EAM1234 ~ #

A repeated download, after a successful download, looks like this (although the numbers may be different):

EAM1234 ~ # rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC . receiving incremental file list sent 418 bytes received 74,456 bytes 49,916.00 bytes/sec total size is 90,933,054 speedup is 1,214.48 EAM1234 ~ #

If you have problems downloading the content, please refer back to the Problems? section above.

Re-starting the rsync server;

The rsync server configuration will have been overwritten by the previous upgrade so we need to restore it from the backup copy that we took earlier. Enter the command

cp /etc/rsyncd.conf.local /etc/rsyncd.conf

to restore from the backup and then re-start the rsync server with the command

rsync --daemon

Performing the EABI upgrade to the latest release.

The EABI upgrade process should also be performed within the "screen" environment in order to protect it from unwanted disconnections.

To proceed, type the command

screen

The screen program will print a page-full of start-up information followed by [Press Space or Return to end.]". Press the space-bar to continue: you will be presented with the command prompt again. Now enter the command

./usr/sbin/EAM-upgrade-to-eabi.sh

to upgrade the system to use EABI. This will copy the files from the downloaded firmware image into the correct locations, displaying its progress as it goes. This process will take only 2 or 3 minutes.

If you do lose connection to the EAM during the upgrade process, the upgrade will continue to run in the background if it can. If this happens, log in again when possible and issue the command

screen -RR

You should then be able to resume your session from where you were disconnected.

Once the upgrade is complete, you will see the messages:

(you can safely ignore Segmentation fault messages above) :::: Rebooting to complete upgrade.

At this point the system will reboot itself automatically and complete the upgrade process (part of which involves automatically migrating all the existing configuration settings to the new system).

A reboot after a firmware upgrade takes a lot longer than a normal reboot because various post-upgrade scripts need to run and a new SSH host key needs to be generated. This process can take several minutes.

When the unit has rebooted, the upgrade is complete.

EABI background

The ABI of a machine specifies common conventions such as the purpose of each CPU register, how functions are called, how data structures are laid out in memory and so on. It is a contract between the operating system (Linux) and the applications that run on it (Platinum). In the last few years, an improved ABI for the ARM architecture has been developed. This brings some incremental advantages to the system itself but the primary user-visible change will be faster floating point emulation.

This newly-developed ABI is called the GNU EABI. The EAM was developed before EABI was stable, but the older ABI (now dubbed the OABI) has slowly been phased out, to the point that more recent compiler and C library versions are difficult (if not impossible) to use with it. This has necessitated a change. Unfortunately, this involves changing all library and executable files on the system, since EABI and OABI are not at all compatible.

Along with the change to EABI, this upgrade also moves to using the latest stable releases of gcc (4.5 branch) and eglibc (2.12 branch).

Further Reading

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

For more information, first contact your local distributor or email .