Failed firmware update to 1.7.4452 on Vera Edge

#1

Hi,

I tried to update my Vera Edge to 1.7.4452 this morning and something went amiss. The firmware update downloaded and began. After waiting 20-25 minutes, the unit was not accessible so I rebooted it. It now boots but the UI is inaccessible returning a ’ 404 Not found’ when trying to access via http. I can ssh into the unit and looking at the logs in /tmp, it appears that there was an MD5 checksum failure during the upgrade process likely indicating firmware file corruption or something along those lines.

log.mios_firmware:
2019-05-12_05:46:42| 1457|MS|Mount storage partition with CMD: mount -t jffs2 /dev/mtdblock10 /storage
2019-05-12_05:46:43| 1457|MS|Successfully mounted /dev/mtdblock10 on /storage
2019-05-12_05:46:43| 1457|MS|Successfully mounted cmh-firmware on /storage
2019-05-12_05:46:43| 1457|MS|Successfully mounted cmh-backup on /storage
2019-05-12_05:46:43| 1483|CF|Checking package : mios-firmware-mtd files existance
2019-05-12_05:46:43| 1483|CF|File : /etc/functions_leds.sh FOUND
2019-05-12_05:46:43| 1483|CF|File : /etc/rc.d/S11mios_mount_firmware.sh FOUND
2019-05-12_05:46:43| 1483|CF|File : /etc/rc.d/S45mios_stor.sh FOUND
2019-05-12_05:46:43| 1483|CF|File : /etc/functions_usbdrive.sh FOUND
2019-05-12_05:46:43| 1483|CF|File : /etc/banner FOUND
2019-05-12_05:46:44| 1483|CF|File : /etc/init.d/mios_get_firmware.sh FOUND
2019-05-12_05:46:44| 1483|CF|File : /usr/bin/groups FOUND
2019-05-12_05:46:44| 1483|CF|File : /etc/init.d/mios_mount_firmware.sh FOUND
2019-05-12_05:46:44| 1483|CF|File : /etc/rc.d/S96mios_get_firmware.sh FOUND
2019-05-12_05:46:44| 1483|CF|File : /etc/init.d/mios_stor.sh FOUND
2019-05-12_05:46:44| 1483|CF|File : /etc/functions_firmware.sh FOUND
2019-05-12_05:46:44| 1483|CF|Package : mios-firmware-mtd OK
2019-05-12_05:46:44| 1483|CF|DONE
2019-05-12_05:46:44| 1518|MF|Details of mios mtd : BLOCKDEV=/dev/mtdblock9 , CHARDEV=/dev/mtd9 , FLASH_TYPE=nand
2019-05-12_05:46:44| 1518|MF|UsbStick is NOT INSTALLED
2019-05-12_05:46:44| 1518|MF|Got MAGIC=hsqs for MTD=mios
2019-05-12_05:46:44| 1518|MF|Match Found: hsqs == hsqs
2019-05-12_05:46:44| 1518|MF|MiOS MTD Magic found OK.
2019-05-12_05:46:44| 1518|MF|Check md5sum of /etc/cmh-firmware/mios-hooks.sh
2019-05-12_05:46:44| 1518|MF|ERROR: Mismatched md5sum of Firmware Script
2019-05-12_05:46:44| 1518|MF|Load firmware script: /etc/cmh-firmware/mios-hooks.sh
2019-05-12_05:46:44| 1518|MF|Loaded mios-firmware script for version: 1.7.4452
2019-05-12_05:46:44| 1518|MF|[MH]mount_mios function not loaded. Creating default one
2019-05-12_05:46:46| 1677|MS|Storage partition already mounted, no action necessary:
/dev/mtdblock10 on /storage type jffs2 (rw,relatime)
2019-05-12_08:09:04| 2007|GF|Details of mios mtd : BLOCKDEV=/dev/mtdblock9 , CHARDEV=/dev/mtd9 , FLASH_TYPE=nand
2019-05-12_08:09:04| 2007|GF|Request Mounting of MiOS squashfs
2019-05-12_08:09:04| 2068|MF|Details of mios mtd : BLOCKDEV=/dev/mtdblock9 , CHARDEV=/dev/mtd9 , FLASH_TYPE=nand
2019-05-12_08:09:04| 2068|MF|UsbStick is NOT INSTALLED
2019-05-12_08:09:05| 2068|MF|Got MAGIC=hsqs for MTD=mios
2019-05-12_08:09:05| 2068|MF|Match Found: hsqs == hsqs
2019-05-12_08:09:05| 2068|MF|MiOS MTD Magic found OK.
2019-05-12_08:09:05| 2068|MF|Check md5sum of /etc/cmh-firmware/mios-hooks.sh
2019-05-12_08:09:05| 2068|MF|ERROR: Mismatched md5sum of Firmware Script
2019-05-12_08:09:05| 2068|MF|Load firmware script: /etc/cmh-firmware/mios-hooks.sh
2019-05-12_08:09:05| 2068|MF|Loaded mios-firmware script for version: 1.7.4452
2019-05-12_08:09:05| 2068|MF|[MH]mount_mios function not loaded. Creating default one
2019-05-12_08:09:05| 2007|GF|ERROR: Failed again to mount the MiOS mtd

