From 9c68afe14c4fbcbd32ff157fcf3c1098d52beb07 Mon Sep 17 00:00:00 2001 From: MB Date: Sun, 29 Nov 2015 00:00:00 +0000 Subject: [PATCH] [network-proxy-setup] Permit !CONFIG_MODuLES * Check whether sysctl is accessible * Check whether a key which exists when CONFIG_MODULES=y is not accessible If true, CONFIG_MODULES=n, so ignore modprobe failure. If false, fail. --- vm-systemd/network-proxy-setup.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vm-systemd/network-proxy-setup.sh b/vm-systemd/network-proxy-setup.sh index 8b864b7..503c827 100755 --- a/vm-systemd/network-proxy-setup.sh +++ b/vm-systemd/network-proxy-setup.sh @@ -3,10 +3,17 @@ # Setup gateway for all the VMs this netVM is serviceing... network=$(qubesdb-read /qubes-netvm-network 2>/dev/null) if [ "x$network" != "x" ]; then + + if [ -e /proc/sys/kernel ] && ! [ -e /proc/sys/kernel/modules_disabled ]; then + readonly modprobe_fail_cmd='true' + else + readonly modprobe_fail_cmd='false' + fi + gateway=$(qubesdb-read /qubes-netvm-gateway) netmask=$(qubesdb-read /qubes-netvm-netmask) secondary_dns=$(qubesdb-read /qubes-netvm-secondary-dns) - modprobe netbk 2> /dev/null || modprobe xen-netback + modprobe netbk 2> /dev/null || modprobe xen-netback || "${modprobe_fail_cmd}" echo "NS1=$gateway" > /var/run/qubes/qubes-ns echo "NS2=$secondary_dns" >> /var/run/qubes/qubes-ns /usr/lib/qubes/qubes-setup-dnat-to-ns