initramfs-tools/scripts/init-top/all_generic_ide
Ben Love 02dc65f9db 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.
2022-02-05 19:32:53 -05:00

29 lines
396 B
Bash
Executable File

#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
# shellcheck disable=SC2013
for x in $(cat /proc/cmdline); do
case ${x} in
all_generic_ide)
/sbin/modprobe ata_generic all_generic_ide=1
;;
all_generic_ide=*)
if [ -n "${x#all_generic_ide=}" ]; then
/sbin/modprobe ata_generic all_generic_ide=1
fi
;;
esac
done