USB-keyboard not recognized during boot

I have a problem with a specific USB-keyboard (Cherry G230) during booting NixOS 21.05: It seems that the initrd of NixOS does not recognize the keyboard and disables it:

  • The keyboard works in the boot-menu (systemd-boot).
  • Then, NixOS initrd starts to boot and seems to disable the keyboard (so e.g. no crypt-password can be entered to decrypt the harddisk).
  • Re-connecting the keyboard does not help.
  • After NixOS has booted, the keyboard works normally.

A different USB-keyboard works well (both when connected from the beginning and when connected only to enter the crypt-password).
On a different PC with an older NixOS version and grub, the “problematic” keyboard works.

Is there any way to solve this?

maybe relevant dmesg messages::

[...] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[...] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.

with the working keyboard:
[...] usb 1-2: new low-speed USB device number 3 using xhci_hcd
[...] usb 1-2: New USB device found, idVendor=03f0, idProduct=034a, bcdDevice= 1.21
[...] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[...] usb 1-2: Product: HP Elite USB Keyboard
[...] usb 1-2: Manufacturer: Chicony
[...] hid: raw HID events driver (C) Jiri Kosina
[...] usbcore: registered new interface driver usbhid
[...] usbhid: USB HID core driver
[...] input: Chicony HP Elite USB Keyboard as /devices/.../input/input0
[...] hid-generic 0003:03F0:034A.0001: input,hidraw0: USB HID v1.10 Keyboard [Chicony HP Elite USB Keyboard] on usb-0000:04:00.3-2/input0
[...] input: Chicony HP Elite USB Keyboard System Control as /devices/.../input/input1
[...] input: Chicony HP Elite USB Keyboard Consumer Control as /devices/.../input/input2
[...] hid-generic 0003:03F0:034A.0002: input,hidraw1: USB HID v1.10 Device [Chicony HP Elite USB Keyboard] on usb-0000:04:00.3-2/input1

with the non-working keyboard:
[...] usb 1-2: new low-speed USB device number 5 using xhci_hcd
[...] usb 1-2: New USB device found, idVendor=046a, idProduct=0023, bcdDevice= 0.32
[...] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[...] usb 1-2: USB disconnect, device number 5

when connecting the non-working keyboard after NixOS has booted:
[...] usb 1-2: new low-speed USB device number 7 using xhci_hcd
[...] usb 1-2: New USB device found, idVendor=046a, idProduct=0023, bcdDevice= 0.32
[...] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[...] input: HID 046a:0023 as /devices/.../input/input17
[...] cherry 0003:046A:0023.0008: input,hidraw0: USB HID v1.11 Keyboard [HID 046a:0023] on usb-0000:04:00.3-2/input0
[...] input: HID 046a:0023 as /devices/.../input/input18
[...] cherry 0003:046A:0023.0009: input,hidraw1: USB HID v1.11 Device [HID 046a:0023] on usb-0000:04:00.3-2/input1
1 Like

I’d suspect a missing kernel module in the initramfs, though I don’t know which - either way, it probably only needs to be added to boot.kernelModules.

1 Like

You need to set boot.initrd.availableKernelModules = [ "hid_cherry" ];.

Relevant PRs:

Thanks, I added “hid_cherry” (a few minutes before your post ;)), and it works.