From b8bd6e2d49d59c646b49da2c9b15e03a263af1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 29 May 2014 05:12:42 +0200 Subject: [PATCH] Additional options to hide PCI devices from dom0 (#861) --- dracut/modules.d/90qubes-pciback/qubes-pciback.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dracut/modules.d/90qubes-pciback/qubes-pciback.sh b/dracut/modules.d/90qubes-pciback/qubes-pciback.sh index 2ba649b..fa60b4f 100755 --- a/dracut/modules.d/90qubes-pciback/qubes-pciback.sh +++ b/dracut/modules.d/90qubes-pciback/qubes-pciback.sh @@ -1,8 +1,16 @@ #!/bin/sh +type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh + # 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 ")";}'` + # ... 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