help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anyone built coreboot on a Guix system?


From: Adrien 'neox' Bourmault
Subject: Re: Anyone built coreboot on a Guix system?
Date: Thu, 05 Sep 2024 20:22:19 +0200
User-agent: Evolution 3.48.4

Le jeudi 15 août 2024 à 06:00 +0000, Fredrik Salomonsson a écrit :
> No worries, I found a simple workaround for now.  I realized just after
> I sent the email that I already got a built coreboot rom.  Which is the
> one my x220 runs on.  So today I simply copied that off the chip from my
> machine using flashrom and then flashed that to my wife's machine.
> Followed the troubleshooting tips [0] to fix grub.  Cleaned up the
> connections in network manager as the device name for the WiFi had
> changed.  Now it's back to normal but with working brightness controls!

Okay that's fine. Very sorry for the delay... Since I found out that there was
no emergency I got back to my work and basically forgot about your question xD

> 
> Not sure if GNU Boot supports x220, if it does I wouldn't mind testing
> it on Guix once you are done with the GNAT port.  I got a spare x220
> that I use for testing things like this (to avoid bricking mine or my
> wife's laptop).
> 

GNU Boot unfortunately can't support x220 since it requires nonfree software to
work at all. One day, perhaps...

So basically what I did been inspired by the work of Timothy Sample from 2018,
reworked to be able to build the current GNAT version.
To build GNAT 11.4.0 on Guix System I created five packages:

1. gnat-debian:
   It involves downloading pre-built binary packages from Debian (using version
   4.9.2).
   The downloaded .deb packages include both GNAT and GCC components.
   These components are extracted, patched, and set up to create a minimal GNAT
   environment, which can be used to compile Ada code.
   The unpack phase extracts .deb archives and patches binaries, making them
   suitable for Guix.
   The install phase consolidates the libraries into a usable state.
   This stage gives us a working GNAT compiler (gnat-debian), which can be used
   in subsequent stages.

2. gnat-boot0:
   This package builds GCC 11.4.0 with Ada support (c, c++, ada) using the GNAT
   compiler from the previous stage (gnat-debian). The gnat-debian compiler is
   listed as a native-input, meaning it is used to compile this stage.
   The output is a version of GCC 11.4.0 that includes the GNAT Ada compiler,
   bootstrapped from the gnat-debian compiler.

3. gnat-final:
   This package refines the GNAT compiler produced in gnat-boot0.
   It uses the gnat-boot0 compiler as its input to create a final GNAT 11.4.0
   compiler.
   This stage ensures that the compiler is built with itself, confirming that
   the bootstrapping process is complete.
   I'm not entirely sure it's mandatory but I saw such process for building GCC
   in commencement.scm.

4. gnat:
   This package represents the GNAT 11.4.0 compiler that users would install. It
   is built using the gnat-final package and with multilib enabled (since I need
   that to build memtest86+ for example, but I did not find yet how to use
   that).
   
5. gnat-toolchain:
   This package wraps gnat into a complete toolchain, making it easy to use (for
   example to build other packages like coreboot with 'package-with-c-toolchain'
   ?).

I don't know if this is something acceptable for Guix, but I needed that to be
able to work at all on my daily driver x)

You can find the ada.scm module attached. Please note that not everything is
perfect and that there may be errors still, but it works for me (tm).

Happy hacking!
-- 
Adrien Bourmault
Trésorier et responsable Cominfra, Libre en Communs
Maintainer, GNU Boot project
Elected member, XMPP Standards Foundation
GPG : E23C26A5DEEEC5FA9CDDD57A57BC26A3687116F6


Attachment: ada.scm
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]