summaryrefslogtreecommitdiff
path: root/gnu/bootloader.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2025-12-14 23:37:13 +0100
committerRutherther <rutherther@ditigal.xyz>2026-01-25 21:17:44 +0100
commit15f87a0f037ec9b4f5045965416652670ffd955f (patch)
treef41eaa2b25c4851f2fc5634411d5ddb9202aa03a /gnu/bootloader.scm
parent4fa29f3bed9b8e5f7a385e242491873c6ab66fa8 (diff)
describe: Define and use ‘modules-from-current-profile’.
Fixes <https://issues.guix.gnu.org/75458>. Fixes a bug whereby bootloader, image, platform, etc. modules would be searched for in locations other than the current profile, possibly leading to incompatible files being loaded. More generally, this bug would break statelessness: depending on what happens to be available in $GUILE_LOAD_PATH, some modules would or would not be loaded. * guix/describe.scm (modules-from-current-profile): New procedure. * gnu/bootloader.scm (bootloader-modules): Use it instead of ‘all-modules’. * gnu/system/image.scm (image-modules): Likewise. (not-config?): Rename to… (neither-config-nor-git?): … this, and add (guix git). Adjust users. * guix/import/utils.scm (build-system-modules): Likewise. * guix/platform.scm (platform-modules): Likewise. * guix/upstream.scm (importer-modules): Likewise. Change-Id: I8ac55a5bcdf54990665c70d0aa558b9b2c2548d4 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #4859 Signed-off-by: Rutherther <rutherther@ditigal.xyz>
Diffstat (limited to 'gnu/bootloader.scm')
-rw-r--r--gnu/bootloader.scm11
1 files changed, 5 insertions, 6 deletions
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 5ed72662fc3..e201d1969b0 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2017 David Craven <david@craven.ch>
;;; Copyright © 2017, 2020, 2022 Mathieu Othacehe <othacehe@gnu.org>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2019, 2021, 2023 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2021, 2023, 2025 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
;;; Copyright © 2022 Reza Alizadeh Majd <r.majd@pantherx.org>
@@ -26,7 +26,8 @@
(define-module (gnu bootloader)
#:use-module (gnu system file-systems)
#:use-module (gnu system uuid)
- #:use-module (guix discovery)
+ #:autoload (guix discovery) (fold-module-public-variables)
+ #:autoload (guix describe) (modules-from-current-profile)
#:use-module (guix gexp)
#:use-module (guix profiles)
#:use-module (guix records)
@@ -305,10 +306,8 @@ instead~%")))
(define (bootloader-modules)
"Return the list of bootloader modules."
- (all-modules (map (lambda (entry)
- `(,entry . "gnu/bootloader"))
- %load-path)
- #:warn warn-about-load-error))
+ (modules-from-current-profile "gnu/bootloader"
+ #:warn warn-about-load-error))
(define %bootloaders
;; The list of publically-known bootloaders.