qubes-core-admin-linux/dracut/modules.d/90qubes-pciback/qubes-pciback.sh

17 lines
578 B
Bash
Raw Normal View History

2013-03-16 18:52:16 +00:00
#!/bin/sh
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
2013-03-16 18:52:16 +00:00
# Find all networking devices currenly installed...
HIDE_PCI=`lspci -mm -n | grep '^[^ ]* "02'|awk '{ ORS="";print "(" $1 ")";}'`
if getargbool 0 rd.qubes.hide_all_usb; then
HIDE_PCI=$HIDE_PCI`lspci -mm -n | grep '^[^ ]* "0c03'|awk '{ ORS="";print "(" $1 ")";}'`
fi
HIDE_PCI=$HIDE_PCI`getarg rd.qubes.hide_pci | tr ',' '\n'|awk '{ ORS="";print "(" $1 ")";}'`
2013-03-16 18:52:16 +00:00
# ... and hide them so that Dom0 doesn't load drivers for them
modprobe pciback hide=$HIDE_PCI 2> /dev/null || modprobe xen-pciback hide=$HIDE_PCI