etc/ash_functions: remove redundant lsmod prior of insmod

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
Thierry Laurion 2024-02-22 14:35:26 -05:00
parent bec2545688
commit 35de23483a
No known key found for this signature in database
GPG Key ID: 9A53E1BB3FF00461

View File

@ -318,35 +318,15 @@ enable_usb()
{ {
TRACE "Under /etc/ash_functions:enable_usb" TRACE "Under /etc/ash_functions:enable_usb"
#insmod ehci_hcd prior of uhdc_hcd and ohci_hcd to suppress dmesg warning #insmod ehci_hcd prior of uhdc_hcd and ohci_hcd to suppress dmesg warning
if ! lsmod | grep -q ehci_hcd; then insmod /lib/modules/ehci-hcd.ko || die "ehci_hcd: module load failed"
insmod /lib/modules/ehci-hcd.ko \
|| die "ehci_hcd: module load failed"
fi
if [ "$CONFIG_LINUX_USB_COMPANION_CONTROLLER" = y ]; then if [ "$CONFIG_LINUX_USB_COMPANION_CONTROLLER" = y ]; then
if ! lsmod | grep -q uhci_hcd; then insmod /lib/modules/uhci-hcd.ko || die "uhci_hcd: module load failed"
insmod /lib/modules/uhci-hcd.ko \ insmod /lib/modules/ohci-hcd.ko || die "ohci_hcd: module load failed"
|| die "uhci_hcd: module load failed" insmod /lib/modules/ohci-pci.ko || die "ohci_pci: module load failed"
fi insmod /lib/modules/ehci-pci.ko || die "ehci_pci: module load failed"
if ! lsmod | grep -q ohci_hcd; then insmod /lib/modules/xhci-hcd.ko || die "xhci_hcd: module load failed"
insmod /lib/modules/ohci-hcd.ko \ insmod /lib/modules/xhci-pci.ko || die "xhci_pci: module load failed"
|| die "ohci_hcd: module load failed"
fi
if ! lsmod | grep -q ohci_pci; then
insmod /lib/modules/ohci-pci.ko \
|| die "ohci_pci: module load failed"
fi
fi
if ! lsmod | grep -q ehci_pci; then
insmod /lib/modules/ehci-pci.ko \
|| die "ehci_pci: module load failed"
fi
if ! lsmod | grep -q xhci_hcd; then
insmod /lib/modules/xhci-hcd.ko \
|| die "xhci_hcd: module load failed"
fi
if ! lsmod | grep -q xhci_pci; then
insmod /lib/modules/xhci-pci.ko \
|| die "xhci_pci: module load failed"
sleep 2 sleep 2
fi fi
@ -357,9 +337,6 @@ enable_usb()
# desktop/server), they could lock themselves out, only recoverable by # desktop/server), they could lock themselves out, only recoverable by
# hardware flash. # hardware flash.
if [ "$CONFIG_USB_KEYBOARD_REQUIRED" = y ] || [ "$CONFIG_USER_USB_KEYBOARD" = y ]; then if [ "$CONFIG_USB_KEYBOARD_REQUIRED" = y ] || [ "$CONFIG_USER_USB_KEYBOARD" = y ]; then
if ! lsmod | grep -q usbhid; then insmod /lib/modules/usbhid.ko || die "usbhid: module load failed"
insmod /lib/modules/usbhid.ko \
|| die "usbhid: module load failed"
fi
fi fi
} }