A last attempt before recompiling kernel: Finding a way to disable the
button kernel module.
I took a look at the kernel's source code, and the module that enables the lid switch is called
buttonhttps://github.com/torvalds/linux/blob/master/drivers/acpi/button.cbutton does not show up in output of
lsmod or
find /lib/modules/4.19.10-tiny
core64/kernel/ -name 'button.ko.gz' but does show up in output of
ls /sys/module, so it's loaded and must be a kernel builtin. Therefore, it cannot be blacklisted with
blacklist=<module_name> kernel boot parameter.
However, it seems there is a
way to disable built-in kernel modules:
initcall_blacklist=<module's_initialization_function>. I can't find a function in
button.c that has the
__init attribute, so I tried blacklisting various functions in
button.c that have
_init in the name, to no avail.
Can someone help me figure out which initcall I should blacklist in order to prevent the
button kernel module from being loaded (or some other way to disable that module short of recompiling kernel)? I realize it would probably disable both my lid switch and power button, but that's fine--I only use the power button to power on, never to poweroff.