From 8a37489379914910a140c313ca50a5e502f9f92e Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Sat, 24 Jan 2009 20:17:54 -0600 Subject: Advanced USB delay handling USB boot delay is now handled with the usbdelay kernel param (default=0) We use the built in delay of usb-storage to control this. by setting the module's delay param. If your USB device doesn't work on first boot, try setting usbdelay=10 or so Signed-off-by: Aaron Griffin --- archiso/Makefile | 2 ++ archiso/hooks/archiso | 8 +++----- archiso/hooks/archiso-early | 8 ++++++++ archiso/install/archiso-early | 9 +++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 archiso/hooks/archiso-early create mode 100644 archiso/install/archiso-early (limited to 'archiso') diff --git a/archiso/Makefile b/archiso/Makefile index 27f6550..6db47e5 100644 --- a/archiso/Makefile +++ b/archiso/Makefile @@ -7,7 +7,9 @@ install: all install -D -m 755 testiso $(DESTDIR)/usr/bin/testiso # hooks/install are needed by mkinitcpio install -D -m 644 hooks/archiso $(DESTDIR)/lib/initcpio/hooks/archiso + install -D -m 644 hooks/archiso-early $(DESTDIR)/lib/initcpio/hooks/archiso-early install -D -m 644 install/archiso $(DESTDIR)/lib/initcpio/install/archiso + install -D -m 644 install/archiso-early $(DESTDIR)/lib/initcpio/install/archiso-early uninstall: rm -f $(DESTDIR)/usr/sbin/mkarchiso diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index d33e409..65e849e 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -54,13 +54,11 @@ run_hook () msg "done." # external drives may need to settle - msg ":: Waiting for usb devices to settle..." + msg ":: Waiting for devices to settle..." /sbin/udevadm trigger --subsystem-match=usb /sbin/udevadm settle - if [ "${rootdelay}" != "0" ]; then - /bin/sleep "${rootdelay}" - export rootdelay=0 - fi + msg ":: Waiting ${usbdelay:-0}s for USB devices" + /bin/sleep "${usbdelay:-0}" msg ":: Scanning for boot device..." diff --git a/archiso/hooks/archiso-early b/archiso/hooks/archiso-early new file mode 100644 index 0000000..0a83218 --- /dev/null +++ b/archiso/hooks/archiso-early @@ -0,0 +1,8 @@ +# vim: set ft=sh: +run_hook () +{ + # Set our usbdelay time. Default: 0 + /bin/mkdir -p /etc/modprobe.d/ + echo "options usb-storage delay_use=${usbdelay:-0}" >/ + /etc/modprobe.d/usb-delay +} diff --git a/archiso/install/archiso-early b/archiso/install/archiso-early new file mode 100644 index 0000000..66b8579 --- /dev/null +++ b/archiso/install/archiso-early @@ -0,0 +1,9 @@ +install () +{ + MODULES="" + BINARIES="" + FILES="" + SCRIPT="archiso-early" +} + +# vim:ft=sh:ts=4:sw=4:et: -- cgit v1.2.2