You are not logged in.

#1 2021-07-28 22:08:40

laiiika
Member
Registered: 2021-07-28
Posts: 7

[SOLVED] Blacklisted atkbd and need to undo it

For some dumb reason I thought it's safe to blacklist atkbd and a couple of other modules, and now I can't use my keyboard anymore. Is there a way I could boot into my system with this module loaded and fix this? Or do I have to undo this using a live OS or something like that?

Last edited by laiiika (2021-07-29 20:02:33)

Offline

#2 2021-07-28 23:45:45

laiiika
Member
Registered: 2021-07-28
Posts: 7

Re: [SOLVED] Blacklisted atkbd and need to undo it

After some sneaking around, I found out you can pass kernel parameters through bootloader (grub, in my case). There's this kernel parameter, module_blacklist which blacklists a list of comma-separated modules. Isn't something out there doing the opposite of this? i. e. loading a module even if it's blacklisted or not specified to load, through kernel parameters or anything else that can be set in bootloader?

Offline

#3 2021-07-29 09:54:37

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: [SOLVED] Blacklisted atkbd and need to undo it

Never thought of doing something like blacklisting a keyboard module so no idea if this would work, but maybe SSH into the system and remove the blacklist remotely?

Otherwise just boot the ISO or some other live environment, mount the root filesystem of your local installation, chroot into it, remove the blacklist and regenerate your initramfs (if you included the blacklist there as well).

Last edited by Omar007 (2021-07-29 09:56:11)

Offline

#4 2021-07-29 11:21:33

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,859
Website

Re: [SOLVED] Blacklisted atkbd and need to undo it

If you use systemd in your initrd, you may be able to force the early loading of the blacklisted module using the modules_load cmdline option:
https://man.archlinux.org/man/kernel-command-line.7
https://man.archlinux.org/man/systemd-m … rvice.8.en

I don't think busybox-based initrds have an equivalent ability.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2021-07-29 13:42:13

seth
Member
Registered: 2012-09-03
Posts: 51,204

Re: [SOLVED] Blacklisted atkbd and need to undo it

If that doesn't work, did you just blacklist the module or did you go for "install atkbd /bin/true"?

Offline

#6 2021-07-29 15:31:11

laiiika
Member
Registered: 2021-07-28
Posts: 7

Re: [SOLVED] Blacklisted atkbd and need to undo it

Omar007 wrote:

Never thought of doing something like blacklisting a keyboard module so no idea if this would work, but maybe SSH into the system and remove the blacklist remotely?

Otherwise just boot the ISO or some other live environment, mount the root filesystem of your local installation, chroot into it, remove the blacklist and regenerate your initramfs (if you included the blacklist there as well).

I thought of doing this but I don't have sshd service enabled on startup.

WorMzy wrote:

If you use systemd in your initrd, you may be able to force the early loading of the blacklisted module using the modules_load cmdline option:
https://man.archlinux.org/man/kernel-command-line.7
https://man.archlinux.org/man/systemd-m … rvice.8.en

I don't think busybox-based initrds have an equivalent ability.

Thanks, I should try this.

seth wrote:

If that doesn't work, did you just blacklist the module or did you go for "install atkbd /bin/true"?

Just blacklisted it.

Offline

#7 2021-07-29 15:56:42

laiiika
Member
Registered: 2021-07-28
Posts: 7

Re: [SOLVED] Blacklisted atkbd and need to undo it

WorMzy wrote:

If you use systemd in your initrd, you may be able to force the early loading of the blacklisted module using the modules_load cmdline option:
https://man.archlinux.org/man/kernel-command-line.7
https://man.archlinux.org/man/systemd-m … rvice.8.en

I don't think busybox-based initrds have an equivalent ability.

How can I do this from the bootloader? There's a linux and an initrd line, loading the kernel and initramfs image, can I pass modules_load through a parameter? If yes, what is the syntax? I couldn't find it myself.

Offline

#8 2021-07-29 16:24:33

seth
Member
Registered: 2012-09-03
Posts: 51,204

Re: [SOLVED] Blacklisted atkbd and need to undo it

Offline

#9 2021-07-29 16:56:05

laiiika
Member
Registered: 2021-07-28
Posts: 7

Re: [SOLVED] Blacklisted atkbd and need to undo it

seth wrote:

Are you sure about this? I'd already tried that to no avail. modules_load parameter is not mentioned in the link below, but there's an entry for module_blacklist.

https://www.kernel.org/doc/html/v4.14/a … eters.html

I'll undo the blacklisting using a live usb, but I've become extremely curious about loading modules through bootloader.

Last edited by laiiika (2021-07-29 17:03:36)

Offline

#10 2021-07-29 19:10:41

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,859
Website

Re: [SOLVED] Blacklisted atkbd and need to undo it

Arch uses a busybox-based initrd by default ('base' mkinitcpio hook), you need to explicitly change your mkinitcpio.conf to use the systemd hook OR use dracut for your initrd generation needs for the modules_load cmdline option to work*. Not sure about booster-generated initrds, but I assume they don't use systemd.

*note: I've never needed to use it, so this is all speculation based on reading the docs


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#11 2021-07-29 19:28:35

loqs
Member
Registered: 2014-03-06
Posts: 17,371

Re: [SOLVED] Blacklisted atkbd and need to undo it

What about changing the init to init=/usr/bin/bash -c '/usr/bin/modprobe atkbd && /usr/bin/bash' then you could fix the blacklist from the shell.

Offline

#12 2021-07-29 20:02:19

laiiika
Member
Registered: 2021-07-28
Posts: 7

Re: [SOLVED] Blacklisted atkbd and need to undo it

WorMzy wrote:

Arch uses a busybox-based initrd by default ('base' mkinitcpio hook), you need to explicitly change your mkinitcpio.conf to use the systemd hook OR use dracut for your initrd generation needs for the modules_load cmdline option to work*. Not sure about booster-generated initrds, but I assume they don't use systemd.

*note: I've never needed to use it, so this is all speculation based on reading the docs

Interesting, I should read more about this.

loqs wrote:

What about changing the init to init=/usr/bin/bash -c '/usr/bin/modprobe atkbd && /usr/bin/bash' then you could fix the blacklist from the shell.

No, you can't use init like that, AFAIK you could only pass a binary file to it with no arguments.

Thank you all for answering, I've fixed the issue with a bootable usb.

Offline

Board footer

Powered by FluxBB