What is the PureBoot release version currently installed on your Librem Mini v2?
Pureboot Release 28.3.
Okay, follow these instructions:
Using the Coreboot utility script, download the pureboot-librem_mini_v2-Release-30.zip
file, place it on a separate USB drive, restart your Librem Mini v2 with the USB drive inserted, enter the PureBoot Boot Menu by pressing a key when prompted, then update PureBoot by navigating the menus.
So you are saying this can be done from the recovery shell? If so, will I have to manually connect to the internet?
You will need a separate computer for the script, so if your old laptop is still available, you can use that for the first half of this procedure. The rest of the steps are done on the Librem Mini v2.
So… am I to understand that I will download the script onto my other laptop, and then put it on a USB to put it on my Librem Mini? Because the issue is that it is not recognizing USBs from BIOS, etc. Am I misunderstanding?
Are utilities such as ifconfig available in recovery shell?
If Live USBs are not detected, but USB mass storage devices are detected, you should still be able to update PureBoot. This is also a good opportunity to try different ports and/or fresh USB drives for fault isolation purposes.
Thanks. I will report back with updates.
Sorry, I didn’t read the instructions carefully. So, now I am having a separate issue.
Having attempted to run the script on my laptop, I am receiving the following output in the terminal:
sudo bash ./coreboot_util.sh
./coreboot_util.sh: line 680: syntax error in conditional expression:
unexpected token `('
What does this error mean? I followed the instructions exactly this time.
Edit: am I to understand this to be saying that there is an error in the script itself?
What operating system (distro) and version is it running?
Running macOS 10.14.6. Computer is too old to update to newer version, hence why I have been trying to migrate to Linux.
Wild guess: The laptop’s implementation of the [[
command and in particular with how it interacts with pattern matching and the extglob
option is off the pace. I suspect that there is insufficient Mac expertise and equipment in this forum to sort that out.
To be honest I am not clear on why you are running the shell script on the laptop, which must be so far away from the target environment that the script may not work anyway. The script is attempting to detect which Librem device you are running the script on, and what boot firmware the device used.
Just to recap the situation for my benefit:
- is the Librem Mini normally bootable? i.e. from the internal drive?
- can you Live Boot the Mini from any USB port? USB 2.0 port? USB 3.0 port? USB 2.0 flash drive? USB 3.0 flash drive?
- you have no other computers besides the Mini and an old laptop?
• The Librem Mini has no operating system, but can get into the recovery shell.
• The output I get from PureBoot, no matter which USB used, is as follows:
Loading /etc/config.user from CBFS
gpg: WARNING: nothing exported
***** BASIC mode: tamper detection disabled
***** Normal boot: /bin/gui-init-basic
Scanning for USB storage devices...
mount: mounting /dev/sda1 on /media failed: Invalid argument
Unable to locate /boot files on any mounted disk
mount: mounting /dev/sda1 on /media failed: Invalid argument
/bin/media-scan: line 25: [: -ne: unary operator expected
!!!!! something failed during USB boot
!!!!! Starting recovery shell
• I have one other desktop computer, which I am also in the process of setting up, though it is usable.
How did you make the flash drive contents?
Using the Mini before you wiped it? (?)
Using the laptop?
It came with the Mini?
Something else?
What actually is on the flash drive?
Unfortunately I don’t see a command available at the recovery shell to check the contents of the flash drive i.e. partitions? file systems? Can you check that with the laptop?
I was previously using balena etcher on my laptop. For some reason, when I tried to make a new live USB recently, I discovered that the program no longer was able to be opened. I have no idea why. I even tried taking a version of it from my backup hard drive and putting it on the laptop, and neither would it open. I don’t know why, as it previously worked fine. However, I don’t believe that was the issue. Prior to wiping the hard drive on the Librem Mini, I was having the same problem of booting from USBs. At the time, I thought it was due to some security feature.
That aside, I downloaded Unetbootin as an alternative, but it is not working very well. When I tried to set up my other desktop with a live USB prepared with that program, even my tower desktop could not recognize it. I am currently trying to follow instructions on github (here) to make a live USB from the command line. If I have any better luck, I will make note of it.
As far as checking the contents of the flash drive, do you mean to make sure that the files have been written to it, or what should I look to be checking for?
Edit: I should mention, that I previously set up my tower desktop using Balena Etcher from my mac laptop, and did so several times. That is partly why I was so confounded when I ran into this trouble of the Librem Mini not recognizing the same live USBs I had used to do so.
I don’t know what is going on. I downloaded balena etcher on my roommate’s computer to get it working, and now I am having a different error. PureBoot is recognizing that I have a USB plugged in, and is trying to boot from it, but recognizes the one USB as two. It is giving me the option to boot from /dev/sda1, and /dev/sda2, despite that there is only one USB plugged in. And then, ultimately, it output an error upon trying to load from either of them:
fdisk: can't open '/dev/sda': I/O error
mount: mounting /dev/sda1 on /media failed: No such file or directory
mount: mounting /dev/sda2 on /media failed: No such file or directory
Unable to locate /boot files on any mounted disk
mount: mounting /dev/sda2 on /media failed: No such file or directory
/bin/media-scan: line 25: [: -ne: unary operator expected
Edit: I did manage to confirm that three of the SSUSB ports have this error. Strangely, the uppermost SSUSB on the back side, as well as the regular USB ports have the other variant of the error, which I wrote in my earlier post. I have also, in testing this more thoroughly, found that (at least) the one of the two SSUSB ports in the rear intermittently alternates between the two errors upon rebooting.
2nd Edit: upon rebooting a third time, I received a different error altogether:
fdisk: can't open '/dev/sda': I/O error
find: /media/boot/grub: I/O error
find: /media/efi: I/O error
find: /media/LiveOS: I/O error
find: /media/efi: I/O error
Unable to locate /boot files on any mounted disk
fdisk: can't open '/dev/sda': I/O error
fdisk: can't open '/dev/sda': I/O error
/bin/media-scan: line 25: [: -ne: unary operator expected
!!!!! Something failed during USB boot
!!!!! Starting recovery shell
Have confirmed that live USB works to boot the tower desktop, an Optiplex 5055.
Things to check for: How many partitions? What partition types? What file system is on a partition? Can you mount it? What files are on it?
So the way I see it, in order to get back a bootable computer, you have two options:
- Send it in for “repair”. OR
- Remove the internal drive, put it in an enclosure, use another computer to put something suitable on it, then put it back in. (Will require equipment and a little expertise.)
If you do the second, from there, you should then have a normally bootable computer, and from there you should be able to update Coreboot / Pureboot, and then you could have the capability to boot from a USB port, and then finally you can install the operating system that you want.
However, and this is where the first option may be better, I think you will need advice from Purism Support as to what version of boot firmware you actually need in order to get working USB ports.
We’ll see. I am not too keen on sending it back to them. I already reached out to support@puri.sm shortly after I made this post. I have yet to hear from any of their staff. They did have a prompt response the last I reached out to them, when I first bought the computer, once it became evident upon setting it up that something was not right. Many issues. Managed to resolve some of them, but I was still very aggravated by the fact that it effectively wasn’t usable in the way I wanted, right out of the box, so I set it aside for some months in frustration. Looking around on this forum, I don’t seem to be alone when it comes to issues dealing with the company and its tech support.
After a little research, I happened upon an article (here) pertaining to the “[: -ne: unary operator expected” error, and it seems to be indicating that there is perhaps a syntax misstatement in the /bin/media-scan file, on line 25. I don’t know how that would have happened, nor much about coding frankly, but I do wonder if that might solve the issue. That’s at least one possible explanation as to this problem.
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!