plan44 / omega2flash

bash script to flash a fresh-from-factory Omega2(+) or Omega2S(+) via ethernet without user intervention
1 stars 0 forks source link

firmware file 'firmware.bin' not found #1

Closed julianstogs closed 3 years ago

julianstogs commented 3 years ago

I really want to try this script out, however, no matter what I do I get 'firmware file 'firmware.bin' not found' I have created a folder on my desktop, I have placed the script and the firmware.bin image inside this folder. I am running:

I've tried several different syntax, including:

omega2flash.sh eth0 auto [firmware.bin] --> Not found

omega2flash.sh eth0 auto [/home/Desktop/firmware.bin] --> Not found

omega2flash.sh eth0 auto /home/Desktop/firmware.bin --> Not found

What am I missing? I really need to use this, as this would help me greatly in my development. I am going to try looking through the script code in hopes of finding a solution.

plan44 commented 3 years ago

The third example is correct, the square brackets [ and ] denote optional parameters, because for the list and ping subcommands you don't need to specify the firmware image. So…

omega2flash.sh eth0 auto /home/Desktop/firmware.bin

…should work when you actually have a /home/Desktop/firmware.bin file.

However, that path looks a bit suspicious to me, I'd guess it should be something in the form

/home/yourusername/Desktop/thefolderyoucreated/firmware.bin on Linux or /Users/yourusername/Desktop/thefolderyoucreated/firmware.bin on macOS

julianstogs commented 3 years ago

Sorry, I had put my firmware.bin file directly on my Desktop for troubleshooting path problems, my username is 'engineering' and I did try it with [home/engineering/Desktop/firmware.bin] with no luck

plan44 commented 3 years ago

So the path should be (without square brackets, and with leading slash!):

/home/engineering/Desktop/firmware.bin

Which makes the full command:

omega2flash.sh eth0 auto /home/engineering/Desktop/firmware.bin

I would recommend using your shell's autocomplete feature (see here) to interactively find the correct path. Just entering text is so prone to small typos and oversights… ;-)

julianstogs commented 3 years ago

Oh there we go! I guess I didn't have the 'expect' package installed, however my terminal was not announcing this when I tried running. I only realized this once I saw lines 44-47 in the code. Thanks for your quick replies! I really appreciate it

julianstogs commented 3 years ago

What would your suggestion be regarding using this script to program, say 10 devices? (I'm a software dev but very new to shell scripting, bear with me!) If I've got:

plan44 commented 3 years ago

I just improved the "wait" mode in omega2flash to sequentially process multiple devices. So it should be possible now to just use it in a loop. Every iteration takes the next not-yet-programmed device. The searching and preparing is still sequential, but that only takes ~10secs per device. The actual flashing and first reboot that takes a few minutes is all on-device, and can run in parallel.

The IPv6 of devices that have been programmed were recorded in the $PROG_LOG (/tmp/flashed_omega2_ipv6) to avoid programming the same device twice in the previous version already, now this log is used in the "wait" mode to exclude devices from the search that are already programmed.