archboot/usr/lib/initcpio/hooks/arch_ide_blacklist

46 lines
1.8 KiB
Text
Raw Normal View History

2009-12-11 11:28:56 +01:00
# Created by Tobias Powalowski <tpowa@archlinux.org>
2007-02-22 23:46:50 +01:00
run_hook ()
{
2011-11-16 16:00:25 +01:00
if [ -d /lib/modules/$(uname -r)/kernel/drivers/ata/ -a -d /lib/modules/$(uname -r)/kernel/drivers/ide/ ]; then
msg ":: Echo generate IDE/PATA blacklist..."
if grep -qw ide-legacy /proc/cmdline; then
for i in $(echo /lib/modules/$(uname -r)/kernel/drivers/ata/*); do
echo "blacklist $(basename $i .ko.gz | grep -e '^pata' -e '^ata_generic' -e '^ata_piix')" >> /etc/modprobe.d/ide-blacklist.conf
done
#delete blank lines
sed -i -e '/blacklist\ $/d' /etc/modprobe.d/ide-blacklist.conf
2011-11-16 16:00:25 +01:00
msg "Blacklisted IDE modules (new subsystem) for udev:"
msg "--------------------------------------"
if [ -s /etc/modprobe.d/ide-blacklist.conf ]; then
for i in $(sort -u /etc/modprobe.d/ide-blacklist.conf | sed -e 's/blacklist //g'); do
echo -n "$i "
done
msg ""
msg "If you need them, please don't use 'ide-legacy' boot option or load them by hand!"
else
msg "No modules blacklisted."
fi
msg "--------------------------------------"
else
2011-11-16 16:00:25 +01:00
for i in $(echo /lib/modules/$(uname -r)/kernel/drivers/ide/*); do
echo "blacklist $(basename $i .ko.gz | grep -v ^ide)" >> /etc/modprobe.d/ide-blacklist.conf
2007-02-22 23:46:50 +01:00
done
#delete blank lines
sed -i -e '/blacklist\ $/d' /etc/modprobe.d/ide-blacklist.conf
2011-11-16 16:00:25 +01:00
msg "Blacklisted IDE modules (old subsystem) for udev:"
msg "--------------------------------------"
if [ -s /etc/modprobe.d/ide-blacklist.conf ]; then
for i in $(sort -u /etc/modprobe.d/ide-blacklist.conf | sed -e 's/blacklist //g'); do
echo -n "$i "
done
msg ""
msg "If you need them, please use 'ide-legacy' boot option or load them by hand!"
else
msg "No modules blacklisted."
fi
msg "--------------------------------------"
2007-02-22 23:46:50 +01:00
fi
fi
}