Skip to content

add i2c_hid modules to initramfs for laptops with I2C HID keyboards#5262

Open
g1sbi wants to merge 1 commit intobasecamp:devfrom
g1sbi:fix/acer-nitro-keyboard-disabled
Open

add i2c_hid modules to initramfs for laptops with I2C HID keyboards#5262
g1sbi wants to merge 1 commit intobasecamp:devfrom
g1sbi:fix/acer-nitro-keyboard-disabled

Conversation

@g1sbi
Copy link
Copy Markdown

@g1sbi g1sbi commented Apr 8, 2026

Closes #5261

Copilot AI review requested due to automatic review settings April 8, 2026 21:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment thread migrations/1775684426.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
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keyboard disabled before login on Acer Nitro 16

2 participants