sowbug / mkeosimg

Make a Ubiquiti EdgeOS image from a system tarball

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposal: Troubleshooting slow usb sticks

kosta opened this issue · comments

commented

First of all, thanks for this awesome repo! You saved my EdgeRouter today :)

I ran into the issue that the USB stick created using these scripts would not boot. Using the serial console I saw that the USB stick was too slow, so uboot aborted. Now typing usb start worked though, and thus run bootcmd worked as well.

My solution was to setenv bootdelay 10 (sadly, the delay is after trying to start usb so this alone does not work) and setenv bootcmd usb start \; followed by the rest of the bootcmd (warning: as the bootcmd contains semicolons, these must be escaped using backslash and be surrounded by spaces: \;). Afterwards, saveenv persists these settings for the next boot (but you can try them first by running run bootcmd).

On my EdgeRouter, the full uboot commands thus look like this:

setenv bootdelay 10

setenv bootcmd usb start \; fatload usb 0 $loadaddr vmlinux.64 \; bootoctlinux $loadaddr coremask=0x3 root=/dev/sda2 rootdelay=15 rw rootsqimg=squashfs.img rootsqwdir=w mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@1024k(eeprom)

saveenv

Now, on every boot, uboot first fails to start usb, then waits 10 seconds, then initializes USB and boots the EdgeRouter. I think I can live with that :)

Do you want a PR to add this to a Troubleshooting section in your Readme?

Wow, I'm sorry you had to slog through that debugging, especially when you probably had been planning to spend your evening watching Netflix. :) Yeah, I'll totally take the PR. Appreciate it!

@kosta you said:

I saw that the USB stick was too slow

What do you define as slow?

Can you run something like CrystalDiskMark or something?

For example the USB I want to use can do: 15MB/s read 4MB/s write is that fast or slow?

I've tried to attach the picture.

CrystalDiskMark_Yellow1GB

I didnt mean slow as is read/write throughput; I meant slow as in power-up latency: After the device is powered up, the USB stick does not respond quickly enough to be available when the uboot bootloader tries to access it.

(My expectation is that the router should work with just about any slow read/write throughput - it would just write logs a bit slower)

Unfortunately, I didnt even know how to start searching for such USB sticks, hence my setenv bootdelay 10 workaround. It wastes 10 seconds on every reboot, but I find that acceptable.