Turris Omnia: sysupgrade: Unable to install OpenWrt

I asked this question on The turris forums and someone suggested that this was a better place to ask.

I want to install openwrt on my Turris Omnia.

I tried the instructions I found on the openwrt wiki: https://openwrt.org/toh/turris_cz.nic/turris_cz.nic_omnia

Method 1 - USB 'medkit' image without serial

  1. Copy openwrt-mvebu-turris-omnia-sysupgrade.img.gz and omnia-medkit-openwrt-mvebu-turris-omnia-initramfs.tar.gz to the root of a USB flash drive formatted with FAT32 / ext2/3/4 / btrfs / XFS. Note that the medkit MUST be named omnia-medkit.tar.gz*
  2. Disconnect other USB devices from the Omnia and connect the flash drive to either USB port.
  3. Power on the Omnia and hold down the rear reset button until 4 LEDs are illuminated, then release.
  4. Wait approximately 2 minutes for the Turris Omnia to flash itself with the temporary image, during which LEDs will change multiple times.
  5. Connect a computer to a LAN port of the Turris Omnia with a DHCP client
  6. (if necessary) ssh-keygen -R 192.168.1.1
  7. ssh root@192.168.1.1 ; mount /dev/sda1 /mnt ; sysupgrade /mnt/openwrt-mvebu-turris-omnia-sysupgrade.img.gz
  8. Wait another minute for the final OpenWrt image to be flashed. The Turris Omnia will reboot itself and you can remove the flash drive.

I got stuck on step 7.

root@turris:/mnt# sysupgrade ./openwrt-18.06.4-mvebu-cortexa9-turris-omnia-sysupgrade.img.gz
Firmware upgrade is not implemented for this platform.
root@turris:/mnt#

So I tried resetting uboot by interfacing via serial.

Hit any key to stop autoboot: 0
=> env default -a
Resetting to default environment
=> saveenv
Saving Environment to SPI Flash...
SF: Detected S25FL164K with page size 256 Bytes, erase size 64 KiB, total 8 MiB
Erasing SPI flash...Writing to SPI flash...done
=>

I have seen this This post already but simply fixing uboot didn't fix my problem.

I have not tried the serial and TFTP method yet because I am not familiar with TFTP at all and I was hoping there was a solution for the problem with sysupgrade.

Does anyone know why I am having this problem?

I

Since this being an upgrade procedure, as opposed to installation, the info

would imply that a prerequisite condition for an upgrade is not met - see source code

https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/base-files/files/sbin/sysupgrade;hb=9437012b9ee4dc550e42665b71902cf885169100#l291

Perhaps using the installation process instead will solve the matter

https://openwrt.org/docs/guide-user/installation/generic.flashing

The download for installation (cited in the aforementioned wiki) points to another file

http://downloads.openwrt.org/releases/18.06.4/targets/mvebu/cortexa9/openwrt-18.06.4-mvebu-cortexa9-turris-omnia-initramfs-kernel.bin

than for upgrade

http://downloads.openwrt.org/releases/18.06.4/targets/mvebu/cortexa9/openwrt-18.06.4-mvebu-cortexa9-turris-omnia-sysupgrade.img.gz

Are you absolutely sure that you flashed the right medkit in steps 1-4?

https://downloads.openwrt.org/releases/18.06.4/targets/mvebu/cortexa9/omnia-medkit-openwrt-18.06.4-mvebu-cortexa9-turris-omnia-initramfs.tar.gz

The reason I am asking is your prompt on step 7:

root@turris:/mnt# sysupgrade ....

I'd guess that if the previos steps had gone right, you would have booted off the above-mentioned OpenWRT ramdisk image, and the default hostname in that image would certainly not have been "turris"...

It looks to me that you still were on TurrisOS at step 7, and that certainly won't work.

1 Like

You are correct. I had not flashed the openwrt medkit image. The wiki page did not link to that particular file and I assumed the one of the files linked at the top was the one I needed. Thanks for your help.

I'm also having trouble flashing openwrt. I got stuck on step4. it didn't flash the temporary image.

can someone help?

here is the serial log:

