forked from shidahuilang/pve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
J4125开启直通.sh
37 lines (24 loc) · 815 Bytes
/
J4125开启直通.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
29
30
31
32
33
#!/usr/bin/env bash
#i210网卡J4125专用
grep "iommu" /etc/default/grub >/dev/null
if [ $? -eq 1 ]; then
sed -i 's/quiet/quiet intel_iommu=on iommu=pt video=efifb:off/g' /etc/default/grub
fi
grep "vfio" /etc/modules >/dev/null
if [ $? -eq 1 ]; then
echo vfio >> /etc/modules
echo vfio_iommu_type1 >> /etc/modules
echo vfio_pci >> /etc/modules
echo vfio_virqfd >> /etc/modules
echo kvmgt >> /etc/modules
fi
if [ ! -f "/etc/modprobe.d/blacklist.conf" ];then
echo "blacklist snd_hda_intel" >> /etc/modprobe.d/blacklist.conf
echo "blacklist snd_hda_codec_hdmi" >> /etc/modprobe.d/blacklist.conf
echo "blacklist i915" >> /etc/modprobe.d/blacklist.conf
fi
if [ ! -f "/etc/modprobe.d/vfio.conf" ];then
echo "options vfio-pci ids=8086:3185" >> /etc/modprobe.d/vfio.conf
fi
update-initramfs -u
update-grub