Last active
August 12, 2023 16:06
-
-
Save sebastiaanfranken/61474c1929ab256e4247a7a4a73262ca to your computer and use it in GitHub Desktop.
Removes the nouveau module/driver from Fedora 29+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Removes the xorg-x11-drv-nouveau package from this machine, because it's not needed | |
sudo dnf remove xorg-x11-drv-nouveau -y | |
# Blacklist the nouveau module as a module and in dracut | |
sudo echo 'blacklist nouveau' > /etc/modprobe.d/blacklist-nouveau.conf | |
sudo echo 'omit_drivers+=" nouveau "' > /etc/dracut.conf.d/blacklist-nouveau.conf | |
# Backup the current initramfs | |
sudo mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img | |
# Regenerate the current initramfs | |
sudo dracut -f /boot/initramfs-$(uname -r).img $(uname -r) | |
# Regenerate grub2's config | |
if [ -d /sys/firmware/efi ]; then | |
sudo grub2-mkconfig -o /etc/grub2-efi.cfg | |
else | |
sudo grub2-mkconfig -o /etc/grub2.cfg | |
fi | |
echo 'Done. You should reboot your machine now for all changes to come into effect.' | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment