Merge branch 'master' of git://git.qubes-os.org/marmarek/core into hvm

This commit is contained in:
Joanna Rutkowska 2012-02-27 13:30:14 +01:00
commit 0e0fe6a3d9
9 changed files with 64 additions and 15 deletions

View File

@ -1 +1 @@
modprobe pciback
modprobe pciback 2> /dev/null || modprobe xen-pciback

View File

@ -1,2 +1,3 @@
#!/bin/bash
instmods pciback
modinfo -k $kernel pciback > /dev/null 2>&1 && instmods pciback
modinfo -k $kernel xen-pciback > /dev/null 2>&1 && instmods xen-pciback

View File

@ -4,5 +4,5 @@
HIDE_PCI=`lspci -mm -n | grep '^[^ ]* "02'|awk '{ ORS="";print "(" $1 ")";}'`
# ... and hide them so that Dom0 doesn't load drivers for them
modprobe pciback hide=$HIDE_PCI
modprobe pciback hide=$HIDE_PCI 2> /dev/null || modprobe xen-pciback hide=$HIDE_PCI

View File

@ -20,7 +20,7 @@
start()
{
echo -n $"Executing Qubes Core scripts:"
modprobe evtchn
modprobe evtchn 2> /dev/null || modprobe xen-evtchn
chgrp qubes /etc/xen
chmod 710 /etc/xen
chgrp qubes /var/run/xenstored/*

View File

@ -356,6 +356,7 @@ class QubesVm(object):
except:
pass
os.symlink (new_label.icon_path, self.icon_path)
subprocess.call(['sudo', 'xdg-icon-resource', 'forceupdate'])
@property
def ip(self):
@ -1003,15 +1004,21 @@ class QubesVm(object):
)
for rule in conf["rules"]:
# For backward compatibility
if "proto" not in rule:
rule["proto"] = "tcp"
element = xml.etree.ElementTree.Element(
"rule",
address=rule["address"],
port=str(rule["portBegin"]),
proto=str(rule["proto"]),
)
if rule["netmask"] is not None and rule["netmask"] != 32:
element.set("netmask", str(rule["netmask"]))
if rule["portEnd"] is not None:
if rule["portBegin"] is not None and rule["portBegin"] > 0:
element.set("port", str(rule["portBegin"]))
if rule["portEnd"] is not None and rule["portEnd"] > 0:
element.set("toport", str(rule["portEnd"]))
root.append(element)
tree = xml.etree.ElementTree.ElementTree(root)
@ -1048,7 +1055,7 @@ class QubesVm(object):
for element in root:
rule = {}
attr_list = ("address", "netmask", "port", "toport")
attr_list = ("address", "netmask", "proto", "port", "toport")
for attribute in attr_list:
rule[attribute] = element.get(attribute)
@ -1058,7 +1065,15 @@ class QubesVm(object):
else:
rule["netmask"] = 32
rule["portBegin"] = int(rule["port"])
# For backward compatibility default to tcp
if rule["proto" is None:
rule["proto"] = "tcp"
if rule["port"] is not None:
rule["portBegin"] = int(rule["port"])
else:
# backward compatibility
rule["portBegin"] = 0
if rule["toport"] is not None:
rule["portEnd"] = int(rule["toport"])
@ -1821,10 +1836,12 @@ class QubesProxyVm(QubesNetVm):
if rule["netmask"] != 32:
iptables += "/{0}".format(rule["netmask"])
if rule["portBegin"] is not None and rule["portBegin"] > 0:
iptables += " -p tcp --dport {0}".format(rule["portBegin"])
if rule["portEnd"] is not None and rule["portEnd"] > rule["portBegin"]:
iptables += ":{0}".format(rule["portEnd"])
if rule["proto"] is not None and rule["proto"] != "any":
iptables += " -p {0}".format(rule["proto"])
if rule["portBegin"] is not None and rule["portBegin"] > 0:
iptables += " --dport {0}".format(rule["portBegin"])
if rule["portEnd"] is not None and rule["portEnd"] > rule["portBegin"]:
iptables += ":{0}".format(rule["portEnd"])
iptables += " -j {0}\n".format(rules_action)

View File

@ -82,6 +82,7 @@ def do_list(vm):
def set_label(vms, vm, args):
if len (args) != 1:
print >> sys.stderr, "Missing label name argument!"
exit (1)
label = args[0]
if label not in QubesVmLabels:
@ -91,7 +92,6 @@ def set_label(vms, vm, args):
exit (1)
vm.label = QubesVmLabels[label]
subprocess.check_call (["ln", "-sf", vm.label.icon_path, vm.icon_path])
def set_memory(vms, vm, args):
if len (args) != 1:

View File

@ -0,0 +1,31 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.11 (GNU/Linux)
mQENBE9KHjMBCADgs1Zw+Gag5MXDqAHzVfo/JSJ0q7Oj096l+/TU0/P2qpoF7sTo
uLpDLCfOOSqil7omOKMjn6yl/73RAd4oWIRivJMQKjgD4Tk8qlLI1NrB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dGjlwnfXCk5EKRNuqr5twARAQABiQElBBgB
AgAPBQJPSh4zAhsMBQkB4TOAAAoJEO+xNGWk4qyh33MIAIOS9A0rkmBTPZwAsdJv
sz/J9+8AvfwMisN2sKTfEBTO8kEnSPcBZuau3JxKCGHxaPwXhGmnc9xnz/TY3JCj
6ZUgjgQQ3iT/BJk+h6n4xom9NRw5hn4j4NeIpboC6p6JfcYzZyapUNFmAsrSjakw
RxxpaVLb4moOfYzS7i7JqsEetBwoYAeFZoPYZpo4VH9PUPVAih6psmO/bz6Y8W+/
tkXzViq15bwPUmDwBzX0nX0T8nQqMl85nCLDM2rVMs/lnVxfJas4QjTfzgeZOHQ6
0ikGqwlnyWk/oUzUXFV/P7sKAXoOaMSEVHtfSxLjVH0RYsAv6SotjHwPAatrynyp
gYY=
=UROF
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -14,7 +14,7 @@ enabled=0
[qubes-vm-unstable]
name = Qubes OS Repository for VM (unstable)
baseurl = http://yum.qubes-os.org/r1/unstable/vm/fc$releasever
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-qubes-1-primary
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-qubes-1-unstable
gpgcheck = 1
enabled=0

View File

@ -232,7 +232,7 @@ if ! [ -e /etc/sysconfig/network ]; then
fi
# Load evtchn module - xenstored needs it
modprobe evtchn
modprobe evtchn 2> /dev/null || modprobe xen-evtchn
service xenstored start
if ! [ -e /var/lib/qubes/qubes.xml ]; then