From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evMkK-0008Gz-GA for guix-patches@gnu.org; Mon, 12 Mar 2018 08:40:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evMkE-0006nT-Ok for guix-patches@gnu.org; Mon, 12 Mar 2018 08:40:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:48193) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1evMkE-0006n4-LL for guix-patches@gnu.org; Mon, 12 Mar 2018 08:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1evMkE-000305-FD for guix-patches@gnu.org; Mon, 12 Mar 2018 08:40:02 -0400 Subject: [bug#30604] [PATCH v10 2/6] linux-modules: Add 'load-linux-modules-from-directory'. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 12 Mar 2018 13:39:14 +0100 Message-Id: <20180312123918.22645-2-ludo@gnu.org> In-Reply-To: <20180312123918.22645-1-ludo@gnu.org> References: <87ina1qxic.fsf@gnu.org> <20180312123918.22645-1-ludo@gnu.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30604@debbugs.gnu.org * gnu/build/linux-modules.scm (load-linux-modules-from-directory): New procedure. * gnu/build/linux-boot.scm (boot-system)[lookup-module]: Remove. Use 'load-linux-modules-from-directory' instead. --- gnu/build/linux-boot.scm | 9 ++------- gnu/build/linux-modules.scm | 12 ++++++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 18d87260a..df0b2b2d1 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -469,10 +469,6 @@ upon error." mounts) "ext4")) - (define (lookup-module name) - (string-append linux-module-directory "/" - (ensure-dot-ko name))) - (display "Welcome, this is GNU's early boot Guile.\n") (display "Use '--repl' for an initrd REPL.\n\n") @@ -487,9 +483,8 @@ upon error." (start-repl)) (display "loading kernel modules...\n") - (for-each (cut load-linux-module* <> - #:lookup-module lookup-module) - (map lookup-module linux-modules)) + (load-linux-modules-from-directory linux-modules + linux-module-directory) (when qemu-guest-networking? (unless (configure-qemu-networking) diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm index 6101b8dc3..1337b5e88 100644 --- a/gnu/build/linux-modules.scm +++ b/gnu/build/linux-modules.scm @@ -38,6 +38,7 @@ modules-loaded module-loaded? load-linux-module* + load-linux-modules-from-directory current-module-debugging-port @@ -232,6 +233,17 @@ appears in BLACK-LIST are not loaded." (or (and recursive? (= EEXIST (system-error-errno args))) (apply throw args))))))) +(define (load-linux-modules-from-directory modules directory) + "Load MODULES and their dependencies from DIRECTORY, a directory containing +the '.ko' files. The '.ko' suffix is automatically added to MODULES if +needed." + (define (lookup-module name) + (string-append directory "/" (ensure-dot-ko name))) + + (for-each (cut load-linux-module* <> + #:lookup-module lookup-module) + (map lookup-module modules))) + ;;; ;;; Device modules. -- 2.16.2