archboot/lib/initcpio/hooks/arch_ide_blacklist

40 lines
1.4 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 ()
{
msg ":: Echo generate IDE/PATA blacklist..."
2007-02-22 23:46:50 +01:00
if grep -qw ide-legacy /proc/cmdline; then
for i in $(echo /lib/modules/$(uname -r)/kernel/drivers/ata/*); do
2011-08-08 09:04:00 +02:00
echo "blacklist $(basename $i .ko.gz | grep -e '^pata' -e '^ata_generic' '^ata_piix' | s)" >> /etc/modprobe.d/ide-blacklist.conf
done
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 "--------------------------------------"
2007-02-22 23:46:50 +01:00
else
2009-01-01 13:43:02 +01:00
for i in $(echo /lib/modules/$(uname -r)/kernel/drivers/ide/*); do
2011-08-08 09:04:00 +02:00
echo "blacklist $(basename $i .ko.gz | grep -v ^ide)" >> /etc/modprobe.d/ide-blacklist.conf
2007-02-22 23:46:50 +01:00
done
2009-12-11 10:28:39 +01:00
msg "Blacklisted IDE modules (old subsystem) for udev:"
msg "--------------------------------------"
if [ -s /etc/modprobe.d/ide-blacklist.conf ]; then
2010-02-08 15:42:32 +01:00
for i in $(sort -u /etc/modprobe.d/ide-blacklist.conf | sed -e 's/blacklist //g'); do
echo -n "$i "
2007-02-22 23:46:50 +01:00
done
2009-12-11 10:28:39 +01:00
msg ""
msg "If you need them, please use 'ide-legacy' boot option or load them by hand!"
2007-02-22 23:46:50 +01:00
else
2009-12-11 10:28:39 +01:00
msg "No modules blacklisted."
2007-02-22 23:46:50 +01:00
fi
2009-12-11 10:28:39 +01:00
msg "--------------------------------------"
2007-02-22 23:46:50 +01:00
fi
}