Fedora 27:如何让Caps-lock LED在LUKS加密盘密码输入前正常工作?
Hey there, let's tackle this Caps Lock LED issue you're facing with your Dell Inspiron 3542 and Fedora 27. The key thing to note here is that Fedora 27 uses dracut instead of the older mkinitrd for building initramfs images, which is probably why your previous attempts with /etc/modprobe.conf and mkinitrd didn't pan out. Let's walk through the correct steps:
Step 1: Identify Required Keyboard LED Modules
First, after booting into your system normally, find out which modules control your keyboard's LED functionality. Run this command:
lsmod | grep -E 'atkbd|i8042|led_class'
For most Dell laptops with PS/2-style keyboards (even USB models often emulate PS/2), you'll need atkbd (the keyboard driver), i8042 (the PS/2 controller driver), and led_class (the core LED framework).
Step 2: Configure Dracut to Preload These Modules
Create a custom dracut configuration file to ensure these modules are included in the initramfs (the environment where you enter your LUKS password):
sudo nano /etc/dracut.conf.d/keyboard-leds.conf
Add this line to the file:
add_drivers+=" atkbd i8042 led_class "
Save the file and exit (for nano, press Ctrl+O, hit enter, then Ctrl+X).
Step 3: Regenerate the Initramfs Image
Now rebuild the initramfs using dracut. This command automatically uses your running kernel version:
sudo dracut -f /boot/initramfs-$(uname -r).img $(uname -r)
Step 4: Test the Fix
Reboot your laptop. When you reach the LUKS password prompt, press the Caps Lock key—you should see the LED light up as expected.
If It Still Doesn't Work: Adjust i8042 Parameters
Some Dell devices require specific i8042 module parameters to enable LED support early on. Edit your dracut config file again:
sudo nano /etc/dracut.conf.d/keyboard-leds.conf
Add this line to enable proper PS/2 detection:
kernel_cmdline+=" i8042.nopnp=0 "
Regenerate the initramfs once more and reboot to test.
内容的提问来源于stack exchange,提问作者elbarna

