summaryrefslogtreecommitdiff
path: root/gnu/system/linux-initrd.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2017-10-08 09:52:24 +0100
committerChristopher Baines <mail@cbaines.net>2017-10-08 17:31:49 +0100
commitb36e06c2b0889f1d0f939465589d36887ff24d33 (patch)
treeae7e66a2f39fe73244db6d56f45e2653127d1c50 /gnu/system/linux-initrd.scm
parentfe90a6e08b1e82d13cf1604322235c78a3278fb9 (diff)
linux-initrd: Ensure that the guile used in the initrd is referenced.
By referencing guile from the initrd output explicitly, it will be present in the store when this initrd is used. If the exact guile used within the initrd isn't present in the store, then after root is switched during the boot process, loading modules (such as (ice-9 popen)) won't work. This fixes guix-patches bug #28399, "Fix mysql activation, and add a basic test". * gnu/system/linux-initrd.scm (expression->initrd)[builder]: Write out a file called references in to the initrd output, which includes the store path for guile.
Diffstat (limited to 'gnu/system/linux-initrd.scm')
-rw-r--r--gnu/system/linux-initrd.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 5a7aec5c87e..969a89266c2 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -78,6 +78,19 @@ the derivations referenced by EXP are automatically copied to the initrd."
78 (use-modules (gnu build linux-initrd)) 78 (use-modules (gnu build linux-initrd))
79 79
80 (mkdir #$output) 80 (mkdir #$output)
81
82 ;; The guile used in the initrd must be present in the store, so
83 ;; that module loading works once the root is switched.
84 ;;
85 ;; To ensure that is the case, add an explicit reference to the
86 ;; guile package used in the initrd to the output.
87 ;;
88 ;; This fixes guix-patches bug #28399, "Fix mysql activation, and
89 ;; add a basic test".
90 (call-with-output-file (string-append #$ output "/references")
91 (lambda (port)
92 (simple-format port "~A\n" #$guile)))
93
81 (build-initrd (string-append #$output "/initrd") 94 (build-initrd (string-append #$output "/initrd")
82 #:guile #$guile 95 #:guile #$guile
83 #:init #$init 96 #:init #$init