EAM Platinum firmware recovery
Contents
Recovery procedure
This recovery procedure can be useful in two specific situations: if the root password has been forgotten, or if the firmware has become damaged by a partial upgrade. If this procedure is not able to recover your unit, then the unit must be returned to Guralp Systems for reflash. Please contact support for details and to arrange an RMA.
Preparation
Equipment required:
- Console cable (either a 12-way mil-spec to DE9 for digital sensors or metal cylindrical units, or astandard serial cable for Peli-case variants).
- Laptop or PC with serial port or USB to RS232 adapter.
- Terminal emulator (e.g. PuTTY under Windows or
minicomunder Linux).
Physical access to the unit will be required.
If reflashing, the unit will need to retrieve its firmware over the network (no other option is available; the recovery environment has neither PPP nor USB support). The unit will either require Internet access (to rsync.guralp.com TCP port 873/rsync) or access to a local rsync server with a copy of the firmware on (refer to Chapter 4 of the Platinum manual for details on setting up a local mirror).
Booting
- Connect the console cable to the EAM and to the laptop/PC (the “recovery machine”).
- Open the terminal emulator on the recovery machine and set it to 38400 baud, 8N1.
- Apply power to the EAM.
- Almost immediately, there should be some output. Approximately two screens (2×25 lines) of output will be displayed.
- There will be a series of yes or no questions. Answer no (by pressing the ‘n‘ key) to each question. Very old bootloaders have some minor differences, but the questions should be as below. If any question is accidentally answered yes, it is safe to simply remove and re-apply power, starting the process again.
Boot-up procedure questions (answer ‘n‘):
Attempt rsync update ? (y/N) n Boot main via kexec ? (Y/n) n Boot main via switch_root ? (y/N) n Mount successful but no boot options available Attempt scripted NAND device reinstall ? (y/N) n
At this point, you are now at a shell prompt and can continue the process as below:
/ #
Changing the root password
It is not generally possible to recover the root password, but it can be changed to a new one. Check the version of firmware installed:
/ # cat /mnt/etc/build.version # Overall build version BUILD_LABEL="platinum-stable" BUILD_VERSION="10071"
Look at the number in BUILD_VERSION to determine which procedure to follow.
Builds ≥ 10000
Copy and paste these three commands. They must be exact:
sed -i /mnt/etc/shadow -e '/^root:/s/.*/root:$1$lJerdeXb$pNDmzGchfA5mNrA1u.60m1:14666:0:99999:7:::/' sed -i /mnt/etc/shadow_http -e '/^root:/s/.*/root:a5f39cb2039fd48d39ad69e0be49717a:15202:0:99999:7:0:0:0/' sync
After power cycling, it will then be possible to use the username root and the password rootme.
Builds < 10000
Copy and paste these two commands. They must be exact:
sed -i /mnt/etc/passwd -e ',^root:,s,.*,root:iWuSGrtezXz0E:0:0:root:/root:/bin/bash,' sync
After power cycling, it will then be possible to use the username root and the password rootme for either ssh or logging in via the serial port. However it will not be possible to use this for the web interface; you must log in using one of these two methods and then change the password. Only then will the new password work on the web interface.
Reflashing the firmware
If the firmware has really become damaged, to the point that it is no longer possible to boot the unit, then it is possible to erase everything and reflash it. This procedure is involved, and you may prefer to return the unit to Guralp support, but instructions are presented below for users willing to attempt the procedure.
Set up networking
If using DHCP, run:
ifconfig lo 127.0.0.1 route add -net 127.0.0.0 netmask 255.0.0.0 lo udhcpc --script /etc/udhcpc.sh --now --interface eth0
If assigning statically, find the correct values, and then run:
ifconfig eth0 192.168.0.2 netmask 255.255.255.0 route add default gw 192.168.0.1
Set system date
Must be set to something sensible, because otherwise created files could end up with the wrong modification time, which will cause various malfunctions. In the command below replace:
mm- Month (01 to 12)
dd- Day (01 to 31)
HH- Hour (00 to 23)
MM- Minute (00 to 59)
YYYY- Year (2011 upwards)
date mmddHHMMYYYY
Erase NAND flash
This will destroy all your settings and data in the buffer (it won’t affect data recorded on any mass storage device). There is no way to retrieve anything from the unit after running these commands.
umount /mnt flash_eraseall /dev/mtd3 mount -t yaffs /dev/mtdblock3 /mnt
The flash_eraseall command will likely complain about multiple bad blocks and failures. This is normal for NAND flash. However, it should tick all the way up to 100%. If it aborts early then there is potentially a hardware problem. The last mount command must succeed, or there is a problem somewhere and the unit will likely need to be returned to GSL support.
Copy files on
In the example below it may be necessary to replace rsync.guralp.com with its IP address (currently 80.68.92.160) or with the name of your local rsync server. This step will download about 50Mb of image data.
rsync --super --verbose --stats --human-readable --progress \
--itemize-changes --recursive --times --links --perms \
--chmod=ugo+r,+X --force \
rsync://rsync.guralp.com/platinum-stable/CMG-DCM-mk4-eabi/ /mnt/
If this step fails at startup (temporary failure in name resolution, no route to host, etc.) then something is wrong with the networking setup. If it fails part way through, or at the end, something is likely wrong with the unit and it will need to be returned to the factory.
Otherwise, create some necessary files:
cp -a /dev/null /mnt/dev cp -a /dev/zero /mnt/dev cp -a /dev/console /mnt/dev mkdir -p /mnt/etc/conf.local echo set_hwclock `date +%s` > /mnt/.magic_upgrade sync
Each of these commands is critical and must not fail.
Finalise
Now it is safe to power cycle the unit. You can also boot the new system without power cycling by running:
kexec -l /mnt/boot/zImage kexec -e
You can watch its boot progress on the console port. The first boot can take several minutes as the system will have to run through some basic initialisation procedures. However, you should eventually have a login: prompt, at which point you can log in (root and rootme) and refer to the Platinum manual to reconfigure the device.
