You are not logged in.

#1 2013-01-31 22:45:50

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Problem blacklisting modules from initramfs

Following the wiki, I'm failing to prevent some modules from being added to my initramfs.

The modules are mptspi and mptsas. These are modules for SCSI and SAS HBAs, and are "pulled in" by the block hook. They require some other modules as dependencies, but those are the only two that appear in mkinitcpio -M output. So I created /etc/modprobe.d/modprobe.conf:

blacklist mptspi
blacklist mptsas

and modified mkinitcpio.conf:

...
FILES="/etc/modprobe.d/modprobe.conf"
...

but after running mkinitcpio, the image still contains the modules.

I tried adding all of the related modules to the blacklist file as well, but that had no effect.

I've removed the block hook and explicitly added the necessary modules and the resulting image works fine. I would like to know what I'm doing wrong though. Thanks.

Last edited by alphaniner (2013-01-31 22:46:24)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#2 2013-02-02 14:12:32

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Problem blacklisting modules from initramfs

Have you tried adding the modconf hook in mkinitcpio.conf ?

mkinitcpio -H modconf
==> Help for hook 'modconf':
This hook installs modprobe configuration files from /etc/modprobe.d and
/usr/lib/modprobe.d.

Last edited by Lone_Wolf (2013-02-02 14:12:44)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2013-02-02 14:33:15

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: Problem blacklisting modules from initramfs

blacklisting doesn't prevent the modules from being added to the initramfs, it only prevents the modules from being loaded.

Offline

#4 2013-02-04 14:38:49

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Problem blacklisting modules from initramfs

@ Lone_Wolf

Thanks, but that didn't help.

MODULES=""

BINARIES=""

FILES="/etc/modprobe.d/modprobe.conf"

HOOKS="base udev autodetect modconf block lvm2 filesystems fsck shutdown"

I also tried with nothing in the FILES array.

Last edited by alphaniner (2013-02-04 14:38:59)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#5 2013-02-04 16:48:27

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Problem blacklisting modules from initramfs

65kid wrote:

blacklisting doesn't prevent the modules from being added to the initramfs, it only prevents the modules from being loaded.

This. This is your answer. blacklisting has nothing to do with whether or not it's added to the initramfs.

Offline

#6 2013-02-04 17:57:37

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Problem blacklisting modules from initramfs

falconindy wrote:
65kid wrote:

blacklisting doesn't prevent the modules from being added to the initramfs, it only prevents the modules from being loaded.

This. This is your answer. blacklisting has nothing to do with whether or not it's added to the initramfs.

I understand what blacklisting does, and that it has no direct influence on the initramfs. But 65kid's response (and yours a bit too) are ambiguous and don't rule out indirect influence.

Some examples of non-ambiguous answers: "The method described in the wiki is completely invalid" or "You're mis-understanding that bit of the wiki" etc.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#7 2013-02-04 18:28:11

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Problem blacklisting modules from initramfs

Ambiguous? The wiki makes exactly the same claim:

tfw wrote:

Blacklisting, in the context of kernel modules, is a mechanism to prevent the kernel module from loading.
...
to prevent the initramfs from loading some of those modules, blacklist them

What about this is vague? Given the presence of a module and a blacklist, the module will not be loaded. Loading effectively means "modprobe $somemodule". It has nothing to do with whether or not the module will be added to the initramfs.

Offline

#8 2013-02-04 18:53:37

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Problem blacklisting modules from initramfs

to prevent the initramfs from loading some of those modules, blacklist them

Ahh crap. I read that as "prevent the modules from being loaded into the initramfs." That was contrary to what you and 65kid were saying, and I was unsure which was correct.

In my defense, it seems silly to have at least two easy ways (this and bootloader kernel line) of preventing modules from being loaded, but (apparently) no similarly easy way of preventing modules being put into the initramfs in the first place.

Anyway, thanks for straightening me out.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

Board footer

Powered by FluxBB