From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cech?= Subject: [WIP PATCH] linux-initrd: Allow own set of kernel modules. Date: Thu, 28 Jul 2016 12:42:24 +0200 Message-ID: <20160728104224.10523-1-sleep_walker@gnu.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSilr-0007Jp-JQ for guix-devel@gnu.org; Thu, 28 Jul 2016 06:42:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSiln-0007lD-F8 for guix-devel@gnu.org; Thu, 28 Jul 2016 06:42:30 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/system/linux-initrd.scm(base-initrd): Add `linux-modules' parameter. Rename former `linux-modules' to `default-linux-modules'. Introduce used-linux-modules to make the code more readable. --- gnu/system/linux-initrd.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index bbaa5c0..4934c92 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -138,6 +138,7 @@ MODULES and taken from LINUX." qemu-networking? (virtio? #t) volatile-root? + (linux-modules #f) (extra-modules '())) "Return a monadic derivation that builds a generic initrd, with kernel modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be @@ -174,7 +175,7 @@ loaded at boot time in the order in which they appear." (lambda (fs) (string=? (file-system-type fs) type))) - (define linux-modules + (define default-linux-modules ;; Modules added to the initrd and loaded from the initrd. `("ahci" ;for SATA controllers "usb-storage" "uas" ;for the installation image etc. @@ -220,8 +221,13 @@ loaded at boot time in the order in which they appear." (open source target))) mapped-devices)) + (define used-linux-modules + (if (equal? linux-modules #f) + default-linux-modules + linux-modules)) + (mlet %store-monad ((kodir (flat-linux-module-directory linux - linux-modules))) + used-linux-modules))) (expression->initrd (with-imported-modules '((guix build bournish) (guix build utils) @@ -251,7 +257,7 @@ loaded at boot time in the order in which they appear." (boot-system #:mounts '#$(map file-system->spec file-systems) #:pre-mount (lambda () (and #$@device-mapping-commands)) - #:linux-modules '#$linux-modules + #:linux-modules '#$used-linux-modules #:linux-module-directory '#$kodir #:qemu-guest-networking? #$qemu-networking? #:volatile-root? '#$volatile-root?))) -- 2.9.2