Skip to content

Commit ab9fa8c

Browse files
lukemarsdenclaude
andcommitted
Make uhid module loading conditional and less invasive
Only load and configure uhid module if it's not already loaded: 1. Check if uhid is loaded: lsmod | grep uhid 2. If already loaded: Print checkmark, skip 3. If not loaded: - Run modprobe uhid - Add to /etc/modules-load.d/helix.conf for boot auto-load This prevents unnecessary system modifications and is less invasive. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent dd2d01f commit ab9fa8c

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

install.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,21 +1308,25 @@ fi
13081308

13091309
# Load uhid kernel module for Helix Code (required for virtual HID devices in Wolf)
13101310
if [ "$CODE" = true ]; then
1311-
echo "Loading uhid kernel module for virtual HID device support..."
13121311
if [ "$ENVIRONMENT" = "gitbash" ]; then
1313-
echo "Skipping uhid module loading on Windows Git Bash"
1312+
echo "Skipping uhid module check on Windows Git Bash"
13141313
else
1315-
# Load module immediately
1316-
if sudo modprobe uhid 2>/dev/null; then
1317-
echo "✓ uhid module loaded"
1314+
# Check if uhid module is already loaded
1315+
if lsmod | grep -q "^uhid "; then
1316+
echo "✓ uhid module already loaded"
13181317
else
1319-
echo "Warning: Failed to load uhid module - may already be loaded or built-in"
1320-
fi
1321-
1322-
# Make uhid auto-load on boot
1323-
if [ ! -f /etc/modules-load.d/helix.conf ] || ! grep -q "^uhid" /etc/modules-load.d/helix.conf; then
1324-
echo "uhid" | sudo tee -a /etc/modules-load.d/helix.conf > /dev/null
1325-
echo "✓ uhid module configured to auto-load on boot (/etc/modules-load.d/helix.conf)"
1318+
echo "uhid module not loaded - loading now for virtual HID device support..."
1319+
if sudo modprobe uhid 2>/dev/null; then
1320+
echo "✓ uhid module loaded"
1321+
1322+
# Only configure auto-load if we had to load it manually
1323+
if [ ! -f /etc/modules-load.d/helix.conf ] || ! grep -q "^uhid" /etc/modules-load.d/helix.conf; then
1324+
echo "uhid" | sudo tee -a /etc/modules-load.d/helix.conf > /dev/null
1325+
echo "✓ uhid module configured to auto-load on boot (/etc/modules-load.d/helix.conf)"
1326+
fi
1327+
else
1328+
echo "Warning: Failed to load uhid module - Wolf may not work correctly"
1329+
fi
13261330
fi
13271331
fi
13281332
fi

0 commit comments

Comments
 (0)