add i2c_hid modules to initramfs for laptops with I2C HID keyboards#5262
add i2c_hid modules to initramfs for laptops with I2C HID keyboards#5262g1sbi wants to merge 1 commit intobasecamp:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for laptops with I2C HID built-in keyboards (like the Acer Nitro 16) by detecting these keyboards at installation and ensuring the required kernel modules are included in the initramfs. This allows the keyboard to work at the LUKS passphrase prompt (Plymouth).
Changes:
- New migration script to detect and configure I2C HID modules for existing systems
- New installation script to detect and configure I2C HID modules during fresh installations
- Integration of the installation script into the hardware configuration pipeline
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| migrations/1775684426.sh | Migration script to add i2c_hid modules to existing systems and regenerate initramfs |
| install/config/hardware/fix-i2c-hid-keyboard.sh | Installation-time script to detect and configure I2C HID modules |
| install/config/all.sh | Registration of the new fix-i2c-hid-keyboard.sh script in the installation pipeline |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # The standard `keyboard` mkinitcpio hook only bundles PS/2 and USB HID drivers. | ||
| if find /sys/bus/i2c/drivers/i2c_hid_acpi -maxdepth 1 -name 'i2c-*' 2>/dev/null | grep -q .; then | ||
| echo "Detected I2C HID keyboard, adding i2c_hid modules to initramfs" | ||
| echo "MODULES=(i2c_hid i2c_hid_acpi)" | sudo tee /etc/mkinitcpio.conf.d/i2c_hid_keyboard.conf >/dev/null |
There was a problem hiding this comment.
Using MODULES=() overwrites previously configured modules instead of appending. This will remove modules added by other hardware detection scripts (like NVIDIA, Apple T2, etc.). Use MODULES+=() instead to append to the existing module list, consistent with other hardware detection scripts in the codebase (e.g., install/config/hardware/apple/fix-t2.sh, install/config/hardware/nvidia.sh).
|
|
||
| if find /sys/bus/i2c/drivers/i2c_hid_acpi -maxdepth 1 -name 'i2c-*' 2>/dev/null | grep -q .; then | ||
| echo "Detected I2C HID keyboard, adding i2c_hid modules to initramfs" | ||
| echo "MODULES=(i2c_hid i2c_hid_acpi)" | sudo tee /etc/mkinitcpio.conf.d/i2c_hid_keyboard.conf >/dev/null |
There was a problem hiding this comment.
Using MODULES=() overwrites previously configured modules instead of appending. This will remove modules added by other hardware detection scripts (like NVIDIA, Apple T2, etc.). Use MODULES+=() instead to append to the existing module list, consistent with other hardware detection scripts (e.g., migrations/1758455816.sh which uses thunderbolt).
Closes #5261