-keyboard+sadness, failing autodetect in initramfs

On some servers I've struggled to get early keyboard support out of the initramfs when you need to type your password. Not everyone likely "lives" like me where I unplug keyboards from systems (particularly at home) to keep things tidy. However this seems to manifest sometimes with iDRAC and IPMI depending on the state of the out of band management controller at the exact time you're generating your initramfs.

If you have autodetect as one of your hooks you can run mkinitcpio -M while your keyboard of choice is plugged in to see what module you will need to add to your MODULES directive. For example I have an older microsoft keyboard here that I use to type my luks password in on my server.

If you run mkinitcpio -M with the keyboard unplugged, then plugged in, you can see there is a different list:

mkinitcpio -M >> without_keyboard.txt

...plug in keyboard to system

mkinitcpio -M >> with_keyboard.txt

diff with_keyboard.txt without_keyboard.txt

< hid_microsoft

From here you'd want to go add hid_microsoft to the MODULES directive of your /etc/mkinitcpio.conf to ensure that the keyboard will be available without the fallback initramfs.

For reference, if you're seeing this on iDRAC you likely need hid-generic uas added to your modules directive.