You are not logged in.

#1 2020-03-11 13:19:44

olly
Member
From: South West England
Registered: 2017-08-22
Posts: 38

[SOLVED] setting kernel parameters and blacklisting modules

Which is preferable when setting kernel parameters and blacklisting modules

- on the kernel options line

- through files modprobe.d and sysctl.d

Is one more in line with correct protocol than the other ?

Thanks Olly

Last edited by olly (2020-03-11 15:08:53)


Bullies are only weak people trying to compensate for their own inadequacy. If they can't compete intellectually, they bully.

Offline

#2 2020-03-11 14:03:15

seth
Member
Registered: 2012-09-03
Posts: 49,961

Re: [SOLVED] setting kernel parameters and blacklisting modules

The kernel commandline is more flexible and advisable for temporary changes (trial and error) and implicitly affects the initramfs
The filesystem entries allow to deploy parameters with a package, but might require a rebuild of the initramfs and if the parameter breaks the boot process, you'll have to fix that offline (ie. from a live distro or so)

Both are equally legit, preference is a matter of context.

Offline

#3 2020-03-11 14:11:50

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,932
Website

Re: [SOLVED] setting kernel parameters and blacklisting modules

If you decide to use the config files method, be sure to have the mkinitcpio hook "modconf" enabled.
Also you'll need to rebuild the initramfs after each module configuration change.

Offline

#4 2020-03-11 14:32:15

olly
Member
From: South West England
Registered: 2017-08-22
Posts: 38

Re: [SOLVED] setting kernel parameters and blacklisting modules

Thanks for replies. Food for thought. Question though - do you have to rebuild initramfs if the modules are not specified in the mkinitcpio hooks ?

Last edited by olly (2020-03-11 14:35:38)


Bullies are only weak people trying to compensate for their own inadequacy. If they can't compete intellectually, they bully.

Offline

#5 2020-03-11 14:36:10

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,932
Website

Re: [SOLVED] setting kernel parameters and blacklisting modules

No. But this could lead to unwanted behaviour of the kernel modules during the initramfs phase. E.g. a blacklisted module could already be loaded during the initramfs phase and then keep persisting in the kernel despite being blacklisted.
Edit: You can of course automate the rebuilding of the initramfs on changes:
/etc/systemd/system/mkinitcpio.service

[Unit]
Description=Rebuild initramfs

[Service]
ExecStart=/usr/bin/mkinitcpio -P

/etc/systemd/system/mkinitcpio.path

[Unit]
Description=Watch for changed module configuration

[Path]
PathChanged=/etc/modprobe.d
PathChanged=/etc/modules-load.d

[Install]
WantedBy=multi-user.target

Edit 2:

olly wrote:

Thanks for replies. Food for thought. Question though - do you have to rebuild initramfs if the modules are not specified in the mkinitcpio hooks ?

This will of course only affect modules listed in

mkinitcpio -M

and those, which you explicitely included.

Last edited by schard (2020-03-11 14:51:46)

Offline

#6 2020-03-11 14:52:27

olly
Member
From: South West England
Registered: 2017-08-22
Posts: 38

Re: [SOLVED] setting kernel parameters and blacklisting modules

Thanks again for reply. Yes, I understand.

I'm coming to the conclusion that the kernel command line is good for testing and temporary modifying,  but using the configuration files and rebuilding the initramfs results in a system that is actually configured for what is wanted and will boot as such.

Thanks for such informed and concise  information.

Olly


Bullies are only weak people trying to compensate for their own inadequacy. If they can't compete intellectually, they bully.

Offline

Board footer

Powered by FluxBB