Change boot order


#1

Hi,

I have a Librem v2 with two disks, and i would like to change the boot order.
I tried to use the F1-F12 keys to access to the BIOS (as i used to do in my older laptops) but it’s not working. Is there any way to achieve this?

Thanks!

Ming


Building coreboot from source (official script)
#2

Press Escape when Purism logo appears. If you want to change it permanently, it includes reflashing coreboot. Contact support by mail, I’ll send the instructions to you.


#3

I actually wanted to publish the instructions in a new thread in the forums and this is the best place to do it I guess.

I’ve made a small script to change the boot order for you, it’s available here : https://www.dropbox.com/s/6o2mk1ajt8r99l1/bootorder.tar.gz?dl=0

Just run change_bootorder.sh as root:

sudo sh change_bootorder.sh

MAKE SURE you don’t interrupt the process once it starts flashing coreboot, and make sure you have enough battery left and you are connected to the power supply, in case of a blackout.

This should technically work on any OS, but I’ve only tested it on PureOS. I’ve built flashrom without ftdi support so you won’t have to worry about that dependency, and this version of flashrom has skylake support (which isn’t available in the latest release of flashrom).

It should be 99.9999999% safe, but as usual, standard disclaimer applies (“provided AS IS, we are not responsible for any damage this might do to your hardware”, etc).

This is a much simpler/limited script compared to the more complete ‘purism-librem-coreboot-updater’ script, but that script only supports librem 13 v1, and I haven’t finished adding librem 13 v2, and librem 15 v3 support to it, but once I do, it will become more mainstream, a single tool to update coreboot or change the boot order, and neutralize the ME, etc…


Librem 15v3 won't boot
After installing second M2 SSD, PureOS is not booting automatically
#4

Thanks, kakaroto, it worked like a charm!


#5

Will this script also work for the Librem 15v3?


#6

Yes, it will work for both Librem 13 v2 and Librem 15 v3.


#7

I felt a bit uncertain on using the flash script of kakaroto, so I managed by simply installing grub on the M2-disk.


#8

Hey Forum,

I have tried to run the script you provided.
It was successful once, but now I would like to revert my changes and make my non-M.2-SSD the primary harddrive to start.

When I run the script and make my choice, I get the following output, which exits with an error

Select the default order in which devices will attempt booting:
1 - Boot order: M.2 SSD disk first, 2.5" SATA disk second
2 - Boot order: 2.5" SATA disk first, M.2 SSD second

** Note: regardless of the option chosen above, you can always select
** a different boot device by pressing ‘ESC’ at boot time.
Enter your choice (default: 1): 2
flashrom v0.9.9-1-stable-11-d36385d-dirty on Linux 4.16.0-2-amd64 (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Calibrating delay loop… OK.
coreboot table found at 0x7aad3000.

WARNING! You seem to be running flashrom on an unsupported laptop.
Laptops, notebooks and netbooks are difficult to support and we
recommend to use the vendor flashing utility. The embedded controller
(EC) in these machines often interacts badly with flashing.
See the manpage and https://flashrom.org/Laptops for details.

If flash is shared with the EC, erase is guaranteed to brick your laptop
and write may brick your laptop.
Read and probe may irritate your EC and cause fan failure, backlight
failure and sudden poweroff.
You have been warned.

Proceeding anyway because user forced us to.
Found chipset “Intel Skylake U Premium”.
This chipset is marked as untested. If you are using an up-to-date version
of flashrom and were (not) able to successfully update your firmware with it,
then please email a report to flashrom@flashrom.org including a verbose (-V) log.
Thank you!
Enabling flash write… Warning: Setting Bios Control at 0xdc from 0x8b to 0x89 failed.
New value is 0x8b.
Warning: SPI Configuration Lockdown activated.
OK.
No EEPROM/flash device found.
Note: flashrom can never write if the flash chip isn’t found automatically.

Unable to read coreboot image

I hope you can help me. As I said, it used to work once, so I find it quite strange that it does not work anymore.

I have tried to run it under PureOS (latest version; dist-upgrade today) and Gentoo. In both I ran “(sudo) bash change_bootloader.sh”. Under Gentoo I did not use sudo but root directly.

If there is anything else you need to troubleshoot, please let me know.

P.S. no idea why some text in the output is bigger


#9

Hi, I’m unsure, as I’ve never seen this problem before. Can you try two things :
1 - Boot with the kernel argument ‘iomem=relaxed’ added to the linux line in grub
2 - try the command ./flashrom -V -p internal:laptop=force_I_want_a_brick and post the full output someone and link to it here


#10

@kakaroto, I had the exact same error as @mmillrose on my Librem 15v3. After booting with iomem=relaxed in GRUB, I ran

$ sudo ./flashrom -V -p internal:laptop=force_I_want_a_brick

and got this result: https://pastebin.com/ZQnNMg6r

Any advice?


#11

I tried this again after reinstalling for unrelated issues, and initially got this output:

$ sudo sh change_bootorder.sh 
[sudo] password for kyle: 
change_bootorder.sh: 12: change_bootorder.sh: [[: not found

Select the default order in which devices will attempt booting:
1 - Boot order: M.2 SSD disk first, 2.5" SATA disk second
2 - Boot order: 2.5" SATA disk first, M.2 SSD second

** Note: regardless of the option chosen above, you can always select
** a different boot device by pressing 'ESC' at boot time.
Enter your choice (default: 1): 2
change_bootorder.sh: 29: [: 2: unexpected operator
change_bootorder.sh: 37: [: 2: unexpected operator
./flashrom: error while loading shared libraries: libusb-0.1.so.4: cannot open shared object file: No such file or directory

Unable

So I installed libusb-dev but then got the same errors as above, unfortunately. Using sudo bash change_bootorder.sh solved the unexpected operator errors but it still failed in the same way.


#12

@kylebarbour if you’re still looking to modify your bootorder, I’ve updated kakaroto’s script for improved compatibility (using statically compiled binaries) and functionality (offers USB as top priority) - you’re welcome to give that a try


#13

I just encountered this issue myself. I ordered my Librem without an M.2, everything was fine until I added my own M.2 today. For some reason, it wants to use that first. Everything works fine when I manually select the 2.5" drive.

Would you mind sharing your updated script?

Thanks!


#14

I’ve implemented a much-improved version of the bootorder setting script in my new BETA coreboot updater script, see: Building coreboot from source (official script)

I do plan on making the bootorder part a separate function but haven’t done so yet


#15

Thank you! I will check it out.

It would be great to have a script or utility included in PureOS, or the BIOS, that makes changing boot order or preferences a breeze :slight_smile:

For future consideration, I hope!


#16

Thanks all!

In case it’s helpful to someone else landing on this thread, it seems the new way to do this is using this script instead. @MrChromebox, please correct me if that’s wrong.


#17

Thanks for the notification kyle :slight_smile:
I had not updated my BIOS nor my boot order because i had some weird issues with the last script and did not have time to investigate more. With matt’s new script everything worked silky smoooooth and updating took 5 minutes.


Support with booting from NVMe SSD