Merge branch 'master' into hvm
Conflicts: version_dom0
This commit is contained in:
commit
e6c8bf81fd
@ -32,25 +32,34 @@ from qubes.qubes import QubesVmCollection
|
|||||||
updates_dir = "/var/lib/qubes/updates"
|
updates_dir = "/var/lib/qubes/updates"
|
||||||
updates_rpm_dir = updates_dir + "/rpm"
|
updates_rpm_dir = updates_dir + "/rpm"
|
||||||
updates_repodata_dir = updates_dir + "/repodata"
|
updates_repodata_dir = updates_dir + "/repodata"
|
||||||
|
updates_error_file = updates_dir + "/errors"
|
||||||
|
updates_error_file_handle = None
|
||||||
|
|
||||||
package_regex = re.compile(r"^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._+-]{1,128}.rpm$")
|
package_regex = re.compile(r"^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._+-]{1,128}.rpm$")
|
||||||
gpg_ok_regex = re.compile(r"pgp md5 OK$")
|
gpg_ok_regex = re.compile(r"pgp md5 OK$")
|
||||||
|
|
||||||
def dom0updates_fatal(msg):
|
def dom0updates_fatal(pkg, msg):
|
||||||
|
global updates_error_file_handle
|
||||||
print >> sys.stderr, msg
|
print >> sys.stderr, msg
|
||||||
shutil.rmtree(updates_rpm_dir)
|
if updates_error_file_handle is None:
|
||||||
exit(1)
|
updates_error_file_handle = open(updates_error_file, "a")
|
||||||
|
updates_error_file_handle.write(msg + "\n")
|
||||||
|
os.remove(pkg)
|
||||||
|
|
||||||
def handle_dom0updates(updatevm):
|
def handle_dom0updates(updatevm):
|
||||||
|
global updates_error_file_handle
|
||||||
|
|
||||||
source=os.getenv("QREXEC_REMOTE_DOMAIN")
|
source=os.getenv("QREXEC_REMOTE_DOMAIN")
|
||||||
if source != updatevm.name:
|
if source != updatevm.name:
|
||||||
print >> sys.stderr, 'Domain ' + source + ' not allowed to send dom0 updates'
|
print >> sys.stderr, 'Domain ' + str(source) + ' not allowed to send dom0 updates'
|
||||||
exit(1)
|
exit(1)
|
||||||
# Clean old packages
|
# Clean old packages
|
||||||
if os.path.exists(updates_rpm_dir):
|
if os.path.exists(updates_rpm_dir):
|
||||||
shutil.rmtree(updates_rpm_dir)
|
shutil.rmtree(updates_rpm_dir)
|
||||||
if os.path.exists(updates_repodata_dir):
|
if os.path.exists(updates_repodata_dir):
|
||||||
shutil.rmtree(updates_repodata_dir)
|
shutil.rmtree(updates_repodata_dir)
|
||||||
|
if os.path.exists(updates_error_file):
|
||||||
|
os.remove(updates_error_file)
|
||||||
qubes_gid = grp.getgrnam('qubes').gr_gid
|
qubes_gid = grp.getgrnam('qubes').gr_gid
|
||||||
os.mkdir(updates_rpm_dir)
|
os.mkdir(updates_rpm_dir)
|
||||||
os.chown(updates_rpm_dir, -1, qubes_gid)
|
os.chown(updates_rpm_dir, -1, qubes_gid)
|
||||||
@ -61,16 +70,18 @@ def handle_dom0updates(updatevm):
|
|||||||
full_path = updates_rpm_dir + "/" + f
|
full_path = updates_rpm_dir + "/" + f
|
||||||
if package_regex.match(f):
|
if package_regex.match(f):
|
||||||
if os.path.islink(full_path) or not os.path.isfile(full_path):
|
if os.path.islink(full_path) or not os.path.isfile(full_path):
|
||||||
dom0updates_fatal('Domain ' + source + ' sent not regular file')
|
dom0updates_fatal(f, 'Domain ' + source + ' sent not regular file')
|
||||||
p = subprocess.Popen (["/bin/rpm", "-K", full_path],
|
p = subprocess.Popen (["/bin/rpm", "-K", full_path],
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
output = p.communicate()[0]
|
output = p.communicate()[0]
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
dom0updates_fatal('Error while verifing %s signature: %s' % (f, output))
|
dom0updates_fatal(f, 'Error while verifing %s signature: %s' % (f, output))
|
||||||
if not gpg_ok_regex.search(output.strip()):
|
if not gpg_ok_regex.search(output.strip()):
|
||||||
dom0updates_fatal('Domain ' + source + ' sent not signed rpm: ' + f)
|
dom0updates_fatal(f, 'Domain ' + source + ' sent not signed rpm: ' + f)
|
||||||
else:
|
else:
|
||||||
dom0updates_fatal('Domain ' + source + ' sent unexpected file: ' + f)
|
dom0updates_fatal(f, 'Domain ' + source + ' sent unexpected file: ' + f)
|
||||||
|
if updates_error_file_handle is not None:
|
||||||
|
updates_error_file_handle.close()
|
||||||
# After updates received - create repo metadata
|
# After updates received - create repo metadata
|
||||||
subprocess.check_call(["/usr/bin/createrepo", "-q", updates_dir])
|
subprocess.check_call(["/usr/bin/createrepo", "-q", updates_dir])
|
||||||
os.chown(updates_repodata_dir, -1, qubes_gid)
|
os.chown(updates_repodata_dir, -1, qubes_gid)
|
||||||
|
@ -342,7 +342,7 @@ def block_attach(vm, backend_vm, device, frontend=None, mode="w", auto_detach=Fa
|
|||||||
elif int(be_state) > 4:
|
elif int(be_state) > 4:
|
||||||
# Error
|
# Error
|
||||||
error = xs.read('', '/local/domain/%d/error/backend/vbd/%d/%d/error' % (backend_vm.xid, vm.xid, block_name_to_devid(frontend)))
|
error = xs.read('', '/local/domain/%d/error/backend/vbd/%d/%d/error' % (backend_vm.xid, vm.xid, block_name_to_devid(frontend)))
|
||||||
if error is None:
|
if error is not None:
|
||||||
raise QubesException("Error while connecting block device: " + error)
|
raise QubesException("Error while connecting block device: " + error)
|
||||||
else:
|
else:
|
||||||
raise QubesException("Unknown error while connecting block device")
|
raise QubesException("Unknown error while connecting block device")
|
||||||
|
@ -87,6 +87,13 @@ fi
|
|||||||
# Wait for download completed
|
# Wait for download completed
|
||||||
while pidof -x qubes-receive-updates >/dev/null; do sleep 0.5; done
|
while pidof -x qubes-receive-updates >/dev/null; do sleep 0.5; done
|
||||||
|
|
||||||
|
if [ -r /var/lib/qubes/updates/errors ]; then
|
||||||
|
echo "*** ERROR while receiving updates:" >&2
|
||||||
|
cat /var/lib/qubes/updates/errors >&2
|
||||||
|
echo "--> if you want to use packages that were downloaded correctly, use yum directly now" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "x$PKGS" != "x" ]; then
|
if [ "x$PKGS" != "x" ]; then
|
||||||
yum $YUM_OPTS install $PKGS
|
yum $YUM_OPTS install $PKGS
|
||||||
elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then
|
elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then
|
||||||
@ -99,7 +106,7 @@ elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then
|
|||||||
yum $YUM_OPTS update
|
yum $YUM_OPTS update
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
yum -q check-updates && rm $UPDATES_STAT_FILE
|
yum -q check-update && rm -f $UPDATES_STAT_FILE
|
||||||
else
|
else
|
||||||
echo "No updates avaliable" >&2
|
echo "No updates avaliable" >&2
|
||||||
fi
|
fi
|
||||||
|
@ -10,6 +10,12 @@ Vendor: Invisible Things Lab
|
|||||||
License: GPL
|
License: GPL
|
||||||
Group: Qubes
|
Group: Qubes
|
||||||
URL: http://www.qubes-os.org
|
URL: http://www.qubes-os.org
|
||||||
|
# template released with 1.0-rc1 have kernel-debug installed by mistake. This
|
||||||
|
# line is required to smooth upgrade.
|
||||||
|
Obsoletes: kernel-debug
|
||||||
|
# this driver require exact kernel-drm-nouveau version; as isn't needed in VM,
|
||||||
|
# just remove it
|
||||||
|
Obsoletes: xorg-x11-drv-nouveau
|
||||||
# choose the oldest Qubes-supported VM kernel
|
# choose the oldest Qubes-supported VM kernel
|
||||||
Provides: kernel = 3.2.7
|
Provides: kernel = 3.2.7
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
1.7.36
|
1.7.42
|
||||||
|
Loading…
Reference in New Issue
Block a user