From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jelle Licht Subject: Loading modules built using linux-module-build-system Date: Tue, 09 Jul 2019 00:50:10 +0200 Message-ID: <877e8snntp.fsf@jlicht.xyz> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:55083) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkcSc-0003Yz-Qa for guix-devel@gnu.org; Mon, 08 Jul 2019 18:50:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkcSb-0000Vy-Sk for guix-devel@gnu.org; Mon, 08 Jul 2019 18:50:14 -0400 Received: from mail1.fsfe.org ([2001:aa8:ffed:f5f3::151]:33136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hkcSb-0000UM-Mq for guix-devel@gnu.org; Mon, 08 Jul 2019 18:50:13 -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 Hello Guix, Not too long ago, the linux-module-build-system was introduced. I ran into some code in the wild written by Alex Griffin that defines a shepherd service that does the following for a given kernel-module package: - set the LINUX_MODULE_DIRECTORY environment variable to /lib/modules - call modprobe on the .ko file (without .ko) I have verified this way of loading modules to work, but was wondering whether we should rather provide a `out-of-tree-kernel-module' service of sorts to do this. To resolve out-of-tree kernel module dependencies, I guess we would need to construct a union of all outputs so we can pass along one value for LINUX_MODULE_DIRECTORY that contains all out-of-tree modules that might be needed for one invocation of modprobe. Another issue is working with custom kernels; Alex' approach allows one to override the module package by providing an expression that resolves to a package object, which can use guile's `(inherit my-module)' approach in combination with `substitute-keyword-arguments' to do override the `#:linux' argument. This works and has the benefit of being pretty explicit in defining what we want to happen. The drawback is that one could possibly try to load a module that was built against a different kernel version than the one in your operating system expression. Is there a way by which a service can refer to the e.g. `operating-system-kernel' of the operating-system it is embedded in? - Jelle