Librem coreboot Utility Script: usage, discussion, and help

Ok I reverted to a previous version provided by your gitlab repository because I need MX19 for now.

Anyway updating coreboot worth it as it seems to clean an old bug that I had with USB ports.

thank you for your answer.

1 Like

Some feedback about the last version of coreboot/SeaBIOS.
The version I still have is from March 2019. I wanted the fix for the SATA speed.
As I setup my Librem 15 V.3 again anyway, I decided to update the BIOS again as described at https://source.puri.sm/coreboot/utility

In short, the process worked flawless, but the software had problems.

I have two disks in my Librem (NVMe 1. disk and AHCI/SSD /dev/sda as 2. disk). Apart from the already described reduced display size for GRUB in the top left corner, the latest BIOS version was no longer able to boot from the 2. disk /dev/sda. I had PureOS installed on a partition on the second disk and it worked with the old BIOS. Even giving the full 2. disk in a new PureOS installation didnā€™t work after the change. If I selected the 2. disk to boot it hanged. I donā€™t know if that was related with the SATA problems.

Anyway, I had a backup of the old working ROM and reverted back to it. Now everything works as usual again.

1 Like

following because this worked.

I have Librem 14 with coreboot/seaBIOS and when I do sudo bash ./coreboot_util.sh in order to update firmware using precompiled images (either coreboot/seaBIOS or coreboot/Heads) I get Unhandled programmer parameters: ich_spi_mode=hwseq.

Hereā€™s the full log:

flashrom v1.2 on Linux 5.10.0-6-amd64 (x86_64)
flashrom was built with libpci 3.7.0, GCC 9.3.0, little endian
Command line (7 args): /usr/sbin/flashrom -p internal:ich_spi_mode=hwseq -w ./firmware/pureboot-librem_14-Release-17.1.rom -V -o ./flashrom-20210520-194517.log
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Initializing internal programmer
/sys/class/mtd/mtd0 does not exist
Found candidate at: 00000500-00000528
Found coreboot table at 0x00000500.
Found candidate at: 00000000-000004c4
Found coreboot table at 0x00000000.
coreboot table found at 0x99b76000.
coreboot header(24) checksum: 80ab table(1196) checksum: e8d5 entries: 37
Vendor ID: Purism, part ID: Librem 14
Using Internal DMI decoder.
DMI string chassis-type: "Laptop"
Laptop detected via DMI.
DMI string system-manufacturer: "Purism"
DMI string system-product-name: "Librem 14"
DMI string system-version: "1.0"
DMI string baseboard-manufacturer: "Purism"
DMI string baseboard-product-name: "Librem 14"
DMI string baseboard-version: "1.0"
W836xx enter config mode worked or we were already in config mode. W836xx leave config mode had no effect.
Active config mode, unknown reg 0x20 ID: 85.
Found ITE EC, ID 0x8528, Rev 0x0a on port 0x2e.
WARNING: No chipset found. Flash detection will most likely fail.
Super I/O ID 0x8528 is not on the list of flash-capable controllers.
No board enable found matching coreboot IDs vendor="Purism", model="Librem 14".
========================================================================
You seem to be running flashrom on an unknown laptop. Some
internal buses have been disabled for safety reasons.

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.
========================================================================
Unhandled programmer parameters: ich_spi_mode=hwseq
Aborting.
Error: Programmer initialization failed.

Also, I tried to setup boot order using the script, got the same error. Any ideas what Iā€™m doing wrong?

@juro is this running PureOS? The script appears to be using the built-in flaashrom 1.2, which does not support the Librem 14ā€™s platform (Cometlake). It should recognize this and download/use an updated version of flashrom. If thatā€™s not happening, then thereā€™s a bug in the flashrom version logic in the script that I need to fix

edit: took a look and found the issue. Re-download/re-run the script and you should be good to go now

1 Like

Yes, Iā€™m running PureOS. I can confirm the fix works. Thanks!

I have coreboot/Heads on my L14 now. Iā€™ve tried to install Guix, but it seems it doesnā€™t work well with Heads and I canā€™t boot after the installation. I installed Guix on a different SSD and keep the original SSD with PureOS just in case. So Iā€™m trying to switch back from coreboot/Heads to coreboot/seaBIOS (precompiled images). Iā€™m using the original SSD with PureOS and tried to sudo bash ./coreboot_util.sh which gives me:

flashrom v1.2-116-gc64486b on Linux 5.10.0-6-amd64 (x86_64)
flashrom was built with libpci 3.7.0, GCC 10.2.1 20210110, little endian
Command line (7 args): ./tools/flashrom/flashrom -p internal:ich_spi_mode=hwseq -w ./firmware/coreboot-librem_14-4.13-Purism-2.rom -V -o ./flashrom-20210523-105823.log
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Initializing internal programmer
Found candidate at: 00000500-00000528
Found coreboot table at 0x00000500.
Error accessing high tables, 0x100000 bytes at 0x0000000099b75000
/dev/mem mmap failed: Operation not permitted
Failed getting access to coreboot high tables.
Using Internal DMI decoder.
Error accessing DMI Table, 0x1000 bytes at 0x0000000099b40000

Edit: based on https://puri.sm/projects/coreboot/:

If running PureBoot firmware, the script will prompt you to copy the update to USB and to update via the Heads menu option.

The script doesnā€™t prompt me to copy the update to USB. I guess the firmware was built correctly and just needs to be flashed from Heads?

Edit2: After adding iomem=relaxed to grub (howto do it) and flashing it again, it worked, so Iā€™m back to coreboot/seaBIOS (however, I thought I would flash it from PureBoot using USB stick).

let me see why thatā€™s not working properly, the script shouldnā€™t prompt you to flash at all if youā€™re currently running Pureboot, because youā€™re supposed to flash from Pureboot itself

edit: seems we relaxed things and the script will allow you to flash from Pureboot to coreboot from within the script, but we should probably check that flashrom isnā€™t going to fail due to kernel memory access restrictions

Iā€™ve downloaded the util script and am able to update my firmware without problem, but when attempting to do anything else in the utility (change boot order or set serial number), I get the same error as Juro above. Full log will follow. (This isnā€™t related to my problem in the other thread, if youā€™re wondering. As I said in the other thread I was able to clear that up!).

flashrom v1.2 on Linux 5.10.0-7-amd64 (x86_64)
flashrom was built with libpci 3.7.0, GCC 9.3.0, little endian
Command line (6 args): /usr/sbin/flashrom -p internal:ich_spi_mode=hwseq -r /tmp/tmp.CI8Y0Topre/bios.bin -o ./flashrom-20210705-112430.log
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Initializing internal programmer
/sys/class/mtd/mtd0 does not exist
Found candidate at: 00000500-00000528
Found coreboot table at 0x00000500.
Found candidate at: 00000000-000004c4
Found coreboot table at 0x00000000.
coreboot table found at 0x99b75000.
coreboot header(24) checksum: 9b6f table(1196) checksum: ce11 entries: 37
Vendor ID: Purism, part ID: Librem 14
Using Internal DMI decoder.
DMI string chassis-type: "Laptop"
Laptop detected via DMI.
DMI string system-manufacturer: "Purism"
DMI string system-product-name: "Librem 14"
DMI string system-version: "1.0"
DMI string baseboard-manufacturer: "Purism"
DMI string baseboard-product-name: "Librem 14"
DMI string baseboard-version: "1.0"
W836xx enter config mode worked or we were already in config mode. W836xx leave config mode had no effect.
Active config mode, unknown reg 0x20 ID: 85.
Found ITE EC, ID 0x8528, Rev 0x0a on port 0x2e.
WARNING: No chipset found. Flash detection will most likely fail.
Super I/O ID 0x8528 is not on the list of flash-capable controllers.
No board enable found matching coreboot IDs vendor="Purism", model="Librem 14".
========================================================================
You seem to be running flashrom on an unknown laptop. Some
internal buses have been disabled for safety reasons.

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.
========================================================================
Unhandled programmer parameters: ich_spi_mode=hwseq
Aborting.
Error: Programmer initialization failed.
1 Like

looks like the script is trying to use the built-in version of flashrom (v1.2) which does not support the L14 - it should be building from source for the L14/Mini v1/v2. Iā€™ll see whatā€™s going on

1 Like

script error on my part - the platform variable wasnā€™t being set unless you tried to update the firmware, and that variable was being used to determine the version of flashrom needed. So when trying to update the serial or bootorder, the platform variable was unset, leading the script to use the built-in version of flashrom, which doesnā€™t support the Mini v2/L14.

Just pushed a fix, so should be good to go, but youā€™ll need to download the updated script

3 Likes

I just downloaded the updated script and ran it ā€“ it worked flawlessly! Thank you much.

1 Like

Hi,

Sorry for this dumbs questions.

Is it possible to performe an external flash (full flash with external programmer) with final rom? Does this rom contain all flash regions or is it just a BIOS region update?

not dumb, and yes - the images we provide (both coreboot and Pureboot) are full flash images, containing the IFD, ME, and BIOS regions.

Ok, thanks for your answer

I started compiling coreboot+seabios from the source using this script and it took me into something called ā€œdetached headā€. Didnā€™t know what to do until it kicked me out after a while.

What should I do then?

I also gleaned at ā€œmake menuconfigā€ options but already selected items seemed wrong or unrelated to my librem machine, should I import a working config file before I make changes on it?

Are there also some options to stay away from?

How else do I proceed after ā€œmake menuconfigā€?

@MrChromebox

there is nothing you need to do as a user other than press Y/N when prompted by the script. If there was a timeout or some other error when checking out the coreboot source, then simply retry.

I would use a prebuilt image if I just wanted to press y/n.

When is the right time to enter menuconfig and make changes?

Should I first import the default config values for librem mini v2 somehow?
Edit: I also tried to edit coreboot parameters using nvramtool or coreboot configurator (a tweaker with gui by starlabs) but I got an error about a table not being available.(tried iomem=relaxed, same result)

if youā€™re going to build coreboot from source using a different config than Purismā€™s default, then you donā€™t use the coreboot utility script for that - itā€™s not what it is meant for.

thatā€™s not going to work, Purism devices donā€™t support any configuration changes via CMOS

letā€™s approach this a different way: what exactly are you trying to change?

I will disable Hyper-Threading if possible.

Edit: I would rather like to do this on your UEFI firmware releases actually (it runs better for me-reason being purismā€™s coreboot fw weirdly will not initialize my wired keyboard when my logitech mouseā€™s unifying receiver is plugged in)