From 50247be5f4633a4c3446cddbd3515d027853ec0d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 26 Mar 2019 23:06:51 +0100 Subject: installer: Produce an 'initrd-modules' field if needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/installer/parted.scm (root-user-partition?): New procedure. (bootloader-configuration): Use it. (user-partition-missing-modules, initrd-configuration): New procedures. (user-partitions->configuration): Call 'initrd-configuration'.o * gnu/installer.scm (not-config?): Rename to... (module-to-import?): ... this. Add cases to exclude non-installer and non-build (gnu …) modules. (installer-program)[installer-builder]: Add GUIX to the extension list. --- gnu/installer.scm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'gnu/installer.scm') diff --git a/gnu/installer.scm b/gnu/installer.scm index 02f26eead3..584ca3842f 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -43,13 +43,17 @@ #:use-module (srfi srfi-1) #:export (installer-program)) -(define not-config? - ;; Select (guix …) and (gnu …) modules, except (guix config). +(define module-to-import? + ;; Return true for modules that should be imported. For (gnu system …) and + ;; (gnu packages …) modules, we simply add the whole 'guix' package via + ;; 'with-extensions' (to avoid having to rebuild it all), which is why these + ;; modules are excluded here. (match-lambda (('guix 'config) #f) - (('guix rest ...) #t) - (('gnu rest ...) #t) - (rest #f))) + (('gnu 'installer _ ...) #t) + (('gnu 'build _ ...) #t) + (('guix 'build _ ...) #t) + (_ #f))) (define* (build-compiled-file name locale-builder) "Return a file-like object that evalutes the gexp LOCALE-BUILDER and store @@ -296,13 +300,15 @@ selected keymap." "gnu/installer")) (define installer-builder + ;; Note: Include GUIX as an extension to get all the (gnu system …), (gnu + ;; packages …), etc. modules. (with-extensions (list guile-gcrypt guile-newt guile-parted guile-bytestructures - guile-json) + guile-json guile-git guix) (with-imported-modules `(,@(source-module-closure `(,@modules (guix build utils)) - #:select? not-config?) + #:select? module-to-import?) ((guix config) => ,(make-config.scm))) #~(begin (use-modules (gnu installer record) -- cgit v1.2.3