Librem Mini PC, Pureboot will not recognize bootable USB, no OS

I think you are wasting your time debugging Purism’s shell scripts but my guess would be … unhandled error.

That is, something goes wrong earlier in the script leading to a shell variable not even being defined. So, yes, the [ goes wrong and the script has not been coded defensively but that isn’t the real problem.

Example:

[ $QT_ACCESSIBILITY -ne 42 ]
echo $?
0
[ $QT_ACCESSIBILITYX -ne 42 ]
bash: [: -ne: unary operator expected

This example has been chosen just because that first shell variable already exists in my shell and has a value that is a valid integer and the second shell variable does not exist. That particular shell variable has no relevance whatsoever to the actual problem. It is just to illustrate one possible failure mode with the [ command.

And note that there is nothing wrong with the syntax, provided that the script can guarantee absolutely that the shell variable exists and has a valid integer value.

I don’t have ready access to that exact script (media-scan) so consider this no more than an educated guess.

Bottom line is that the “I/O error” is likely to be the real problem. Even if the script were perfectly coded, you aren’t going to be able to boot if the flash drive is reliably unable to be read!

2 Likes