From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 27 09:26:10 2018 Received: (at 30604) by debbugs.gnu.org; 27 Feb 2018 14:26:10 +0000 Received: from localhost ([127.0.0.1]:34594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqgCn-0003T9-Vw for submit@debbugs.gnu.org; Tue, 27 Feb 2018 09:26:10 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:52424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqgCm-0003Sz-Bb for 30604@debbugs.gnu.org; Tue, 27 Feb 2018 09:26:08 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id D2C2D11FDE; Tue, 27 Feb 2018 15:26:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c7om1nzrY475; Tue, 27 Feb 2018 15:26:06 +0100 (CET) Received: from ribbon (unknown [193.50.110.216]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6E96B11CC3; Tue, 27 Feb 2018 15:26:06 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Danny Milosavljevic Subject: Re: [bug#30604] [PATCH v3 4/6] linux-boot: Load kernel modules only when the hardware is present. References: <20180226035025.1698-1-dannym@scratchpost.org> <20180226040609.3066-1-dannym@scratchpost.org> <20180226040609.3066-5-dannym@scratchpost.org> Date: Tue, 27 Feb 2018 15:26:06 +0100 In-Reply-To: <20180226040609.3066-5-dannym@scratchpost.org> (Danny Milosavljevic's message of "Mon, 26 Feb 2018 05:06:07 +0100") Message-ID: <87muzu33wh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30604 Cc: 30604@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hello, Nice patch series! Danny Milosavljevic skribis: > * gnu/build/linux-boot.scm (boot-system): Load kernel modules only when > the hardware is present. > * gnu/system/linux-initrd.scm (raw-initrd): Add imports. [...] > + (define (load-kernel-modules) > + "Examine /sys/devices to find out which modules to load and load the= m." > + (define enter? > + (const #t)) > + (define (down! path stat result) > + ;; Note: modprobe mutates the tree starting with path. > + (let ((modalias-name (string-append path "/modalias"))) > + (if (file-exists? modalias-name) > + (let ((modalias > + (string-trim-right (call-with-input-file modalias-name > + read-string) > + #\newline))) > + (system* "/sbin/modprobe" "-q" "--" modalias)))) Can we build upon (gnu build linux-modules) to achieve this? Hopefully the tools at can help a bit. Thanks, Ludo=E2=80=99.