I called in and spoke with tech support but the guy was unable to help since remote access is not available in its current state. He said I’d have to call back on Monday when people with experience with this type of issue are available.

Anyone else experienced this type of issue before and have any suggestions for an easy / quick fix? I assume the path forward involves manually pulling down the firmware again and reinitiating the upgrade from the command line via SSH.

Thanks,
Tim

#2

What do you see when you SSH in and run this command?

df -h

#3

Hi, thank you for the response.

I see the following:

Filesystem Size Used Available Use% Mounted on
rootfs 9.4M 2.4M 7.0M 25% /
/dev/root 9.5M 9.5M 0 100% /rom
tmpfs 61.9M 116.0K 61.7M 0% /tmp
/dev/mtdblock6 9.4M 2.4M 7.0M 25% /overlay
overlayfs:/overlay 9.4M 2.4M 7.0M 25% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock10 64.8M 3.2M 61.6M 5% /storage
/dev/mtdblock10 64.8M 3.2M 61.6M 5% /etc/cmh-firmware
/dev/mtdblock10 64.8M 3.2M 61.6M 5% /etc/cmh-backup

#4

I was actually able to fix this myself this evening. Looking again back at the logs, I noticed the error regarding the md5 checksum of the mios-hooks.sh file.

Log output:
2019-05-12_08:09:05| 2068|MF|Check md5sum of /etc/cmh-firmware/mios-hooks.sh
2019-05-12_08:09:05| 2068|MF|ERROR: Mismatched md5sum of Firmware Script
2019-05-12_08:09:05| 2068|MF|Load firmware script: /etc/cmh-firmware/mios-hooks.sh
2019-05-12_08:09:05| 2068|MF|Loaded mios-firmware script for version: 1.7.4452
2019-05-12_08:09:05| 2068|MF|[MH]mount_mios function not loaded. Creating default one
2019-05-12_08:09:05| 2007|GF|ERROR: Failed again to mount the MiOS mtd

Looking in the /storage/cmh-firmware/Iatest_firmware.conf file, was able to see that the firmware upgrade actually pulls down mt7620a_Luup_ui7-1.7.4452-en-mios.sh which eventually gets renamed to mios-hooks.sh in /storage/cmh-firmware. I then manually pulled down the file from https://dl.mios.com/rl/729 and compared the downloaded file versus mios-hooks.sh on the Vera in a text editor. Doing this, it was clear that the mios-hooks.sh file was truncated for some reason at line #663 hence the reason for the checksum failure. On a hunch, I copied over the freshly downloaded version manually, renamed to replace the existing mios-hooks.sh file in /storage/cmh-firmware, and then rebooted.

After this, the firmware update completed successfully and I am now up and running. It is strange that the upgrade script got borked somehow but it is good that the upgrade procedure includes a check to confirm the integrity of the file.

Tim