2013-03-16 17:23:22 +00:00
|
|
|
#
|
|
|
|
# This is the SPEC file for creating binary RPMs for the Dom0.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# The Qubes OS Project, http://www.qubes-os.org
|
|
|
|
#
|
|
|
|
# Copyright (C) 2013 Marek Marczykowski <marmarek@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.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
|
|
|
|
|
|
|
%{!?version: %define version %(cat version)}
|
|
|
|
|
|
|
|
%define _dracutmoddir /usr/lib/dracut/modules.d
|
|
|
|
%if %{fedora} < 17
|
|
|
|
%define _dracutmoddir /usr/share/dracut/modules.d
|
|
|
|
%endif
|
|
|
|
|
|
|
|
Name: qubes-core-dom0-linux
|
|
|
|
Version: %{version}
|
|
|
|
Release: 1%{?dist}
|
|
|
|
Summary: Linux-specific files for Qubes dom0
|
|
|
|
|
|
|
|
Group: Qubes
|
|
|
|
Vendor: Invisible Things Lab
|
|
|
|
License: GPL
|
|
|
|
URL: http://www.qubes-os.org
|
|
|
|
|
|
|
|
BuildRequires: ImageMagick
|
2013-03-16 17:34:00 +00:00
|
|
|
BuildRequires: pandoc
|
2015-11-11 04:12:42 +00:00
|
|
|
BuildRequires: qubes-utils-devel >= 3.1.3
|
2014-04-23 02:55:43 +00:00
|
|
|
BuildRequires: qubes-libvchan-devel
|
2013-03-16 17:23:22 +00:00
|
|
|
Requires: qubes-core-dom0
|
2017-05-24 19:53:08 +00:00
|
|
|
Requires: python3-qubesadmin
|
2017-05-29 03:47:36 +00:00
|
|
|
Requires: qubes-core-admin-client
|
2015-11-11 04:12:42 +00:00
|
|
|
Requires: qubes-utils >= 3.1.3
|
2015-07-14 21:27:03 +00:00
|
|
|
Requires: %{name}-kernel-install
|
2016-11-27 02:59:16 +00:00
|
|
|
Requires: xdotool
|
2013-03-16 17:23:22 +00:00
|
|
|
|
|
|
|
%define _builddir %(pwd)
|
|
|
|
|
|
|
|
%description
|
|
|
|
Linux customizations required to use system as Qubes dom0.
|
|
|
|
Additionally some graphical elements for every Linux desktop envirnment (icons,
|
|
|
|
appmenus etc).
|
|
|
|
|
2015-07-14 21:27:03 +00:00
|
|
|
%package kernel-install
|
|
|
|
Summary: Kernel install hook for Xen-based system
|
|
|
|
|
2015-07-29 19:35:04 +00:00
|
|
|
# get rid of os-prober, it tries to mount and parse all the block devices in
|
|
|
|
# the system, including loop*
|
|
|
|
Provides: os-prober
|
|
|
|
Obsoletes: os-prober
|
|
|
|
|
2015-07-14 21:27:03 +00:00
|
|
|
%description kernel-install
|
|
|
|
Kernel install hook for Xen-based system.
|
|
|
|
|
2013-03-16 17:23:22 +00:00
|
|
|
%prep
|
|
|
|
# we operate on the current directory, so no need to unpack anything
|
|
|
|
# symlink is to generate useful debuginfo packages
|
|
|
|
rm -f %{name}-%{version}
|
|
|
|
ln -sf . %{name}-%{version}
|
|
|
|
%setup -T -D
|
|
|
|
|
|
|
|
%build
|
2013-03-16 17:54:00 +00:00
|
|
|
(cd dom0-updates; make)
|
2013-03-20 05:24:17 +00:00
|
|
|
(cd qrexec; make)
|
2015-11-11 04:09:21 +00:00
|
|
|
(cd file-copy-vm; make)
|
2013-03-16 17:34:00 +00:00
|
|
|
(cd doc; make manpages)
|
2013-03-16 17:23:22 +00:00
|
|
|
|
|
|
|
%install
|
2013-03-16 17:54:00 +00:00
|
|
|
|
2017-05-17 13:47:13 +00:00
|
|
|
## Appmenus
|
|
|
|
install -d $RPM_BUILD_ROOT/etc/qubes-rpc/policy
|
2016-04-07 14:56:36 +00:00
|
|
|
cp qubesappmenus/qubes.SyncAppMenus.policy $RPM_BUILD_ROOT/etc/qubes-rpc/policy/qubes.SyncAppMenus
|
2013-03-16 17:54:00 +00:00
|
|
|
|
|
|
|
### Dom0 updates
|
|
|
|
install -D dom0-updates/qubes-dom0-updates.cron $RPM_BUILD_ROOT/etc/cron.daily/qubes-dom0-updates.cron
|
|
|
|
install -D dom0-updates/qubes-dom0-update $RPM_BUILD_ROOT/usr/bin/qubes-dom0-update
|
|
|
|
install -D dom0-updates/qubes-receive-updates $RPM_BUILD_ROOT/usr/libexec/qubes/qubes-receive-updates
|
2016-06-03 18:21:04 +00:00
|
|
|
install -D dom0-updates/patch-dnf-yum-config $RPM_BUILD_ROOT/usr/lib/qubes/patch-dnf-yum-config
|
2013-03-16 17:54:00 +00:00
|
|
|
install -m 0644 -D dom0-updates/qubes-cached.repo $RPM_BUILD_ROOT/etc/yum.real.repos.d/qubes-cached.repo
|
|
|
|
install -D dom0-updates/qfile-dom0-unpacker $RPM_BUILD_ROOT/usr/libexec/qubes/qfile-dom0-unpacker
|
|
|
|
install -m 0644 -D dom0-updates/qubes.ReceiveUpdates $RPM_BUILD_ROOT/etc/qubes-rpc/qubes.ReceiveUpdates
|
|
|
|
install -m 0664 -D dom0-updates/qubes.ReceiveUpdates.policy $RPM_BUILD_ROOT/etc/qubes-rpc/policy/qubes.ReceiveUpdates
|
|
|
|
|
|
|
|
install -d $RPM_BUILD_ROOT/var/lib/qubes/updates
|
|
|
|
|
2013-03-20 05:24:17 +00:00
|
|
|
# Qrexec
|
2017-05-17 12:30:30 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/bin $RPM_BUILD_ROOT/usr/sbin
|
|
|
|
install qrexec/qrexec-daemon $RPM_BUILD_ROOT/usr/sbin/
|
|
|
|
install qrexec/qrexec-client $RPM_BUILD_ROOT/usr/bin/
|
2013-03-20 05:24:17 +00:00
|
|
|
# XXX: Backward compatibility
|
2017-05-17 12:30:30 +00:00
|
|
|
ln -s ../../bin/qrexec-client $RPM_BUILD_ROOT/usr/lib/qubes/qrexec-client
|
|
|
|
ln -s ../../sbin/qrexec-daemon $RPM_BUILD_ROOT/usr/lib/qubes/qrexec-daemon
|
2013-03-20 05:24:17 +00:00
|
|
|
cp qrexec/qubes-rpc-multiplexer $RPM_BUILD_ROOT/usr/lib/qubes
|
2013-03-16 18:52:16 +00:00
|
|
|
|
|
|
|
### pm-utils
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/lib64/pm-utils/sleep.d
|
|
|
|
cp pm-utils/52qubes-pause-vms $RPM_BUILD_ROOT/usr/lib64/pm-utils/sleep.d/
|
2013-11-04 00:28:36 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system
|
|
|
|
cp pm-utils/qubes-suspend.service $RPM_BUILD_ROOT/usr/lib/systemd/system/
|
2013-03-16 18:52:16 +00:00
|
|
|
|
|
|
|
### Dracut module
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/dracut.conf.d
|
|
|
|
cp dracut/dracut.conf.d/* $RPM_BUILD_ROOT/etc/dracut.conf.d/
|
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_dracutmoddir}
|
|
|
|
cp -r dracut/modules.d/* $RPM_BUILD_ROOT%{_dracutmoddir}/
|
|
|
|
|
|
|
|
### Others
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
|
|
|
|
install -m 0644 -D system-config/limits-qubes.conf $RPM_BUILD_ROOT/etc/security/limits.d/99-qubes.conf
|
|
|
|
install -D system-config/cpufreq-xen.modules $RPM_BUILD_ROOT/etc/sysconfig/modules/cpufreq-xen.modules
|
|
|
|
install -m 0440 -D system-config/qubes.sudoers $RPM_BUILD_ROOT/etc/sudoers.d/qubes
|
|
|
|
install -D system-config/polkit-1-qubes-allow-all.rules $RPM_BUILD_ROOT/etc/polkit-1/rules.d/00-qubes-allow-all.rules
|
|
|
|
install -D system-config/qubes-dom0.modules $RPM_BUILD_ROOT/etc/sysconfig/modules/qubes-dom0.modules
|
|
|
|
install -D system-config/qubes-sync-clock.cron $RPM_BUILD_ROOT/etc/cron.d/qubes-sync-clock.cron
|
2014-06-11 00:41:20 +00:00
|
|
|
install -d $RPM_BUILD_ROOT/etc/udev/rules.d
|
|
|
|
install -m 644 system-config/00-qubes-ignore-devices.rules $RPM_BUILD_ROOT/etc/udev/rules.d/
|
2017-07-06 17:41:44 +00:00
|
|
|
install -m 644 system-config/12-qubes-ignore-lvm-devices.rules $RPM_BUILD_ROOT/etc/udev/rules.d/
|
2017-05-26 03:44:33 +00:00
|
|
|
install -m 644 -D system-config/disable-lesspipe.sh $RPM_BUILD_ROOT/etc/profile.d/zz-disable-lesspipe.sh
|
2015-07-10 15:54:24 +00:00
|
|
|
install -m 755 -D system-config/kernel-grub2.install $RPM_BUILD_ROOT/usr/lib/kernel/install.d/90-grub2.install
|
2015-09-26 01:56:16 +00:00
|
|
|
install -m 755 -D system-config/kernel-xen-efi.install $RPM_BUILD_ROOT/usr/lib/kernel/install.d/90-xen-efi.install
|
2015-08-03 01:00:59 +00:00
|
|
|
install -m 755 -D system-config/kernel-remove-bls.install $RPM_BUILD_ROOT/usr/lib/kernel/install.d/99-remove-bls.install
|
2016-06-06 00:22:58 +00:00
|
|
|
install -m 644 -D system-config/75-qubes-dom0.preset \
|
|
|
|
$RPM_BUILD_ROOT/usr/lib/systemd/system-preset/75-qubes-dom0.preset
|
|
|
|
install -m 644 -D system-config/99-qubes-default-disable.preset \
|
|
|
|
$RPM_BUILD_ROOT/usr/lib/systemd/system-preset/99-qubes-default-disable.preset
|
2013-03-16 18:52:16 +00:00
|
|
|
|
2017-09-15 03:15:23 +00:00
|
|
|
touch $RPM_BUILD_ROOT/var/lib/qubes/.qubes-exclude-block-devices
|
|
|
|
|
2015-11-11 04:09:21 +00:00
|
|
|
# file copy to VM
|
|
|
|
install -m 755 file-copy-vm/qfile-dom0-agent $RPM_BUILD_ROOT/usr/lib/qubes/
|
|
|
|
install -m 755 file-copy-vm/qvm-copy-to-vm $RPM_BUILD_ROOT/usr/bin/
|
2016-12-04 16:52:18 +00:00
|
|
|
ln -s qvm-copy-to-vm $RPM_BUILD_ROOT/usr/bin/qvm-move-to-vm
|
2015-11-11 04:09:21 +00:00
|
|
|
|
2013-03-16 17:54:00 +00:00
|
|
|
### Documentation
|
2013-03-16 17:34:00 +00:00
|
|
|
(cd doc; make DESTDIR=$RPM_BUILD_ROOT install)
|
|
|
|
|
2013-03-25 15:21:43 +00:00
|
|
|
%pre
|
|
|
|
if ! grep -q ^qubes: /etc/group ; then
|
|
|
|
groupadd qubes
|
|
|
|
fi
|
|
|
|
|
2013-03-16 17:23:22 +00:00
|
|
|
%post
|
|
|
|
|
2016-06-03 18:21:04 +00:00
|
|
|
/usr/lib/qubes/patch-dnf-yum-config
|
2014-03-04 01:07:50 +00:00
|
|
|
|
2013-11-04 00:28:36 +00:00
|
|
|
systemctl enable qubes-suspend.service >/dev/null 2>&1
|
|
|
|
|
2013-03-16 17:23:22 +00:00
|
|
|
%preun
|
|
|
|
if [ "$1" = 0 ] ; then
|
|
|
|
# no more packages left
|
|
|
|
|
2013-11-04 00:28:36 +00:00
|
|
|
systemctl disable qubes-suspend.service > /dev/null 2>&1
|
2013-03-16 17:23:22 +00:00
|
|
|
fi
|
|
|
|
|
2013-03-16 17:54:00 +00:00
|
|
|
%triggerin -- PackageKit
|
|
|
|
# dom0 have no network, but still can receive updates (qubes-dom0-update)
|
|
|
|
sed -i 's/^UseNetworkHeuristic=.*/UseNetworkHeuristic=false/' /etc/PackageKit/PackageKit.conf
|
2013-03-16 17:23:22 +00:00
|
|
|
|
2013-03-16 18:52:16 +00:00
|
|
|
%triggerin -- xorg-x11-drv-vmmouse
|
2014-09-30 21:51:10 +00:00
|
|
|
# Remove unnecessary udev rules that causes problems in dom0 (#605)
|
|
|
|
rm -f /lib/udev/rules.d/69-xorg-vmmouse.rules
|
2013-03-16 18:52:16 +00:00
|
|
|
|
2014-04-14 02:14:18 +00:00
|
|
|
%triggerin -- grub2-tools
|
|
|
|
chmod -x /etc/grub.d/10_linux
|
|
|
|
|
2013-03-16 17:23:22 +00:00
|
|
|
%files
|
2013-10-23 03:40:27 +00:00
|
|
|
/etc/qubes-rpc/policy/qubes.SyncAppMenus
|
2013-03-16 17:54:00 +00:00
|
|
|
# Dom0 updates
|
|
|
|
/etc/cron.daily/qubes-dom0-updates.cron
|
|
|
|
/etc/yum.real.repos.d/qubes-cached.repo
|
|
|
|
/usr/bin/qubes-dom0-update
|
2016-06-03 18:21:04 +00:00
|
|
|
/usr/lib/qubes/patch-dnf-yum-config
|
2013-03-16 17:54:00 +00:00
|
|
|
%attr(4750,root,qubes) /usr/libexec/qubes/qfile-dom0-unpacker
|
|
|
|
/usr/libexec/qubes/qubes-receive-updates
|
|
|
|
/etc/qubes-rpc/qubes.ReceiveUpdates
|
|
|
|
%attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.ReceiveUpdates
|
|
|
|
%attr(0770,root,qubes) %dir /var/lib/qubes/updates
|
2013-03-16 18:52:16 +00:00
|
|
|
# Dracut module
|
|
|
|
/etc/dracut.conf.d/*
|
|
|
|
%dir %{_dracutmoddir}/90qubes-pciback
|
|
|
|
%{_dracutmoddir}/90qubes-pciback/*
|
2013-06-14 02:03:47 +00:00
|
|
|
%dir %{_dracutmoddir}/90extra-modules
|
|
|
|
%{_dracutmoddir}/90extra-modules/*
|
2013-03-20 05:24:17 +00:00
|
|
|
# Qrexec
|
2017-05-17 12:30:30 +00:00
|
|
|
/usr/sbin/qrexec-daemon
|
|
|
|
/usr/bin/qrexec-client
|
2013-03-20 05:24:17 +00:00
|
|
|
/usr/lib/qubes/qubes-rpc-multiplexer
|
2017-05-17 12:30:30 +00:00
|
|
|
# compat symlinks
|
|
|
|
/usr/lib/qubes/qrexec-client
|
|
|
|
/usr/lib/qubes/qrexec-daemon
|
2015-11-11 04:09:21 +00:00
|
|
|
# file copy
|
|
|
|
/usr/bin/qvm-copy-to-vm
|
|
|
|
/usr/bin/qvm-move-to-vm
|
|
|
|
/usr/lib/qubes/qfile-dom0-agent
|
2013-03-16 18:52:16 +00:00
|
|
|
# pm-utils
|
|
|
|
/usr/lib64/pm-utils/sleep.d/52qubes-pause-vms
|
2013-11-04 00:28:36 +00:00
|
|
|
/usr/lib/systemd/system/qubes-suspend.service
|
2013-03-16 18:52:16 +00:00
|
|
|
# Others
|
|
|
|
/etc/sysconfig/modules/qubes-dom0.modules
|
|
|
|
/etc/sysconfig/modules/cpufreq-xen.modules
|
|
|
|
/etc/sudoers.d/qubes
|
|
|
|
/etc/polkit-1/rules.d/00-qubes-allow-all.rules
|
|
|
|
/etc/security/limits.d/99-qubes.conf
|
2014-06-11 00:41:20 +00:00
|
|
|
%config /etc/udev/rules.d/00-qubes-ignore-devices.rules
|
2017-07-06 17:41:44 +00:00
|
|
|
%config /etc/udev/rules.d/12-qubes-ignore-lvm-devices.rules
|
2013-03-16 18:52:16 +00:00
|
|
|
%attr(0644,root,root) /etc/cron.d/qubes-sync-clock.cron
|
2017-05-26 03:44:33 +00:00
|
|
|
%config(noreplace) /etc/profile.d/zz-disable-lesspipe.sh
|
2016-06-06 00:22:58 +00:00
|
|
|
/usr/lib/systemd/system-preset/75-qubes-dom0.preset
|
|
|
|
/usr/lib/systemd/system-preset/99-qubes-default-disable.preset
|
2017-09-15 03:15:23 +00:00
|
|
|
/var/lib/qubes/.qubes-exclude-block-devices
|
2013-03-16 17:54:00 +00:00
|
|
|
# Man
|
2013-03-16 17:34:00 +00:00
|
|
|
%{_mandir}/man1/qvm-*.1*
|
2013-03-16 17:54:00 +00:00
|
|
|
%{_mandir}/man1/qubes-*.1*
|
|
|
|
|
2015-07-14 21:27:03 +00:00
|
|
|
%files kernel-install
|
|
|
|
/usr/lib/kernel/install.d/90-grub2.install
|
2015-09-26 01:56:16 +00:00
|
|
|
/usr/lib/kernel/install.d/90-xen-efi.install
|
2015-08-03 01:00:59 +00:00
|
|
|
/usr/lib/kernel/install.d/99-remove-bls.install
|
2013-03-16 17:23:22 +00:00
|
|
|
|
|
|
|
%changelog
|