[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Kernel modules in initrd

From: Danny Milosavljevic
Subject: Re: Kernel modules in initrd
Date: Mon, 26 Feb 2018 17:26:47 +0100

Hi Ludo,

On Mon, 26 Feb 2018 16:20:08 +0100
address@hidden (Ludovic Courtès) wrote:

> I suppose the bits I’ve promised to detect necessary modules based on
> modules.alias and /sys should be useful here?


I've posted a working patch series (v3, "Load Linux module only when supported
hardware is present") of the current kmod-based autoloader to guix-patches.
It's using an old-ish kmod - but otherwise it works fine.

So what we would need next is something like modprobe written in guile.

I think that ./gnu/build/linux-modules.scm load-linux-module* already does that.

The only part missing is to replace %modprobe-wrapper by a guile script
which imports ./gnu/build/linux-modules.scm load-linux-module*, interprets
some of the modprobe options and then masquerades as modprobe without invoking

The reason is that the kernel calls us back when it needs a module (for
example when you mount something and it needs a charset converter or something).

(the name of the executable invoked is configured via /proc/sys/kernel/modprobe)

This can happen quite early in the boot process - and it took me some time
to get the order and also the environment variables right.  We should be able
to reuse that for the pure Guile modprobe.

After the patch we don't *manually* load any of the modules - and all the
tests work.  I booted my system with it - that also works.

P.S. How come glibc is in the initrd?  Shouldn't guile have statically linked 
glibc is like 50000 kiB.  In that case saving 800 kiB is not really worth it...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]