guix-devel
[Top][All Lists]
Advanced

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

Re: Building a software toolchain that works


From: Josselin Poiret
Subject: Re: Building a software toolchain that works
Date: Wed, 16 Mar 2022 15:02:07 +0100

Hello everyone,

Let me chime in on a specific point.

"David Arroyo" <david@aqwari.net> writes:
> I recently used guix to make a one-line change to the dovecot-pigeonhole
> package. Initially I tried to do this without guix, and had difficulties
> using autoconf/automake. So instead, I made my changes, captured them with
> `git diff`, and then used the `--with-patch` option of `guix install` to
> build and install the modified version. It wasn't too hard, but it could
> have been easier. It may have not been worth the effort in this case for
> someone new to guix, but the nice thing is I could take the same steps
> to modify any piece of free software for which a guix package exists,
> regardless of the build system in use.

I recently did the same to produce my LUKS2 patches for GRUB [1]!
What I did was hack on the code to add what I needed, produce some
patches with `git format-patch` then define

--8<---------------cut here---------------start------------->8---
(define grub-efi-luks2
  (package/inherit grub-efi
    (source
     (origin
       (inherit (package-source grub-efi))
       (patches (cons* 
"0001-devmapper-getroot-Have-devmapper-recognize-LUKS2.patch"
                       
"0002-devmapper-getroot-Set-up-cheated-LUKS2-cryptodisk-mo.patch"
                       (origin-patches (package-source grub-efi))))))))
--8<---------------cut here---------------end--------------->8---

With this, I could test build failures, but then I also ended up testing
the resulting GRUB in a VM by installing guix with a config.scm that had
the following:

--8<---------------cut here---------------start------------->8---
(operating-system
  (bootloader (bootloader-configuration
                (bootloader
                 (bootloader
                  (inherit grub-efi-bootloader)
                  (package grub-efi-luks2)))
                (target "/boot/efi")
                (keyboard-layout keyboard-layout)))
  ...)
--8<---------------cut here---------------end--------------->8---

This made it extremely easy to test my changes!  I don't think I
would've written these patches without Guix's help.

[1] https://lists.gnu.org/archive/html/grub-devel/2021-12/msg00076.html

Best,
-- 
Josselin Poiret



reply via email to

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