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

[PATCH initramfs-tools 1/4] scripts/functions: Explicitly load keyboard drivers only at break=top



If we open a shell when udev is already running, any necessary drivers
should already have been loaded.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/functions | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/scripts/functions b/scripts/functions
index 930a12c..2156ce5 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -45,14 +45,6 @@ panic()
 		reboot
 		exit  # in case reboot fails, force kernel panic
 	fi
-	modprobe -v i8042 || true
-	modprobe -v atkbd || true
-	modprobe -v ehci-pci || true
-	modprobe -v ehci-orion || true
-	modprobe -v ehci-hcd || true
-	modprobe -v uhci-hcd || true
-	modprobe -v ohci-hcd || true
-	modprobe -v usbhid || true
 
 	run_scripts /scripts/panic
 
@@ -63,6 +55,17 @@ maybe_break()
 {
 	case ",$break," in
 	*,$1,*)
+		if [ "$1" = "top" ]; then
+			# udev is not yet running, so load keyboard drivers
+			modprobe -v i8042 || true
+			modprobe -v atkbd || true
+			modprobe -v ehci-pci || true
+			modprobe -v ehci-orion || true
+			modprobe -v ehci-hcd || true
+			modprobe -v uhci-hcd || true
+			modprobe -v ohci-hcd || true
+			modprobe -v usbhid || true
+		fi
 		panic "Spawning shell within the initramfs"
 		;;
 	esac

Attachment: signature.asc
Description: Digital signature


Reply to: