Install Libreboot on G41M-ES2L Board

19 risposte [Ultimo contenuto]
Creignor
Offline
Iscritto: 02/05/2022

Hi,
I'd like to free my BIOS as it seems Libreboot supports my old board.

inxi shows this:

Machine:
Type: Desktop Mobo: Gigabyte model: G41M-ES2L serial: N/A BIOS: Award

It doesn't show the GA prefix though I can read this on the motherboard itself.

Should I use the usqwerty_txtmode.rom ?

A forum search resulted in this old, locked topic from 2019:

https://trisquel.info/en/forum/install-libreboot-gigabyte-ga-g41m-es2l-version-11

I found the topic useful in that it gives the steps to do an internal flash but a link to a corrected script at a pastebin site is no longer available.
I've recently installed Trisquel 10.

The commands for downloading the libreboot utilities I know work but are these commands given in the referenced topic OK?

# Make note of MAC address
macaddress=`ifconfig -a | grep HWaddr | sed -e 's/^.*HWaddr //'`

# Make a note of ethernet name
interface=interface=`ip link | awk -F: '$0 !~ "lo|vir|wl|^[^0-9]"{print $2;getline}'`

# Put it in /etc/network/interfaces
cat <> /etc/network/interfaces
source /etc/network/interfaces.d/*

Finally, would it be preferable, in your opinion, to use osboot instead of libreboot?

Thanks.

jxself
Offline
Iscritto: 09/13/2010

Are you using the onboard graphics or a graphics card? On libreboot version 20160907 the PCI Express slots don't work. This has been fixed on the testing version if you're comfortable going there.

"Should I use the usqwerty_txtmode.rom ?"

My understanding is that you have to use text mode. Also, be sure to put fb=false on kernel parameters in GRUB when booting the kernel or you won't be able to see the installer.

I no longer have a copy of the script but the information on https://libreboot.org/docs/install/ga-g41m-es2l.html should work.

Just make a note of your MAC address and network interface name.

"Finally, would it be preferable, in your opinion, to use osboot instead of libreboot?"

libreboot of course - nonfree software is never the answer.

Creignor
Offline
Iscritto: 02/05/2022

Thanks jxself for your reply.

I'll use libreboot.
I'm using the onboard intel graphics and audio so the stable libreboot will be fine.

I have made a note of my MAC address and network interface name.
Regarding:

# Put it in /etc/network/interfaces

cat <> /etc/network/interfaces
source /etc/network/interfaces.d/*

The cat command will not work because there is no interfaces file in Trisquel 10:
# ls /etc/network/
if-down.d if-post-down.d if-pre-up.d if-up.d

Similarly
# ls /etc/network/interfaces.d/*
Results in:
ls: cannot access '/etc/network/interfaces.d/*': No such file or directory

So I'm a bit puzzled about where to put the MAC address and network interface name?

jxself
Offline
Iscritto: 09/13/2010

"So I'm a bit puzzled about where to put the MAC address and network interface name?"

In /etc/network/interfaces. :) If that file doesn't exist it means to create it. Your text editor should let you create files just by mentioning them, like sudo nano /etc/network/interfaces.

Mine has this. Be sure to adjust enp2s0 to your actual device name and 00:00:00:00:00:00 to your actual MAC address.

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp2s0
iface enp2s0 inet dhcp
hwaddress ether 00:00:00:00:00:00

Creignor
Offline
Iscritto: 02/05/2022

Thanks. I've created the /etc/network/interfaces file and inserted the contents.

"I no longer have a copy of the script but the information on https://libreboot.org/docs/install/ga-g41m-es2l.html should work."

I see:

flashrom -p internal

to find out the flash chip size. What's that for?

From your script:

# Do it!
sudo ./flash update libreboot_r20160907_grub_ga-g41m-es2l/ga-g41m-es2l_usqwerty_txtmode.rom

So after doing that, I take it that all that is needed to finish the task is to continue as detailed in the information:

"Internal flashing is possible. Boot with the proprietary BIOS and GNU+Linux. There are 2 flash chips (one is backup).
Flash the first chip":

./flashrom -p internal:dualbiosindex=0 -w libreboot.rom

"Flash the second chip:"

./flashrom -p internal:dualbiosindex=1 -w libreboot.rom

jxself
Offline
Iscritto: 09/13/2010

This looks right. Although one thing I forgot to mention as I recall, there's a horrible 1 second timeout for booting into the operating system with the libreboot 20160907 version. In theory that gets you into the operating system that much sooner but also that 1 second timeout's really annoying just on the off chance that you want to actually boot from something else. So I changed the timeout to 30 seconds.

Download libreboot_r20160907_util.tar.xz from libreboot.org and do something like:
cbfstool/x86_64/cbfstool ga-g41m-es2l_usqwerty_txtmode.rom extract -n grub.cfg -f grub.cfg

Edit the file grub.cfg and change the piece that says "set timeout=1" to some more appropriate value. I set mine to 30 which is 30 seconds. I found that to be nice comfortable value to give me time to select something else in the libreboot menu but feel free to edit as you see fit.

Then remove the grub.cfg that's in the libreboot rom and install your modified version:
cbfstool/x86_64/cbfstool ga-g41m-es2l_usqwerty_txtmode.rom remove -n grub.cfg
cbfstool/x86_64/cbfstool ga-g41m-es2l_usqwerty_txtmode.rom add -f grub.cfg -n grub.cfg -t raw

Flash the first chip:

sudo ./flashrom -p internal:dualbiosindex=0 -w libreboot.rom

"Flash the second chip:"

sudo ./flashrom -p internal:dualbiosindex=1 -w libreboot.rom

Then shutdown. Not restart, but shutdown. sudo shutdown -h now.

When you turn on the computer you should then have libreboot although be aware that it takes this version of libreboot a while to get started. I usually budget around 5 minutes for a complete boot from pressing power to getting into a shell.

Creignor
Offline
Iscritto: 02/05/2022

Thanks again for your last post.

I added the boot parameter fb=false to /etc/default/grub

I've got everything done before flashing the BIOS but I've run into a snag:
Making a /etc/network/interfaces file results in a loss of network connection on reboot.
I've checked that there was no typo in the contents but both the MAC address and network interface name are correct.
I can only get networking up and running again either removing or renaming the interfaces file.

jxself
Offline
Iscritto: 09/13/2010

OK. Well, skip for that for now then. It's only needed if you want to alter the MAC address from what libreboot provides. Like if you have multiple of these boards on your network, all with the same MAC address, that could cause problems. I haven't moved my machine to Trisquel 10 yet.

jxself
Offline
Iscritto: 09/13/2010

"I added the boot parameter fb=false to /etc/default/grub"

This is only needed with booting the Trisquel text installer. It shouldn't be needed as part of day-to-day computer operation.

Creignor
Offline
Iscritto: 02/05/2022

Hello again,
A couple of questions:

What is the difference between the ROMs? E.g., between ga-g41m-es2l_esqwerty_txtmode.rom and ga-g41m-es2l_usqwerty_txtmode.rom ? Are they for different languages and keyboards, namely Spanish and English?

About getting and extracting the ROM tarball:
It has to be extracted inside the rom/grub/ directory?

user@user-G41M-ES2L:~$ cd libreboot_r20160907_util/rom/grub/ && ls
libreboot_r20160907_grub_ga-g41m-es2l SHA512SUMS
libreboot_r20160907_grub_ga-g41m-es2l.tar.xz SHA512SUMS.sig

There may be another hitch in Trisquel 10. For example, when I tried the commands:

$ sudo ./flashrom -p internal:dualbiosindex=0 -w libreboot.rom
flashrom v0.9.9-unknown on Linux 5.4.0-96-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Calibrating delay loop... OK.
Found chipset "Intel ICH7/ICH7R".
Enabling flash write... OK.
DualBIOS: Selected chip: 0
Found Macronix flash chip "MX25L8005/MX25L8006E/MX25L8008E/MX25V8005" (1024 kB, SPI) mapped at physical address 0x00000000fff00000.
Error: opening file "libreboot.rom" failed: No such file or directory

I cannot find the file "libreboot.rom" anywhere, hence my second question.

jxself
Offline
Iscritto: 09/13/2010

"Are they for different languages and keyboards, namely Spanish and English?"

Right.

"About getting and extracting the ROM tarball: It has to be extracted inside the rom/grub/ directory?"

The files can live anywhere; that part is not important.

"I cannot find the file "libreboot.rom" anywhere, hence my second question."

This is a placeholder name. Please substitute libreboot.rom for the actual ROM file name.

Creignor
Offline
Iscritto: 02/05/2022

"This is a placeholder name. Please substitute libreboot.rom for the actual ROM file name."
OK, thanks, I get that.

I've followed your suggestion to change the ridiculous default timeout of only 1 second to 30. Good idea!

I also need to modify the keyboard because, while I want the language to be English, I use a Spanish keyboard. So I assume it must be done the same way as when changing the timeout, with the cbfstool:

./cbfstool/x86_64/cbfstool libreboot_r20160907_grub_ga-g41m-es2l/ga-g41m-es2l_usqwerty_txtmode.rom extract -n grub.cfg -f grub.cfg
sed -i 's/keymap usqwerty/keymap esquerty/g' grub.cfg
./cbfstool/x86_64/cbfstool libreboot_r20160907_grub_ga-g41m-es2l/ga-g41m-es2l_usqwerty_txtmode.rom remove -n grub.cfg
./cbfstool/x86_64/cbfstool libreboot_r20160907_grub_ga-g41m-es2l/ga-g41m-es2l_usqwerty_txtmode.rom add -n grub.cfg -f grub.cfg -t raw
jxself
Offline
Iscritto: 09/13/2010

I have never altered that aspect of it so I'll have to defer to someone else.

Creignor
Offline
Iscritto: 02/05/2022

This will be my first libreboot installation; hence the questions, but I hope to acquire a libreboot-friendly laptop sometime when I'll be able to repeat the procedure with a little more know-how.

Although the default MAC address will suffice for now, I'm intrigued by the question and have been looking at how it might be done using ich9gen and writing the file generated to the ROM.

Another question I think I should look at is how to make a backup of the BIOS in case of a mishap.

jxself
Offline
Iscritto: 09/13/2010

Backing up the ROM is easy. Checkout the flashrom man page:

-r, --read
Read flash ROM contents and save them into the given . If the file already exists, it will be overwritten.
-w, --write
Write into flash ROM. This will first automatically erase the chip, then write to it.

Do you know those earlier commands that had "-w" in them? Like ./flashrom -p internal:dualbiosindex=0 -w libreboot.rom

Change it to -r and it'll instead save the current ROM into whatever file name you specify there.

But that's the easy part. The harder part is what to do if something goes wrong. The chip on these motherboards is not socketed. So if something goes wrong you have to desolder the current chip and attache a new one, or connect an external programmer to the current chip (that way you don't have to desolder) but either way if the worst happens and the computer's bricked you'll need physical hardware to recover it.

This is different from other board like the Asus KGPE-D16 that have their BIOS chips in a socket where it can be removed (with a special tool) and a new one put in. In fact there are people on eBay that sell libreboot BIOS chips for the Asus KGPE-D16 that one can just plop in.

Creignor
Offline
Iscritto: 02/05/2022

Am very grateful for your help with this.
I got "Verifying flash... VERIFIED" after flashing the second chip but not after the first. Is that OK?

user@user-G41M-ES2L:~/libreboot/libreboot_r20160907_util/flashrom/x86_64$ sudo ./flashrom -p internal:dualbiosindex=0 -w libreboot.rom
flashrom v0.9.9-unknown on Linux 5.4.0-96-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Calibrating delay loop... OK.
Found chipset "Intel ICH7/ICH7R".
Enabling flash write... OK.
DualBIOS: Selected chip: 0
Found Macronix flash chip "MX25L8005/MX25L8006E/MX25L8008E/MX25V8005" (1024 kB, SPI) mapped at physical address 0x00000000fff00000.
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.

And the second chip:

$ sudo ./flashrom -p internal:dualbiosindex=1 -w libreboot.rom
flashrom v0.9.9-unknown on Linux 5.4.0-96-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Calibrating delay loop... OK.
Found chipset "Intel ICH7/ICH7R".
Enabling flash write... OK.
DualBIOS: Selected chip: 1
Found Macronix flash chip "MX25L8005/MX25L8006E/MX25L8008E/MX25V8005" (1024 kB, SPI) mapped at physical address 0x00000000fff00000.
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.
Verifying flash... VERIFIED.
Creignor
Offline
Iscritto: 02/05/2022

I regret to say that the libreboot installation has failed: After shutting down and booting it, nothing but a black screen. And I gave it longer than five minutes. But it's no great tragedy because I have three other desktop computers except they don't support libreboot.
Perhaps I can get it going again by connecting it to my raspberry pi but I'll leave that for a rainy day or if not I'll just salvage the power supply, the HDD, the memory etc for other use.
Nevertheless, I found it very interesting and will try it again sometime. I did make a backup of the proprietary BIOS though.

"This is different from other board like the Asus KGPE-D16 that have their BIOS chips in a socket where it can be removed (with a special tool) and a new one put in. In fact there are people on eBay that sell libreboot BIOS chips for the Asus KGPE-D16 that one can just plop in."
I'll definitely think about getting one; it looks good.

Once again, thank you for all your replies.

JC8
JC8
Offline
Iscritto: 12/29/2020

I wish i had seen this post earlier, the Libreboot source code/compiled bins for this motherboard do not work as intended, i have the exact same motherboard and tried installing Libreboot about a year ago with partial success. With the first test the board was unable to POST and gave no display output as you describe, then i thought that the issue could be the RAM and tried to power the board with one of the two RAM modules removed, the system could POST and boot Trisquel properly. Issue is that considering the board uses ancient DDR2 (i have only 2 modules of 2 GiB each) and that high capacity DDR2 modules are more expensive than the board itself i just rolled back to factory BIOS firmware using flashrom (if you need a dump i could provide one, i can imagine these factory nonfree BIOS dumps aren't easy to get).

My guess as to why this happens is that the Libreboot release for this motherboard has no proper dual channel support and is unable to POST if both RAM slots are in use, probably easy to fix if you know what you're doing with the source code.

jxself
Offline
Iscritto: 09/13/2010

Ah, interesting point. I had forgotten about the RAM problem. Yes, please try less RAM. Perhaps 1 stick. Or a lower total RAM combination. I think I have 2GB on mine and it works fine.

Creignor
Offline
Iscritto: 02/05/2022

Hello again,

After it didn't boot, I was going to remove the HDD with Trisquel to put it in another machine, and it did occur to me too—since I have occasionally been unable to boot after changing modules on my other machines—that it might have something to do with RAM so I also tried booting with only one stick but without success. But I'll have another go and try with only one in the first slot and then only one in the second slot.

On my machine I have two identical DDR II 2 GB 800 Mhz KINGSTON.

However, being a bit drowsy at the time, I may have made a mistake. Before flashing the two chips with the corresponding commands, I omitted to do this command beforehand:

$ sudo ./flash update libreboot_r20160907_grub_ga-g41m-es2l/ga-g41m-es2l_usqwerty_txtmode.rom

I hope this only means I would get the default grub without the timeout modification.

" [... ]I just rolled back to factory BIOS firmware using flashrom (if you need a dump i could provide one, i can imagine these factory nonfree BIOS dumps aren't easy to get)."

Thanks, I may well need one but it might take me a while to get round to restoring, if need be, the factory BIOS, but I should be able to get another GA-G41M-ES2L Board free next Tuesday so I'll use that for the time being.

"My guess as to why this happens is that the Libreboot release for this motherboard has no proper dual channel support and is unable to POST if both RAM slots are in use, probably easy to fix if you know what you're doing with the source code."

I wonder if the November '21 testing release might've fixed this? Two RAM sticks are certainly better than one.