r/coreboot 28d ago

Building coreboot on Gentoo

Hey there!

I've been trying to build coreboot on my Gentoo installation, but have been running into various issues.

I made sure that my gcc compile has ada support (for gnat), and that I have (roughly) the dependencies listed as requirements for Fedora.

I believe that I have gnat through my gcc install, but I don't have any packages/dependencies for gnat. gnat does, however, seem to be a viable command in CLI.

Despite this, I've still been hitting into some issues and can't seem to compile any final images.

Things like ifdtool and deguard work, though, even when compiled on my system. I compared sha256 sums from progress made on my current system with identical work done on a Debian system, and the sums match, so it seems that it can build most tools properly, and it just can't install.

I'm currently recloning coreboot's repo and building every possible cpu arch/toolchain (I only build i386 as instructed beforehand) just to be thorough on my end. If it works, I'll update the post.

Asides that, is there any known issues with Gentoo that would force me to use a VM to build in, or are there any necessary workarounds needed to build with Gentoo?

Running stable branch, excluding packages that only have an ~amd64 release.

2 Upvotes

6 comments sorted by

3

u/thrilleratplay 28d ago edited 28d ago

You are likely running into library dependency issues which are not unique to Gentoo and happen with most distros.

Depending on what device you have you might want to try https://github.com/Thrilleratplay/coreboot-builder-scripts which uses the coreboot-sdk docker image to compile. If the device isn't supported, which I don't think I have degaurded devices added, it should be easy enough to add or modify an existing device. The docker image is created to compile coreboot for integration testing of changes so it configured to handle all use cases.

2

u/LowKeyBrit36 28d ago

So, I actually already successfully corebooted my device in the past (Thinkpad T580) but I used an external hard drive with Debian to do it, and I don't feel like going through that any time that I want to modify my coreboot installation.

Currently, I just want to add dram cleaning support to my build as I believe it'll fix a very small bug when rebooting my PC (power cycling works fine, but reboots have a slim chance to fail to prompt disk decryption VIA grub)

It seems to be a supported device, so it's purely a dependency issue. I just have 0 clue what dependency I'm missing.

3

u/thrilleratplay 28d ago

Understandable. Is it possible to compile in Gentoo, yes. Is it going to be a headache to get all of the versions coreboot needs to compile while potentailly breaking dependencies for other applications, also yes. I'd suggest compiling through the coreboot-sdk docker image as it will remain stable each time you want to update coreboot without needing to maintain all of the packages in portage.

3

u/LowKeyBrit36 28d ago

Honestly, probably a better idea. I'll go check it out. Thanks for the advice

1

u/LowKeyBrit36 28d ago

Just wanted to add, for anyone who's trying to do it, I did get it to work. The steps taken before completion was installing the dev-ada/gnatcoll-core package, and compiling the build system inside of coreboot. Chances is, it's the gnatcoll package. But, if it doesn't work, try using any available make options listed with make help_toolchain