Found omnia-medkit-openwrt-18.06.2-mvebu-cortexa9-turris-omnia-initramfs.tar.gz on device /dev/sda1
Nothing wrong with it
1
And its our newest one!
[   11.280002] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
Repartitioning the drive...
Formatting the drive...
[   13.532223] random: mkfs.btrfs: uninitialized urandom read (16 bytes read)
[   13.539149] random: mkfs.btrfs: uninitialized urandom read (16 bytes read)
[   13.546084] random: mkfs.btrfs: uninitialized urandom read (16 bytes read)
[   13.658275] BTRFS: device fsid f8cfa4a6-81fd-4da5-9c38-97b893b6c069 devid 1 transid 5 /dev/mmcblk0p1
[   13.672982] BTRFS info (device mmcblk0p1): disk space caching is enabled
[   13.679703] BTRFS info (device mmcblk0p1): has skinny extents
[   13.685474] BTRFS info (device mmcblk0p1): flagging fs with big metadata feature
[   13.697149] BTRFS info (device mmcblk0p1): enabling ssd optimizations
[   13.705442] BTRFS info (device mmcblk0p1): creating UUID tree
[   13.935572] ntfs: (device mmcblk0p1): parse_options(): Unrecognized mount option subvol.
[   13.945576] BTRFS info (device mmcblk0p1): disk space caching is enabled
[   13.952306] BTRFS info (device mmcblk0p1): has skinny extents
[   13.963070] BTRFS info (device mmcblk0p1): enabling ssd optimizations
Unpacking rootfs to the target directory
Rootfs should be ready
date: can't stat '/mnt/trg/etc/shadow': No such file or directory
sh: out of range
[   14.340848] random: crng init done


........
Scanning mmc 0:1...
scanning bus for devices...
SATA link 0 timeout.
SATA link 1 timeout.
AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
flags: 64bit ncq led only pmp fbss pio slum part sxs

When I flash the rescue image back, it works.
It has this line printed then continues to boot:
Found U-Boot script /boot.scr

Is this the original Turris Omnia, or the Turris Omnia 2019?
Possibly, the latter one comes with a newer u-boot, and assumes existence of /boot.scr - which current OpenWrt images do not have (neither medkit nor sysupgrade).

Did that page used to work?

toh:turris_cz.nic:turris_cz.nic_omnia
This topic does not exist yet
You've followed a link to a topic that doesn't exist yet. If permissions allow, you may create it by clicking on “Create this page”.

It is bought very recently. So I guess it is the very latest version.

You might be right. I have flashed an old version of U-Boot and now it is working as expected.

Yes, until 2019/10/17 when it was moved to https://openwrt.org/toh/turris/turris_omnia

1 Like

For reference, I have submitted https://github.com/openwrt/openwrt/pull/2693 which hopefully makes the flash instructions work again for devices with the new U-Boot. If somebody can completely exercise method 1 with this, it would be great. Serial console might help finding bugs.
Just be careful with flashing the new U-Boot on old devices: https://forum.turris.cz/t/how-to-flash-a-new-u-boot-on-turris-omnia/11826/18. I won't do it, as I have CZ11NIC13 with 1 GB RAM...

3 Likes

Hello I have forked your repo, and compile an artefact for Turris CZ…20 (TurrisOS 5.0.2) which has 2GB RAM and 8BG of ROM, I sill have the same issue and I can’t flash pure OpenWRT.
This is the artefact result: https://github.com/IvoryAguado/openwrt/runs/847129793
I might be doing something wrong I don’t know

Before you compile yourself, you may want to try my Omnia Playground image. Follow installation instructions from there.

1 Like

Hello @kkudielka, I have tried method 2 (U-Boot 2019.07 or later) with the serial connected, but I still get the same error as before: …/shadow, or that’s what I think, Im using FAT32 used method 5 and 7, I was able to connect to the ssh but missing commands like sysupgrade or zcat , Any ideas what I’m doing wrong?

The log I get is like the one before: Turris Omnia: sysupgrade: Unable to install OpenWrt mentioned by @mars

I have successfully flashed your image, but in a strange way, so what I did is use MODE 6 (Turris over internet on port WAN), then I wait using the SERIAL port press Enter, get into SSH, then get your image and cat….img.gz | dd…. everything is working now, but I have the feeling the config might not be very stable?, Im planning now to compile my own image with my own config.

Thanks @kkudielka

Hello,

It seems that 19.0.7.5 integrates kkudielka patches to make OpeWRT work on Turris Omnia, but i still can't make it work on my device.
Does anyone manage to make it work ?

Than you by advance for your help.
Grorico.

I made a quick check and successfully booted the official 19.07.5 sysupgrade image on a Turris Omnia 2019 (U-Boot 2019.07).

Details: I directly booted off a USB flash drive, using setenv boot_targets usb0; boot at the U-Boot command prompt. The image comes up as expected. Access to luci via a LAN port works as well. I would expect the same behavior, if the image is flashed to mmcblk0 - as proposed in the Installation Instructions.

Be careful, instructions are different, depending on U-Boot version.