Merge branch 'master' of ssh://git.qubes-os.org/var/lib/qubes/git/joanna/core
Conflicts: dom0/qvm-core/qubes.py
This commit is contained in:
commit
c8acca0eb6
37
Makefile
37
Makefile
@ -1,8 +1,13 @@
|
|||||||
RPMS_DIR=rpm/
|
RPMS_DIR=rpm/
|
||||||
|
|
||||||
|
VERSION_DOM0 := $(shell cat version_dom0)
|
||||||
|
VERSION_VM := $(shell cat version_vm)
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "make rpms -- generate binary rpm packages"
|
@echo "make rpms -- generate binary rpm packages"
|
||||||
@echo "make update-repo -- copy newly generated rpms to qubes yum repo"
|
@echo "make update-repo-current -- copy newly generated rpms to qubes yum repo"
|
||||||
@echo "make update-repo-testing -- same, but to -testing repo"
|
@echo "make update-repo-unstable -- same, but to -testing repo"
|
||||||
|
@echo "make clean -- cleanup"
|
||||||
|
|
||||||
rpms:
|
rpms:
|
||||||
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-commonvm.spec
|
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-commonvm.spec
|
||||||
@ -10,23 +15,19 @@ rpms:
|
|||||||
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-netvm.spec
|
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-netvm.spec
|
||||||
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-proxyvm.spec
|
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-proxyvm.spec
|
||||||
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-dom0.spec
|
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-dom0.spec
|
||||||
rpm --addsign $(RPMS_DIR)/x86_64/*.rpm
|
rpm --addsign \
|
||||||
|
$(RPMS_DIR)/x86_64/qubes-core-dom0-*$(VERSION_DOM0)*.rpm \
|
||||||
update-repo:
|
$(RPMS_DIR)/x86_64/qubes-core-*vm-*$(VERSION_VM)*.rpm
|
||||||
ln -f $(RPMS_DIR)/x86_64/qubes-core-dom0-*.rpm ../yum/r1/dom0/rpm/
|
|
||||||
ln -f $(RPMS_DIR)/x86_64/qubes-core-appvm-*.rpm ../yum/r1/appvm/rpm/
|
|
||||||
ln -f $(RPMS_DIR)/x86_64/qubes-core-commonvm-*.rpm ../yum/r1/netvm/rpm/
|
|
||||||
ln -f $(RPMS_DIR)/x86_64/qubes-core-netvm-*.rpm ../yum/r1/netvm/rpm/
|
|
||||||
ln -f $(RPMS_DIR)/x86_64/qubes-core-proxyvm-*.rpm ../yum/r1/netvm/rpm/
|
|
||||||
|
|
||||||
update-repo-testing:
|
|
||||||
ln -f $(RPMS_DIR)/x86_64/qubes-core-dom0-*.rpm ../yum/r1-testing/dom0/rpm/
|
|
||||||
ln -f $(RPMS_DIR)/x86_64/qubes-core-appvm-*.rpm ../yum/r1-testing/appvm/rpm/
|
|
||||||
ln -f $(RPMS_DIR)/x86_64/qubes-core-commonvm-*.rpm ../yum/r1-testing/netvm/rpm/
|
|
||||||
ln -f $(RPMS_DIR)/x86_64/qubes-core-netvm-*.rpm ../yum/r1-testing/netvm/rpm/
|
|
||||||
ln -f $(RPMS_DIR)/x86_64/qubes-core-proxyvm-*.rpm ../yum/r1-testing/netvm/rpm/
|
|
||||||
|
|
||||||
|
update-repo-current:
|
||||||
|
ln -f $(RPMS_DIR)/x86_64/qubes-core-dom0-*$(VERSION_DOM0)*.rpm ../yum/current-release/current/dom0/rpm/
|
||||||
|
ln -f $(RPMS_DIR)/x86_64/qubes-core-*vm-*$(VERSION_VM)*.rpm ../yum/current-release/current/vm/rpm/
|
||||||
|
cd ../yum && ./update_repo.sh
|
||||||
|
|
||||||
|
update-repo-unstable:
|
||||||
|
ln -f $(RPMS_DIR)/x86_64/qubes-core-dom0-*$(VERSION_DOM0)*.rpm ../yum/current-release/unstable/dom0/rpm/
|
||||||
|
ln -f $(RPMS_DIR)/x86_64/qubes-core-*vm-*$(VERSION_VM)*.rpm ../yum/current-release/unstable/vm/rpm/
|
||||||
|
cd ../yum && ./update_repo.sh
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
(cd appvm && make clean)
|
(cd appvm && make clean)
|
||||||
|
@ -61,8 +61,14 @@ main()
|
|||||||
"HOME=/home/user DISPLAY=:0 /usr/bin/mimeopen -n -M '%s' > /tmp/kde-open.log 2>&1 </dev/null",
|
"HOME=/home/user DISPLAY=:0 /usr/bin/mimeopen -n -M '%s' > /tmp/kde-open.log 2>&1 </dev/null",
|
||||||
filename);
|
filename);
|
||||||
if (system(cmdbuf))
|
if (system(cmdbuf))
|
||||||
|
#ifdef USE_KDIALOG
|
||||||
system
|
system
|
||||||
("HOME=/home/user DISPLAY=:0 /usr/bin/kdialog --sorry 'Unable to handle mimetype of the requested file!' > /tmp/kdialog.log 2>&1 </dev/null");
|
("HOME=/home/user DISPLAY=:0 /usr/bin/kdialog --sorry 'Unable to handle mimetype of the requested file!' > /tmp/kdialog.log 2>&1 </dev/null");
|
||||||
|
#else
|
||||||
|
system
|
||||||
|
("HOME=/home/user DISPLAY=:0 /usr/bin/zenity --error --text 'Unable to handle mimetype of the requested file!' > /tmp/kdialog.log 2>&1 </dev/null");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (stat(filename, &stat_post)) {
|
if (stat(filename, &stat_post)) {
|
||||||
perror("stat post");
|
perror("stat post");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
[qubes-appvm]
|
|
||||||
name = Qubes OS Repository for AppVM
|
|
||||||
baseurl = http://qubes-os.org/yum/r1/appvm/rpm
|
|
||||||
gpgkey = http://qubes-os.org/keys/qubes-release-1-signing-key.asc
|
|
||||||
gpgcheck = 1
|
|
||||||
|
|
||||||
[qubes-appvm-testing]
|
|
||||||
name = Qubes OS Repository for AppVM
|
|
||||||
baseurl = http://qubes-os.org/yum/r1-testing/appvm/rpm
|
|
||||||
gpgkey = http://qubes-os.org/keys/qubes-release-1-signing-key.asc
|
|
||||||
gpgcheck = 1
|
|
||||||
enabled=0
|
|
||||||
|
|
@ -25,14 +25,14 @@ start()
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
type=$(/usr/bin/xenstore-read qubes_vm_type)
|
type=$(/usr/bin/xenstore-read qubes_vm_type)
|
||||||
if [ "$type" != "AppVM" -a "$type" != "DisposableVM" ]; then
|
if [ "$type" != "AppVM" -a "$type" != "DisposableVM" ]; then
|
||||||
# This script runs only on AppVMs
|
# This script runs only on AppVMs
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start AppVM specific services
|
# Start AppVM specific services
|
||||||
/sbin/service cups start
|
/sbin/service cups start
|
||||||
|
|
||||||
echo -n $"Executing Qubes Core scripts for AppVM:"
|
echo -n $"Executing Qubes Core scripts for AppVM:"
|
||||||
|
|
||||||
@ -52,9 +52,9 @@ start()
|
|||||||
echo Back to life.
|
echo Back to life.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MEM_CHANGE_THRESHOLD_KB=30000
|
MEM_CHANGE_THRESHOLD_KB=30000
|
||||||
MEMINFO_DELAY_USEC=100000
|
MEMINFO_DELAY_USEC=100000
|
||||||
/usr/lib/qubes/meminfo-writer $MEM_CHANGE_THRESHOLD_KB $MEMINFO_DELAY_USEC &
|
/usr/lib/qubes/meminfo-writer $MEM_CHANGE_THRESHOLD_KB $MEMINFO_DELAY_USEC &
|
||||||
|
|
||||||
success
|
success
|
||||||
echo ""
|
echo ""
|
||||||
|
43
appvm/qvm-copy-to-vm2.gnome
Executable file
43
appvm/qvm-copy-to-vm2.gnome
Executable file
@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# The Qubes OS Project, http://www.qubes-os.org
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010 Rafal Wojtczuk <rafal@invisiblethingslab.com>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
VM=$(zenity --entry --title="File Copy" --text="Enter the destination domain name:")
|
||||||
|
if [ X$VM = X ] ; then exit 0 ; fi
|
||||||
|
|
||||||
|
SIZE=$(du --apparent-size -c "$@" | tail -1 | cut -f 1)
|
||||||
|
|
||||||
|
export PROGRESS_FILE=$(mktemp)
|
||||||
|
/usr/lib/qubes/qvm-trigger-copy-to-vm $VM "$@"
|
||||||
|
while ! [ -s $PROGRESS_FILE ] ; do
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
|
(while true ; do
|
||||||
|
read agentpid sentsize agentstatus < $PROGRESS_FILE
|
||||||
|
if [ "x"$agentstatus = x ] ; then continue ; fi
|
||||||
|
if ! [ -e /proc/$agentpid ] ; then break ; fi
|
||||||
|
if [ "x"$agentstatus = xdone ] ; then break ; fi
|
||||||
|
CURRSIZE=$(($sentsize/1024))
|
||||||
|
echo $((100*$CURRSIZE/$SIZE))
|
||||||
|
sleep 0.1
|
||||||
|
done) | zenity --progress --text="Copying files to domain: $VM..." --auto-close
|
||||||
|
|
||||||
|
rm -f $PROGRESS_FILE
|
40
common/RPM-GPG-KEY-qubes-1-primary
Normal file
40
common/RPM-GPG-KEY-qubes-1-primary
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
Version: GnuPG v2.0.14 (GNU/Linux)
|
||||||
|
|
||||||
|
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
|
||||||
|
=7fth
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
@ -15,18 +15,23 @@ static void fix_display()
|
|||||||
|
|
||||||
static void produce_message(char * type, const char *fmt, va_list args)
|
static void produce_message(char * type, const char *fmt, va_list args)
|
||||||
{
|
{
|
||||||
char *kdialog_msg;
|
char *dialog_msg;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
(void) vsnprintf(buf, sizeof(buf), fmt, args);
|
(void) vsnprintf(buf, sizeof(buf), fmt, args);
|
||||||
asprintf(&kdialog_msg, "%s: %s: %s (error type: %s)",
|
asprintf(&dialog_msg, "%s: %s: %s (error type: %s)",
|
||||||
program_invocation_short_name, type, buf, strerror(errno));
|
program_invocation_short_name, type, buf, strerror(errno));
|
||||||
fprintf(stderr, "%s", kdialog_msg);
|
fprintf(stderr, "%s", dialog_msg);
|
||||||
switch (fork()) {
|
switch (fork()) {
|
||||||
case -1:
|
case -1:
|
||||||
exit(1); //what else
|
exit(1); //what else
|
||||||
case 0:
|
case 0:
|
||||||
fix_display();
|
fix_display();
|
||||||
execlp("kdialog", "kdialog", "--sorry", kdialog_msg, NULL);
|
#ifdef USE_KDIALOG
|
||||||
|
execlp("kdialog", "kdialog", "--sorry", dialog_msg, NULL);
|
||||||
|
#else
|
||||||
|
|
||||||
|
execlp("zenity", "zenity", "--error", "--text", dialog_msg, NULL);
|
||||||
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
|
13
common/qubes.repo
Normal file
13
common/qubes.repo
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[qubes-vm-current]
|
||||||
|
name = Qubes OS Repository for VM (updates)
|
||||||
|
baseurl = http://yum.qubes-os.org/r1-beta1/current/vm
|
||||||
|
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-qubes-primary
|
||||||
|
gpgcheck = 1
|
||||||
|
|
||||||
|
[qubes-appvm-testing]
|
||||||
|
name = Qubes OS Repository for VM (unstable)
|
||||||
|
baseurl = http://yum.qubes-os.org/r1-beta1/unstable/vm
|
||||||
|
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-qubes-primary
|
||||||
|
gpgcheck = 1
|
||||||
|
enabled=0
|
||||||
|
|
@ -57,6 +57,15 @@ start()
|
|||||||
/usr/lib/qubes/qrexec_agent 2>/var/log/qubes/qrexec_agent.log &
|
/usr/lib/qubes/qrexec_agent 2>/var/log/qubes/qrexec_agent.log &
|
||||||
|
|
||||||
[ -x /rw/config/rc.local ] && /rw/config/rc.local
|
[ -x /rw/config/rc.local ] && /rw/config/rc.local
|
||||||
|
|
||||||
|
if ! [ -f /home/user/.gnome2/nautilus-scripts/.scripts_created ] ; then
|
||||||
|
echo "Creating symlinks for nautilus actions..."
|
||||||
|
su user -c 'mkdir -p /home/user/.gnome2/nautilus-scripts'
|
||||||
|
su user -c 'ln -s /usr/lib/qubes/qvm-copy-to-vm2.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"'
|
||||||
|
su user -c 'ln -s /usr/bin/qvm-open-in-dvm2 /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"'
|
||||||
|
su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created'
|
||||||
|
fi
|
||||||
|
|
||||||
success
|
success
|
||||||
echo ""
|
echo ""
|
||||||
return 0
|
return 0
|
||||||
|
@ -46,6 +46,7 @@ if not dry_run:
|
|||||||
|
|
||||||
|
|
||||||
qubes_guid_path = "/usr/bin/qubes_guid"
|
qubes_guid_path = "/usr/bin/qubes_guid"
|
||||||
|
qrexec_daemon_path = "/usr/lib/qubes/qrexec_daemon"
|
||||||
|
|
||||||
qubes_base_dir = "/var/lib/qubes"
|
qubes_base_dir = "/var/lib/qubes"
|
||||||
|
|
||||||
@ -897,6 +898,14 @@ class QubesVm(object):
|
|||||||
print "--> Starting the VM..."
|
print "--> Starting the VM..."
|
||||||
xend_session.session.xenapi.VM.unpause (self.session_uuid)
|
xend_session.session.xenapi.VM.unpause (self.session_uuid)
|
||||||
|
|
||||||
|
if not preparing_dvm:
|
||||||
|
if verbose:
|
||||||
|
print "--> Starting the qrexec daemon..."
|
||||||
|
retcode = subprocess.call ([qrexec_daemon_path, str(xid)])
|
||||||
|
if (retcode != 0) :
|
||||||
|
self.force_shutdown()
|
||||||
|
raise OSError ("ERROR: Cannot execute qrexec_daemon!")
|
||||||
|
|
||||||
# perhaps we should move it before unpause and fork?
|
# perhaps we should move it before unpause and fork?
|
||||||
if debug_console:
|
if debug_console:
|
||||||
from xen.xm import console
|
from xen.xm import console
|
||||||
@ -1386,9 +1395,12 @@ class QubesProxyVm(QubesNetVm):
|
|||||||
# Allow dom0 networking
|
# Allow dom0 networking
|
||||||
iptables += "-A FORWARD -i vif0.0 -j ACCEPT\n"
|
iptables += "-A FORWARD -i vif0.0 -j ACCEPT\n"
|
||||||
|
|
||||||
vms = [vm for vm in self.connected_vms.values() if vm.has_firewall()]
|
vms = [vm for vm in self.connected_vms.values()]
|
||||||
for vm in vms:
|
for vm in vms:
|
||||||
conf = vm.get_firewall_conf()
|
if vm.has_firewall():
|
||||||
|
conf = vm.get_firewall_conf()
|
||||||
|
else:
|
||||||
|
conf = { "rules": list(), "allow": True, "allowDns": True, "allowIcmp": True }
|
||||||
|
|
||||||
xid = vm.get_xid()
|
xid = vm.get_xid()
|
||||||
if xid < 0: # VM not active ATM
|
if xid < 0: # VM not active ATM
|
||||||
|
@ -34,7 +34,6 @@ import os.path
|
|||||||
|
|
||||||
qubes_guid_path = "/usr/bin/qubes_guid"
|
qubes_guid_path = "/usr/bin/qubes_guid"
|
||||||
qubes_clipd_path = "/usr/bin/qclipd"
|
qubes_clipd_path = "/usr/bin/qclipd"
|
||||||
qrexec_daemon_path = "/usr/lib/qubes/qrexec_daemon"
|
|
||||||
qrexec_client_path = "/usr/lib/qubes/qrexec_client"
|
qrexec_client_path = "/usr/lib/qubes/qrexec_client"
|
||||||
notify_object = None
|
notify_object = None
|
||||||
|
|
||||||
@ -114,14 +113,6 @@ def vm_run_cmd(vm, cmd, options):
|
|||||||
tray_notify_error ("ERROR: Cannot start qubes_guid!")
|
tray_notify_error ("ERROR: Cannot start qubes_guid!")
|
||||||
exit (1)
|
exit (1)
|
||||||
|
|
||||||
if options.verbose:
|
|
||||||
print "--> Starting Qubes rexec daemon..."
|
|
||||||
|
|
||||||
retcode = subprocess.call ([qrexec_daemon_path, str(xid)])
|
|
||||||
if (retcode != 0) :
|
|
||||||
print "ERROR: Cannot start qrexec_daemon!"
|
|
||||||
exit (1)
|
|
||||||
|
|
||||||
actually_execute(str(xid), cmd, options);
|
actually_execute(str(xid), cmd, options);
|
||||||
|
|
||||||
else: # VM already running...
|
else: # VM already running...
|
||||||
@ -133,15 +124,6 @@ def vm_run_cmd(vm, cmd, options):
|
|||||||
if options.tray:
|
if options.tray:
|
||||||
tray_notify_error ("ERROR: Cannot start the GUI daemon for this VM!")
|
tray_notify_error ("ERROR: Cannot start the GUI daemon for this VM!")
|
||||||
exit (1)
|
exit (1)
|
||||||
|
|
||||||
if not os.path.exists("/var/run/qubes/qrexec.{0}".format(xid)):
|
|
||||||
retcode = subprocess.call ([qrexec_daemon_path, str(xid)])
|
|
||||||
if (retcode != 0) :
|
|
||||||
print "ERROR: Cannot start qrexec!"
|
|
||||||
if options.tray:
|
|
||||||
tray_notify_error ("ERROR: Cannot start the QRexec daemon for this VM!")
|
|
||||||
exit (1)
|
|
||||||
|
|
||||||
actually_execute(str(xid), cmd, options);
|
actually_execute(str(xid), cmd, options);
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -27,7 +27,6 @@ import subprocess
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
qubes_guid_path = "/usr/bin/qubes_guid"
|
qubes_guid_path = "/usr/bin/qubes_guid"
|
||||||
qrexec_daemon_path = "/usr/lib/qubes/qrexec_daemon"
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
usage = "usage: %prog [options] <vm-name>"
|
usage = "usage: %prog [options] <vm-name>"
|
||||||
@ -35,8 +34,6 @@ def main():
|
|||||||
parser.add_option ("-q", "--quiet", action="store_false", dest="verbose", default=True)
|
parser.add_option ("-q", "--quiet", action="store_false", dest="verbose", default=True)
|
||||||
parser.add_option ("--no-guid", action="store_true", dest="noguid", default=False,
|
parser.add_option ("--no-guid", action="store_true", dest="noguid", default=False,
|
||||||
help="Do not start the GUId")
|
help="Do not start the GUId")
|
||||||
parser.add_option ("--no-rexec", action="store_true", dest="norexec", default=False,
|
|
||||||
help="Do not start rexec")
|
|
||||||
parser.add_option ("--console", action="store_true", dest="debug_console", default=False,
|
parser.add_option ("--console", action="store_true", dest="debug_console", default=False,
|
||||||
help="Attach debugging console to the newly started VM")
|
help="Attach debugging console to the newly started VM")
|
||||||
parser.add_option ("--dvm", action="store_true", dest="preparing_dvm", default=False,
|
parser.add_option ("--dvm", action="store_true", dest="preparing_dvm", default=False,
|
||||||
@ -73,14 +70,5 @@ def main():
|
|||||||
print "ERROR: Cannot start qubes_guid!"
|
print "ERROR: Cannot start qubes_guid!"
|
||||||
exit (1)
|
exit (1)
|
||||||
|
|
||||||
if not options.norexec:
|
|
||||||
if options.verbose:
|
|
||||||
print "--> Starting Qubes rexec..."
|
|
||||||
|
|
||||||
retcode = subprocess.call ([qrexec_daemon_path, str(xid)])
|
|
||||||
if (retcode != 0) :
|
|
||||||
print "ERROR: Cannot start qrexec_daemon!"
|
|
||||||
exit (1)
|
|
||||||
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
@ -21,7 +21,7 @@ if ! [ -d $VMDIR ] ; then
|
|||||||
echo $VMDIR does not exist ?
|
echo $VMDIR does not exist ?
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! qvm-start $1 --no-guid --no-rexec --dvm ; then
|
if ! qvm-start $1 --no-guid --dvm ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ int server_fd;
|
|||||||
|
|
||||||
void handle_usr1(int x)
|
void handle_usr1(int x)
|
||||||
{
|
{
|
||||||
|
fprintf(stderr, "connected\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +78,11 @@ void init(int xid)
|
|||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pause();
|
fprintf(stderr, "Waiting for VM's qrexec agent.");
|
||||||
|
for (;;) {
|
||||||
|
sleep(1);
|
||||||
|
fprintf(stderr, ".");
|
||||||
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
close(0);
|
close(0);
|
||||||
@ -126,9 +131,9 @@ void flush_client(int fd)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct server_header s_hdr;
|
struct server_header s_hdr;
|
||||||
|
|
||||||
if (fork_and_flush_stdin(fd, &clients[fd].buffer))
|
if (fork_and_flush_stdin(fd, &clients[fd].buffer))
|
||||||
children_count++;
|
children_count++;
|
||||||
close(fd);
|
close(fd);
|
||||||
clients[fd].state = CLIENT_INVALID;
|
clients[fd].state = CLIENT_INVALID;
|
||||||
buffer_free(&clients[fd].buffer);
|
buffer_free(&clients[fd].buffer);
|
||||||
|
@ -55,7 +55,7 @@ fi
|
|||||||
|
|
||||||
adduser --create-home user
|
adduser --create-home user
|
||||||
su user -c 'mkdir -p /home/user/.gnome2/nautilus-scripts'
|
su user -c 'mkdir -p /home/user/.gnome2/nautilus-scripts'
|
||||||
su user -c 'ln -s /usr/lib/qubes/qvm-copy-to-vm2.kde /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"'
|
su user -c 'ln -s /usr/lib/qubes/qvm-copy-to-vm2.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"'
|
||||||
su user -c 'ln -s /usr/bin/qvm-open-in-dvm2 /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"'
|
su user -c 'ln -s /usr/bin/qvm-open-in-dvm2 /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"'
|
||||||
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/qubes
|
mkdir -p $RPM_BUILD_ROOT/var/lib/qubes
|
||||||
@ -77,6 +77,7 @@ cp qubes_timestamp qvm-open-in-dvm2 $RPM_BUILD_ROOT/usr/bin
|
|||||||
cp qvm-copy-to-vm $RPM_BUILD_ROOT/usr/bin
|
cp qvm-copy-to-vm $RPM_BUILD_ROOT/usr/bin
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
cp qvm-copy-to-vm2.kde $RPM_BUILD_ROOT/usr/lib/qubes
|
cp qvm-copy-to-vm2.kde $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
|
cp qvm-copy-to-vm2.gnome $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
cp qvm-trigger-copy-to-vm $RPM_BUILD_ROOT/usr/lib/qubes
|
cp qvm-trigger-copy-to-vm $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
cp ../qrexec/qrexec_agent $RPM_BUILD_ROOT/usr/lib/qubes
|
cp ../qrexec/qrexec_agent $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
cp dvm_file_editor qfile-agent qfile-agent-dvm qfile-unpacker $RPM_BUILD_ROOT/usr/lib/qubes
|
cp dvm_file_editor qfile-agent qfile-agent-dvm qfile-unpacker $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
@ -129,6 +130,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/etc/init.d/qubes_core_appvm
|
/etc/init.d/qubes_core_appvm
|
||||||
/usr/bin/qvm-copy-to-vm
|
/usr/bin/qvm-copy-to-vm
|
||||||
/usr/lib/qubes/qvm-copy-to-vm2.kde
|
/usr/lib/qubes/qvm-copy-to-vm2.kde
|
||||||
|
/usr/lib/qubes/qvm-copy-to-vm2.gnome
|
||||||
/usr/bin/qvm-open-in-dvm2
|
/usr/bin/qvm-open-in-dvm2
|
||||||
/usr/lib/qubes/meminfo-writer
|
/usr/lib/qubes/meminfo-writer
|
||||||
/usr/lib/qubes/dvm_file_editor
|
/usr/lib/qubes/dvm_file_editor
|
||||||
|
@ -65,7 +65,9 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/qubes
|
|||||||
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
|
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
|
||||||
cp iptables $RPM_BUILD_ROOT/etc/sysconfig/
|
cp iptables $RPM_BUILD_ROOT/etc/sysconfig/
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/yum.repos.d
|
mkdir -p $RPM_BUILD_ROOT/etc/yum.repos.d
|
||||||
cp ../appvm/qubes.repo $RPM_BUILD_ROOT/etc/yum.repos.d
|
cp qubes.repo $RPM_BUILD_ROOT/etc/yum.repos.d
|
||||||
|
install -d -m 755 $RPM_BUILD_ROOT/etc/pki/rpm-gpg
|
||||||
|
install -m 644 RPM-GPG-KEY-qubes* $RPM_BUILD_ROOT/etc/pki/rpm-gpg/
|
||||||
mkdir -p $RPM_BUILD_ROOT/sbin
|
mkdir -p $RPM_BUILD_ROOT/sbin
|
||||||
cp qubes_serial_login $RPM_BUILD_ROOT/sbin
|
cp qubes_serial_login $RPM_BUILD_ROOT/sbin
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
||||||
@ -170,5 +172,6 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/etc/sysconfig/iptables
|
/etc/sysconfig/iptables
|
||||||
/var/lib/qubes
|
/var/lib/qubes
|
||||||
/etc/yum.repos.d/qubes.repo
|
/etc/yum.repos.d/qubes.repo
|
||||||
|
/etc/pki/rpm-gpg/RPM-GPG-KEY-qubes*
|
||||||
/sbin/qubes_serial_login
|
/sbin/qubes_serial_login
|
||||||
/usr/bin/xenstore-watch
|
/usr/bin/xenstore-watch
|
||||||
|
@ -111,9 +111,6 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/qubes/dvmdata
|
|||||||
mkdir -p $RPM_BUILD_ROOT/usr/share/qubes/icons
|
mkdir -p $RPM_BUILD_ROOT/usr/share/qubes/icons
|
||||||
cp icons/*.png $RPM_BUILD_ROOT/usr/share/qubes/icons
|
cp icons/*.png $RPM_BUILD_ROOT/usr/share/qubes/icons
|
||||||
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/yum.repos.d
|
|
||||||
cp ../dom0/qubes.repo $RPM_BUILD_ROOT/etc/yum.repos.d
|
|
||||||
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
||||||
cp ../common/qubes_setup_dnat_to_ns $RPM_BUILD_ROOT/usr/lib/qubes
|
cp ../common/qubes_setup_dnat_to_ns $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
cp ../common/qubes_fix_nm_conf.sh $RPM_BUILD_ROOT/usr/lib/qubes
|
cp ../common/qubes_fix_nm_conf.sh $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
@ -145,36 +142,6 @@ echo '[keyfile]' >> /etc/NetworkManager/NetworkManager.conf
|
|||||||
fi
|
fi
|
||||||
/usr/lib/qubes/qubes_fix_nm_conf.sh
|
/usr/lib/qubes/qubes_fix_nm_conf.sh
|
||||||
|
|
||||||
if [ -e /etc/yum.repos.d/qubes-r1-dom0.repo ]; then
|
|
||||||
# we want the user to use the repo that comes with qubes-core-dom0 packages instead
|
|
||||||
rm -f /etc/yum.repos.d/qubes-r1-dom0.repo
|
|
||||||
fi
|
|
||||||
|
|
||||||
#if [ "$1" != 1 ] ; then
|
|
||||||
## do this whole %post thing only when updating for the first time...
|
|
||||||
#exit 0
|
|
||||||
#fi
|
|
||||||
|
|
||||||
## TODO: This is only temporary, until we will have our own installer
|
|
||||||
#for f in /etc/init.d/*
|
|
||||||
#do
|
|
||||||
# srv=`basename $f`
|
|
||||||
# [ $srv = 'functions' ] && continue
|
|
||||||
# [ $srv = 'killall' ] && continue
|
|
||||||
# [ $srv = 'halt' ] && continue
|
|
||||||
# [ $srv = 'single' ] && continue
|
|
||||||
# chkconfig $srv off
|
|
||||||
#done
|
|
||||||
|
|
||||||
chkconfig iptables on
|
|
||||||
chkconfig NetworkManager on
|
|
||||||
chkconfig rsyslog on
|
|
||||||
chkconfig haldaemon on
|
|
||||||
chkconfig messagebus on
|
|
||||||
chkconfig xenstored on
|
|
||||||
chkconfig xend on
|
|
||||||
chkconfig xenconsoled on
|
|
||||||
|
|
||||||
sed 's/^net.ipv4.ip_forward.*/net.ipv4.ip_forward = 1/' -i /etc/sysctl.conf
|
sed 's/^net.ipv4.ip_forward.*/net.ipv4.ip_forward = 1/' -i /etc/sysctl.conf
|
||||||
|
|
||||||
chkconfig --add qubes_core || echo "WARNING: Cannot add service qubes_core!"
|
chkconfig --add qubes_core || echo "WARNING: Cannot add service qubes_core!"
|
||||||
@ -209,11 +176,6 @@ done
|
|||||||
|
|
||||||
service qubes_core start
|
service qubes_core start
|
||||||
|
|
||||||
NETVM=$(qvm-get-default-netvm)
|
|
||||||
if [ "X"$NETVM = "X""dom0" ] ; then
|
|
||||||
service qubes_netvm start
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "x"$HAD_SYSCONFIG_NETWORK = "xno" ]; then
|
if [ "x"$HAD_SYSCONFIG_NETWORK = "xno" ]; then
|
||||||
rm -f /etc/sysconfig/network
|
rm -f /etc/sysconfig/network
|
||||||
fi
|
fi
|
||||||
@ -228,10 +190,6 @@ fi
|
|||||||
|
|
||||||
if [ "$1" -gt 1 ] ; then
|
if [ "$1" -gt 1 ] ; then
|
||||||
# upgrading already installed package...
|
# upgrading already installed package...
|
||||||
NETVM=$(qvm-get-default-netvm)
|
|
||||||
if [ "X"$NETVM = "X""dom0" ] ; then
|
|
||||||
/etc/init.d/qubes_netvm stop
|
|
||||||
fi
|
|
||||||
|
|
||||||
/etc/init.d/qubes_core stop
|
/etc/init.d/qubes_core stop
|
||||||
fi
|
fi
|
||||||
@ -299,7 +257,6 @@ fi
|
|||||||
%attr(770,root,qubes) %dir /var/lib/qubes/backup
|
%attr(770,root,qubes) %dir /var/lib/qubes/backup
|
||||||
%attr(770,root,qubes) %dir /var/lib/qubes/dvmdata
|
%attr(770,root,qubes) %dir /var/lib/qubes/dvmdata
|
||||||
%dir /usr/share/qubes/icons/*.png
|
%dir /usr/share/qubes/icons/*.png
|
||||||
/etc/yum.repos.d/qubes.repo
|
|
||||||
/usr/lib/qubes/qubes_setup_dnat_to_ns
|
/usr/lib/qubes/qubes_setup_dnat_to_ns
|
||||||
/usr/lib/qubes/qubes_fix_nm_conf.sh
|
/usr/lib/qubes/qubes_fix_nm_conf.sh
|
||||||
/etc/dhclient.d/qubes_setup_dnat_to_ns.sh
|
/etc/dhclient.d/qubes_setup_dnat_to_ns.sh
|
||||||
|
@ -1 +1 @@
|
|||||||
1.5.4
|
1.5.8
|
||||||
|
@ -1 +1 @@
|
|||||||
1.5.4
|
1.5.8
|
||||||
|
Loading…
Reference in New Issue
Block a user