diff --git a/Makefile b/Makefile index 5e7ec5e..741f48b 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,6 @@ RPMS_DIR=rpm/ VERSION := $(shell cat version) DIST ?= fc18 -KDESERVICEDIR ?= /usr/share/kde4/services -KDE5SERVICEDIR ?= /usr/share/kservices5/ServiceMenus/ APPLICATIONSDIR ?= /usr/share/applications SBINDIR ?= /usr/sbin BINDIR ?= /usr/bin @@ -235,69 +233,6 @@ install-common: install-doc install -m 0755 misc/qvm-features-request $(DESTDIR)$(BINDIR)/qvm-features-request install -m 0755 misc/qubes-run-terminal $(DESTDIR)/$(BINDIR) install -D -m 0644 misc/qubes-run-terminal.desktop $(DESTDIR)/$(APPLICATIONSDIR)/qubes-run-terminal.desktop - install -m 0755 qubes-rpc/qvm-sync-clock $(DESTDIR)$(BINDIR)/qvm-sync-clock - install qubes-rpc/{qvm-open-in-dvm,qvm-open-in-vm,qvm-copy,qvm-run-vm} $(DESTDIR)/usr/bin - ln -s qvm-copy $(DESTDIR)/usr/bin/qvm-move-to-vm - ln -s qvm-copy $(DESTDIR)/usr/bin/qvm-move - ln -s qvm-copy $(DESTDIR)/usr/bin/qvm-copy-to-vm - install qubes-rpc/qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes - ln -s qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes/qvm-move-to-vm.gnome - ln -s qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes/qvm-copy-to-vm.kde - ln -s qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes/qvm-move-to-vm.kde - install qubes-rpc/qvm-actions.sh $(DESTDIR)$(LIBDIR)/qubes - install -m 0644 misc/uca_qubes.xml $(DESTDIR)$(LIBDIR)/qubes - mkdir -p $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml - install -m 0644 misc/thunar.xml $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml - install qubes-rpc/xdg-icon $(DESTDIR)$(LIBDIR)/qubes - install qubes-rpc/{vm-file-editor,qfile-agent,qopen-in-vm} $(DESTDIR)$(LIBDIR)/qubes - install qubes-rpc/qubes-open $(DESTDIR)$(BINDIR) - install qubes-rpc/tar2qfile $(DESTDIR)$(LIBDIR)/qubes - # Install qfile-unpacker as SUID - because it will fail to receive files from other vm - install -m 4755 qubes-rpc/qfile-unpacker $(DESTDIR)$(LIBDIR)/qubes - install qubes-rpc/qrun-in-vm $(DESTDIR)$(LIBDIR)/qubes - install qubes-rpc/prepare-suspend $(DESTDIR)$(LIBDIR)/qubes - install qubes-rpc/qubes-sync-clock $(DESTDIR)$(LIBDIR)/qubes - install -m 0644 misc/qubes-suspend-module-blacklist $(DESTDIR)/etc/qubes-suspend-module-blacklist - install -d $(DESTDIR)/$(KDESERVICEDIR) - install -m 0644 qubes-rpc/{qvm-copy.desktop,qvm-move.desktop,qvm-dvm.desktop} $(DESTDIR)/$(KDESERVICEDIR) - install -d $(DESTDIR)/$(KDE5SERVICEDIR) - install -m 0644 qubes-rpc/{qvm-copy.desktop,qvm-move.desktop,qvm-dvm.desktop} $(DESTDIR)/$(KDE5SERVICEDIR) - install -d $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/{qubes.Filecopy,qubes.OpenInVM,qubes.VMShell} $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.VMRootShell $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.OpenURL $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/{qubes.SuspendPre,qubes.SuspendPost,qubes.GetAppmenus} $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.SuspendPreAll $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.SuspendPostAll $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.WaitForSession $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.DetachPciDevice $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.{Backup,Restore} $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.Select{File,Directory} $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.GetImageRGBA $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.SetDateTime $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.InstallUpdatesGUI $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.ResizeDisk $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.StartApp $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.PostInstall $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.GetDate $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.ShowInTerminal $(DESTDIR)/etc/qubes-rpc - install -m 0755 qubes-rpc/qubes.ConnectTCP $(DESTDIR)/etc/qubes-rpc - install -d $(DESTDIR)/etc/qubes/rpc-config - for config in qubes-rpc/*.config; do \ - install -m 0644 $$config $(DESTDIR)/etc/qubes/rpc-config/`basename $$config .config`; \ - done - - install -d $(DESTDIR)/etc/qubes/suspend-pre.d - install -m 0644 qubes-rpc/suspend-pre.README $(DESTDIR)/etc/qubes/suspend-pre.d/README - install -d $(DESTDIR)/etc/qubes/suspend-post.d - install -m 0644 qubes-rpc/suspend-post.README $(DESTDIR)/etc/qubes/suspend-post.d/README - install -m 0755 qubes-rpc/suspend-post-qvm-sync-clock.sh \ - $(DESTDIR)/etc/qubes/suspend-post.d/qvm-sync-clock.sh - install -d $(DESTDIR)/etc/qubes/post-install.d - install -m 0644 post-install.d/README $(DESTDIR)/etc/qubes/post-install.d/ - install -m 0755 post-install.d/*.sh $(DESTDIR)/etc/qubes/post-install.d/ - install -d $(DESTDIR)/usr/share/nautilus-python/extensions - install -m 0644 qubes-rpc/*_nautilus.py $(DESTDIR)/usr/share/nautilus-python/extensions install -D -m 0644 misc/dconf-db-local-dpi $(DESTDIR)/etc/dconf/db/local.d/dpi @@ -305,8 +240,6 @@ install-common: install-doc install -d $(DESTDIR)/mnt/removable - install -D -m 0644 misc/xorg-preload-apps.conf $(DESTDIR)/etc/X11/xorg-preload-apps.conf - install -d $(DESTDIR)/usr/lib/qubes-bind-dirs.d install -D -m 0644 misc/30_cron.conf $(DESTDIR)/usr/lib/qubes-bind-dirs.d/30_cron.conf diff --git a/debian/qubes-core-agent.install b/debian/qubes-core-agent.install index ed90ad8..781d93b 100644 --- a/debian/qubes-core-agent.install +++ b/debian/qubes-core-agent.install @@ -1,4 +1,3 @@ -etc/X11/xorg-preload-apps.conf etc/apt/apt.conf.d/00notify-hook etc/apt/apt.conf.d/70no-unattended etc/apt/sources.list.d/qubes-r4.list diff --git a/debian/rules b/debian/rules index f8a1b49..fb94d24 100755 --- a/debian/rules +++ b/debian/rules @@ -16,6 +16,10 @@ override_dh_auto_build: override_dh_auto_install: make install-deb + make -C qubes-rpc install + make -C qubes-rpc/kde install + make -C qubes-rpc/nautilus install + make -C qubes-rpc/thunar install override_dh_fixperms: dh_fixperms -a -Xqfile-unpacker diff --git a/misc/xorg-preload-apps.conf b/misc/xorg-preload-apps.conf deleted file mode 100644 index 7edf848..0000000 --- a/misc/xorg-preload-apps.conf +++ /dev/null @@ -1,30 +0,0 @@ -Section "ServerLayout" - Identifier "Default Layout" - Screen 0 "Screen0" 0 0 -EndSection - -Section "Device" - Identifier "Videocard0" - Driver "dummy" - VideoRam 4001 -EndSection - -Section "Monitor" - Identifier "Monitor0" - HorizSync 49-50 - VertRefresh 62-63 - Modeline "QB1280x800" 64 1280 1281 1282 1283 800 801 802 803 -EndSection - -Section "Screen" - Identifier "Screen0" - Device "Videocard0" - Monitor "Monitor0" - DefaultDepth 24 - SubSection "Display" - Viewport 0 0 - Depth 24 - Modes "QB1280x800" - EndSubSection -EndSection - diff --git a/qubes-rpc/.gitignore b/qubes-rpc/.gitignore index 5fc44d8..681721b 100644 --- a/qubes-rpc/.gitignore +++ b/qubes-rpc/.gitignore @@ -6,3 +6,4 @@ qfile-agent-dvm qfile-unpacker qopen-in-vm vm-file-editor +tar2qfile diff --git a/qubes-rpc/Makefile b/qubes-rpc/Makefile index abcdaf7..162504c 100644 --- a/qubes-rpc/Makefile +++ b/qubes-rpc/Makefile @@ -1,16 +1,84 @@ -CC=gcc -CFLAGS=-g -O2 -Wall -Wextra -Werror -I. -fPIC -pie +BINDIR ?= /usr/bin +LIBDIR ?= /usr/lib +SYSCONFDIR ?= /etc +QUBESLIBDIR = $(LIBDIR)/qubes +QUBESRPCCMDDIR = $(SYSCONFDIR)/qubes-rpc +QUBESCONFDIR = $(SYSCONFDIR)/qubes +QUBESRPCCONFDIR = $(QUBESCONFDIR)/rpc-config + +ifneq ($(DEBUG),0) +DEBUG_FLAGS := -g +endif +CPPFLAGS := -I. +CFLAGS := $(DEBUG_FLAGS) -O2 -Wall -Wextra -Werror -fPIC -pie $(CFLAGS) +LDFLAGS := $(DEBUG_FLAGS) -pie $(LDFLAGS) +LDLIBS := -lqubes-rpc-filecopy + +.PHONY: all clean install + all: vm-file-editor qopen-in-vm qfile-agent qfile-unpacker tar2qfile + vm-file-editor: vm-file-editor.o - $(CC) -pie -g -o $@ $^ -lqubes-rpc-filecopy qopen-in-vm: qopen-in-vm.o gui-fatal.o - $(CC) -pie -g -o $@ $^ -lqubes-rpc-filecopy qfile-agent: qfile-agent.o gui-fatal.o - $(CC) -pie -g -o $@ $^ -lqubes-rpc-filecopy qfile-unpacker: qfile-unpacker.o gui-fatal.o - $(CC) -pie -g -o $@ $^ -lqubes-rpc-filecopy tar2qfile: tar2qfile.o gui-fatal.o - $(CC) -pie -g -o $@ $^ -lqubes-rpc-filecopy clean: - rm -f qopen-in-vm qfile-agent qfile-unpacker tar2qfile vm-file-editor *.o *~ + -$(RM) qopen-in-vm qfile-agent qfile-unpacker tar2qfile vm-file-editor *.o *~ + +install: + install -d $(DESTDIR)$(BINDIR) + install -t $(DESTDIR)$(BINDIR) \ + qubes-open \ + qvm-open-in-dvm qvm-open-in-vm qvm-run-vm qvm-sync-clock + install -t $(DESTDIR)$(BINDIR) qvm-copy + ln -s qvm-copy $(DESTDIR)$(BINDIR)/qvm-move-to-vm + ln -s qvm-copy $(DESTDIR)$(BINDIR)/qvm-move + ln -s qvm-copy $(DESTDIR)$(BINDIR)/qvm-copy-to-vm + install -d $(DESTDIR)$(QUBESLIBDIR) + install -t $(DESTDIR)$(QUBESLIBDIR) qvm-copy-to-vm.gnome + ln -s qvm-copy-to-vm.gnome $(DESTDIR)$(QUBESLIBDIR)/qvm-move-to-vm.gnome + ln -s qvm-copy-to-vm.gnome $(DESTDIR)$(QUBESLIBDIR)/qvm-copy-to-vm.kde + ln -s qvm-copy-to-vm.gnome $(DESTDIR)$(QUBESLIBDIR)/qvm-move-to-vm.kde + install -t $(DESTDIR)$(QUBESLIBDIR) \ + prepare-suspend \ + qfile-agent qopen-in-vm qrun-in-vm qubes-sync-clock \ + tar2qfile vm-file-editor xdg-icon + # Install qfile-unpacker as SUID, because it will fail to receive + # files from other vm. + install -t $(DESTDIR)$(QUBESLIBDIR) -m 4755 qfile-unpacker + install -d $(DESTDIR)$(QUBESRPCCMDDIR) + install -t $(DESTDIR)$(QUBESRPCCMDDIR) \ + qubes.Filecopy qubes.OpenInVM qubes.VMShell \ + qubes.VMRootShell \ + qubes.OpenURL \ + qubes.SuspendPre qubes.SuspendPost qubes.GetAppmenus \ + qubes.SuspendPreAll \ + qubes.SuspendPostAll \ + qubes.WaitForSession \ + qubes.DetachPciDevice \ + qubes.Backup qubes.Restore \ + qubes.SelectFile qubes.SelectDirectory \ + qubes.GetImageRGBA \ + qubes.SetDateTime \ + qubes.InstallUpdatesGUI \ + qubes.ResizeDisk \ + qubes.StartApp \ + qubes.PostInstall \ + qubes.GetDate \ + qubes.ShowInTerminal \ + qubes.ConnectTCP + for config in *.config; do \ + install -D -m 0644 "$$config" "$(DESTDIR)$(QUBESRPCCONFDIR)/$${config%.config}"; \ + done + install -d $(DESTDIR)$(SYSCONFDIR) + install -t $(DESTDIR)$(SYSCONFDIR) -m 0644 qubes-suspend-module-blacklist + install -d $(DESTDIR)/etc/qubes/suspend-pre.d + install -t $(DESTDIR)$(QUBESCONFDIR)/suspend-pre.d -m 0644 suspend-pre.d/README + install -d $(DESTDIR)/etc/qubes/suspend-post.d + install -t $(DESTDIR)$(QUBESCONFDIR)/suspend-post.d -m 0644 suspend-post.d/README + install -t $(DESTDIR)$(QUBESCONFDIR)/suspend-post.d suspend-post.d/*.sh + install -d $(DESTDIR)/etc/qubes/post-install.d + install -t $(DESTDIR)$(QUBESCONFDIR)/post-install.d -m 0644 post-install.d/README + install -t $(DESTDIR)$(QUBESCONFDIR)/post-install.d post-install.d/*.sh diff --git a/qubes-rpc/kde/Makefile b/qubes-rpc/kde/Makefile new file mode 100644 index 0000000..665896b --- /dev/null +++ b/qubes-rpc/kde/Makefile @@ -0,0 +1,14 @@ +KDESERVICEDIR ?= /usr/share/kde4/services +KDE5SERVICEDIR ?= /usr/share/kservices5/ServiceMenus + +.PHONY: install install-kde4 install-kde5 + +install-kde4: + install -d $(DESTDIR)$(KDESERVICEDIR) + install -t $(DESTDIR)$(KDESERVICEDIR) -m 0644 *.desktop + +install-kde5: + install -d $(DESTDIR)$(KDE5SERVICEDIR) + install -t $(DESTDIR)$(KDE5SERVICEDIR) -m 0644 *.desktop + +install: install-kde4 install-kde5 diff --git a/qubes-rpc/qvm-copy.desktop b/qubes-rpc/kde/qvm-copy.desktop similarity index 100% rename from qubes-rpc/qvm-copy.desktop rename to qubes-rpc/kde/qvm-copy.desktop diff --git a/qubes-rpc/qvm-dvm.desktop b/qubes-rpc/kde/qvm-dvm.desktop similarity index 100% rename from qubes-rpc/qvm-dvm.desktop rename to qubes-rpc/kde/qvm-dvm.desktop diff --git a/qubes-rpc/qvm-move.desktop b/qubes-rpc/kde/qvm-move.desktop similarity index 100% rename from qubes-rpc/qvm-move.desktop rename to qubes-rpc/kde/qvm-move.desktop diff --git a/qubes-rpc/nautilus/Makefile b/qubes-rpc/nautilus/Makefile new file mode 100644 index 0000000..bb0a40f --- /dev/null +++ b/qubes-rpc/nautilus/Makefile @@ -0,0 +1,7 @@ +NAUTILUSPYEXTDIR ?= /usr/share/nautilus-python/extensions + +.PHONY: install + +install: + install -d $(DESTDIR)$(NAUTILUSPYEXTDIR) + install -t $(DESTDIR)$(NAUTILUSPYEXTDIR) -m 0644 *.py diff --git a/qubes-rpc/qvm_copy_nautilus.py b/qubes-rpc/nautilus/qvm_copy_nautilus.py similarity index 100% rename from qubes-rpc/qvm_copy_nautilus.py rename to qubes-rpc/nautilus/qvm_copy_nautilus.py diff --git a/qubes-rpc/qvm_dvm_nautilus.py b/qubes-rpc/nautilus/qvm_dvm_nautilus.py similarity index 100% rename from qubes-rpc/qvm_dvm_nautilus.py rename to qubes-rpc/nautilus/qvm_dvm_nautilus.py diff --git a/qubes-rpc/qvm_move_nautilus.py b/qubes-rpc/nautilus/qvm_move_nautilus.py similarity index 100% rename from qubes-rpc/qvm_move_nautilus.py rename to qubes-rpc/nautilus/qvm_move_nautilus.py diff --git a/post-install.d/10-qubes-core-agent-appmenus.sh b/qubes-rpc/post-install.d/10-qubes-core-agent-appmenus.sh similarity index 100% rename from post-install.d/10-qubes-core-agent-appmenus.sh rename to qubes-rpc/post-install.d/10-qubes-core-agent-appmenus.sh diff --git a/post-install.d/10-qubes-core-agent-features.sh b/qubes-rpc/post-install.d/10-qubes-core-agent-features.sh similarity index 100% rename from post-install.d/10-qubes-core-agent-features.sh rename to qubes-rpc/post-install.d/10-qubes-core-agent-features.sh diff --git a/post-install.d/90-qubes-core-agent.sh b/qubes-rpc/post-install.d/90-qubes-core-agent.sh similarity index 100% rename from post-install.d/90-qubes-core-agent.sh rename to qubes-rpc/post-install.d/90-qubes-core-agent.sh diff --git a/post-install.d/README b/qubes-rpc/post-install.d/README similarity index 100% rename from post-install.d/README rename to qubes-rpc/post-install.d/README diff --git a/misc/qubes-suspend-module-blacklist b/qubes-rpc/qubes-suspend-module-blacklist similarity index 100% rename from misc/qubes-suspend-module-blacklist rename to qubes-rpc/qubes-suspend-module-blacklist diff --git a/qubes-rpc/suspend-post.README b/qubes-rpc/suspend-post.d/README similarity index 100% rename from qubes-rpc/suspend-post.README rename to qubes-rpc/suspend-post.d/README diff --git a/qubes-rpc/suspend-post-qvm-sync-clock.sh b/qubes-rpc/suspend-post.d/qvm-sync-clock.sh similarity index 100% rename from qubes-rpc/suspend-post-qvm-sync-clock.sh rename to qubes-rpc/suspend-post.d/qvm-sync-clock.sh diff --git a/qubes-rpc/suspend-pre.README b/qubes-rpc/suspend-pre.d/README similarity index 100% rename from qubes-rpc/suspend-pre.README rename to qubes-rpc/suspend-pre.d/README diff --git a/qubes-rpc/thunar/Makefile b/qubes-rpc/thunar/Makefile new file mode 100644 index 0000000..4e912b0 --- /dev/null +++ b/qubes-rpc/thunar/Makefile @@ -0,0 +1,12 @@ +SYSCONFDIR ?= /etc +LIBDIR ?= /usr/lib +QUBESLIBDIR = $(LIBDIR)/qubes + +.PHONY: install + +install: + install -d $(DESTDIR)$(QUBESLIBDIR) + install -D -t $(DESTDIR)$(QUBESLIBDIR) qvm-actions.sh + install -D -t $(DESTDIR)$(QUBESLIBDIR) -m 0644 uca_qubes.xml + install -d $(DESTDIR)$(SYSCONFDIR)/xdg/xfce4/xfconf/xfce-perchannel-xml + install -D -t $(DESTDIR)$(SYSCONFDIR)/xdg/xfce4/xfconf/xfce-perchannel-xml -m 0644 thunar.xml diff --git a/qubes-rpc/qvm-actions.sh b/qubes-rpc/thunar/qvm-actions.sh similarity index 100% rename from qubes-rpc/qvm-actions.sh rename to qubes-rpc/thunar/qvm-actions.sh diff --git a/misc/thunar.xml b/qubes-rpc/thunar/thunar.xml similarity index 100% rename from misc/thunar.xml rename to qubes-rpc/thunar/thunar.xml diff --git a/misc/uca_qubes.xml b/qubes-rpc/thunar/uca_qubes.xml similarity index 100% rename from misc/uca_qubes.xml rename to qubes-rpc/thunar/uca_qubes.xml diff --git a/rpm_spec/core-agent.spec.in b/rpm_spec/core-agent.spec.in index d72025f..8924323 100644 --- a/rpm_spec/core-agent.spec.in +++ b/rpm_spec/core-agent.spec.in @@ -291,6 +291,10 @@ usermod -p '' root %install make install-vm DESTDIR=$RPM_BUILD_ROOT +make -C qubes-rpc DESTDIR=$RPM_BUILD_ROOT install +make -C qubes-rpc/kde DESTDIR=$RPM_BUILD_ROOT install +make -C qubes-rpc/nautilus DESTDIR=$RPM_BUILD_ROOT install +make -C qubes-rpc/thunar DESTDIR=$RPM_BUILD_ROOT install %if 0%{?rhel} >= 7 sed -i \ @@ -535,7 +539,6 @@ rm -f %{name}-%{version} %{kde5_service_dir}/qvm-copy.desktop %{kde5_service_dir}/qvm-move.desktop %{kde5_service_dir}/qvm-dvm.desktop -%config(noreplace) /etc/X11/xorg-preload-apps.conf /etc/fstab /etc/pki/rpm-gpg/RPM-GPG-KEY-qubes* %dir /etc/qubes-rpc