1
/etc/modules includes

bbswitch load_state=0

Every time, bbswitch isn't loaded, and I have to manually:

sudo modprobe bbswitch

Then run bbswitch command to toggle graphics card.

Why isn't it respecting load_state=0?

1 Answer 1

5

Without knowing what distribution you are using, the following does apply at least for Ubuntu 16.04 and 18.04, since Ubuntu started to use systemd from 16.04 onwards.

The old module-loader script /etc/init.d/kmod would allow to put module options into /etc/modules. systemd did replace this script with an own service systemd-modules-load.service. The new method does not allow putting module options into /etc/modules and only accepts the module names each per line.
If you call /etc/init.d/kmod it will not execute the script but rather call the systemd service systemd-modules-load.service. Further it is better to get used to systemd as it is very unlikely that the old sys-v init scripts will ever experience a comeback and will rather be completely replaced.

However, if you want to load the bbswitch module with a set of options you have to do the steps as follows.

Make the module load at boot time.

root@localhost:~# echo "bbswitch" >> /etc/modules

Put your options into a /etc/modprobe.d file which is honored each time a module is loaded. So this should be even better to define module parameters. So create the file /etc/modprobe.d/bbswitch.conf and put in the line as follows.

root@localhost:~# cat /etc/modprobe.d/bbswitch.conf
options bbswitch load_state=0
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .