[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] Load modules for USB keyboard if not keyboard is present at panic



USB modules are not normally loaded at break=top time but since USB
keyboards are very common we should take the effort to try to load
extra kernel modules at break (=panic) time. This patch closes #615831
and has been adapted from comments mentioned in

https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/229732

and tested on on HP ProLiant MicroServer that lacks a PS2 port
completely.
---
 scripts/functions |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/scripts/functions b/scripts/functions
index 579696a..778196f 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -46,6 +46,13 @@ panic()
 	fi
 	modprobe i8042
 	modprobe atkbd
+	if ! grep -q '^H:.*kbd' /proc/bus/input/devices ; then
+		# no keyboard? Try USB.
+		modprobe ehci-hcd
+		modprobe uhci-hcd
+		modprobe ohci-hcd
+		modprobe usbhid
+	fi
 	REASON="$@" PS1='(initramfs) ' /bin/sh -i </dev/console >/dev/console 2>&1
 }
 
-- 
1.7.2.3


Reply to: