[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issues and improvement for `kernel-loadable-modules'
From: |
Brice Waegeneire |
Subject: |
Re: Issues and improvement for `kernel-loadable-modules' |
Date: |
Thu, 26 Mar 2020 15:56:33 +0000 |
User-agent: |
Roundcube Webmail/1.3.8 |
Hello Danny,
Sorry for the empty email; cancel and send buttons were too close for
me...
On 2020-03-26 15:13, Danny Milosavljevic wrote:
Hi Brice,
On Thu, 26 Mar 2020 14:34:03 +0000
Brice Waegeneire <address@hidden> wrote:
First I was expecting the packages in `kernel-loadable-modules' to use
the
`kernel' field as their kernel input or to have a simple procedure to
do
so. Otherwise you get a “Specified Linux kernel and Linux kernel
modules
are not all of the same version”. It makes it more difficult that it
needs
to be to write composable configurations; IOW why would I want to use
a
module built with a different kernel that the one I'm specifying in my
`operating-system'.
Because packages are modular, changing the build system can only be
done
retroactively by a procedure. We could totally do that but it would
make
the kernel-loadable-modules field more magical and more difficult to
debug.
Also, I guess it would hard-code linux-module-build-system for those
(right now you can use whatever build system you want). Do we want it
anyway?
Magic isn't the way to go, for sure. I tried writting a procedure to
abstract
it, but I wasn't successful: see my second issue with inferiors, the
fact that
it only handle `linux-build-system' and that I need to use a direct
reference to
a package. On that last point I would like to use something like
“(operating-system-kernel this-operating-system)” to reference the
kernel
but my guile foo isn't good enough: “this-operating-system” has to be in
scope
of “operating-system”. Following is the procedure I'm talking about:
--8<---------------cut here---------------start------------->8---
(kernel-loadable-modules
(map (lambda (module)
(package/inherit module
(arguments
(ensure-keyword-arguments
(package-arguments module)
`(#:linux ,my-linux)
))))
--8<---------------cut here---------------end--------------->8---
And last issue, we are missing a service to load module manually when
they
can't be auto-loaded as it's the case with `ddcci`[1]. I have managed
to
solve this one by writing my first service
`load-kernel-modules-service'.
What can I improve before submitting it as a patch -- except the
missing
documentation?
I think that things should be described by nouns and actions should be
described by verbs.
So "load-kernel-modules-service" sounds really wrong to me.
Maybe "kernel-module-loader-service"?
Others don't care so much because Scheme kinda erodes the boundary
anyway.
That's definitely a better name.
Otherwise looks good to me.
I guess it could be nice to be able to extend this service from other
services
using (service-extension load-kernel-modules-service-type '("module1"
"module2")) or something.
I think it's already the case, there are `compose' and `extend' fields
in the
`service-type' and I tried it with
“(simple-service 'ddcci-module kernel-module-loader-service-type
'("ddcci"))”.
Brice.