Fully-qualify modprobe calls to avoid busybox

If the busybox-static package is installed, the modprobe implementation
used will be the one from busybox, which behaves slightly differently.
Specifically, the busybox implementation does not support `install`
commands from modprobe.d conf files:

https://git.busybox.net/busybox/tree/modutils/modprobe.c?h=1_31_stable#n279

Since mkinitramfs already ensures that /sbin/modprobe is copied into
/sbin for the initrd, it is safe to fully-qualify the modprobe call and
never invoke the busybox version.
This commit is contained in:
Ben Love 2022-02-05 19:32:53 -05:00
parent 5f17c03e05
commit 02dc65f9db
7 changed files with 14 additions and 14 deletions

View File

@ -86,7 +86,7 @@ matroxfb)
;;
intelfb|i810fb|i915)
# Needs AGP driver loaded
modprobe intel-agp
/sbin/modprobe intel-agp
;;
uvesafb)
# v86d requires /dev/zero and dev/mem, but udev haven't been started yet
@ -99,9 +99,9 @@ esac
if [ -n "${FB}" ]; then
unset MODPROBE_OPTIONS
modprobe -q fbcon
/sbin/modprobe -q fbcon
# shellcheck disable=SC2086
modprobe -q ${FB} ${OPTS}
/sbin/modprobe -q ${FB} ${OPTS}
fi
if [ -e /proc/fb ]; then

View File

@ -97,8 +97,8 @@ manual_add_modules()
# configuration lines and embedded softdep information is not
# processed. So we run twice, with and without this option.
# shellcheck disable=SC2034
{ modprobe --all --set-version="${version?}" --ignore-install --quiet --show-depends "$@";
modprobe --all --set-version="${version}" --quiet --show-depends "$@"; } |
{ /sbin/modprobe --all --set-version="${version?}" --ignore-install --quiet --show-depends "$@";
/sbin/modprobe --all --set-version="${version}" --quiet --show-depends "$@"; } |
while read -r prefix kmod options ; do
if [ "${prefix}" != "insmod" ]; then
continue

2
init
View File

@ -220,7 +220,7 @@ run_scripts /scripts/init-top
maybe_break modules
[ "$quiet" != "y" ] && log_begin_msg "Loading essential drivers"
[ -n "${netconsole}" ] && modprobe netconsole netconsole="${netconsole}"
[ -n "${netconsole}" ] && /sbin/modprobe netconsole netconsole="${netconsole}"
load_modules
[ "$quiet" != "y" ] && log_end_msg

View File

@ -99,13 +99,13 @@ maybe_break()
else
opts="-v"
fi
modprobe ${opts} -a i8042 atkbd ehci-pci ehci-orion \
/sbin/modprobe ${opts} -a i8042 atkbd ehci-pci ehci-orion \
ehci-hcd ohci-hcd ohci-pci uhci-hcd usbhid xhci \
xhci-pci xhci-hcd
sleep 2
for modalias in /sys/bus/hid/devices/*/modalias; do
if [ -f "${modalias}" ]; then
modprobe ${opts} -b "$(cat "${modalias}")"
/sbin/modprobe ${opts} -b "$(cat "${modalias}")"
fi
done
fi
@ -139,7 +139,7 @@ load_modules()
continue
fi
# shellcheck disable=SC2086
modprobe $m
/sbin/modprobe $m
done < /conf/modules
fi
}

View File

@ -17,11 +17,11 @@ esac
for x in $(cat /proc/cmdline); do
case ${x} in
all_generic_ide)
modprobe ata_generic all_generic_ide=1
/sbin/modprobe ata_generic all_generic_ide=1
;;
all_generic_ide=*)
if [ -n "${x#all_generic_ide=}" ]; then
modprobe ata_generic all_generic_ide=1
/sbin/modprobe ata_generic all_generic_ide=1
fi
;;
esac

View File

@ -56,7 +56,7 @@ local_device_setup()
# Load ubi with the correct MTD partition and return since fstype
# doesn't work with a char device like ubi.
if [ -n "$UBIMTD" ]; then
modprobe ubi "mtd=$UBIMTD"
/sbin/modprobe ubi "mtd=$UBIMTD"
DEV="${dev_id}"
return
fi

View File

@ -81,7 +81,7 @@ nfs_mount_root()
nfs_top
# For DHCP
modprobe af_packet
/sbin/modprobe af_packet
wait_for_udev 10
@ -130,7 +130,7 @@ nfs_mount_fs()
nfs_top
# For DHCP
modprobe af_packet
/sbin/modprobe af_packet
wait_for_udev 10