forked from BigAnteater/KVM-GPU-Passthrough
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grub_setup_intel.sh
28 lines (23 loc) · 1.36 KB
/
grub_setup_intel.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
if [ $EUID -ne 0 ]
then
echo "This program must run as root to function."
exit 1
fi
echo "This script will configure your grub config for virtualization."
GRUB=`cat /etc/default/grub | grep "GRUB_CMDLINE_LINUX_DEFAULT" | rev | cut -c 2- | rev`
#adds amd_iommu=on and iommu=pt to the grub config
GRUB+=" intel_iommu=on iommu=pt\""
sed -i -e "s|^GRUB_CMDLINE_LINUX_DEFAULT.*|${GRUB}|" /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg
sleep 5s
clear
echo
echo "Grub bootloader has been modified successfully, reboot time!"
echo "press Y to reboot now and n to reboot later."
read REBOOT
if [ $REBOOT = "y" ]
then
reboot
fi
exit