core-vm.spec 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. #
  2. # The Qubes OS Project, http://www.qubes-os.org
  3. #
  4. # Copyright (C) 2010 Joanna Rutkowska <joanna@invisiblethingslab.com>
  5. # Copyright (C) 2010 Rafal Wojtczuk <rafal@invisiblethingslab.com>
  6. #
  7. # This program is free software; you can redistribute it and/or
  8. # modify it under the terms of the GNU General Public License
  9. # as published by the Free Software Foundation; either version 2
  10. # of the License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. #
  21. #
  22. %{!?version: %define version %(cat version)}
  23. Name: qubes-core-vm
  24. Version: %{version}
  25. Release: 1%{dist}
  26. Summary: The Qubes core files for VM
  27. Group: Qubes
  28. Vendor: Invisible Things Lab
  29. License: GPL
  30. URL: http://www.qubes-os.org
  31. Requires: /usr/bin/xenstore-read
  32. Requires: fedora-release
  33. Requires: yum-plugin-post-transaction-actions
  34. Requires: NetworkManager >= 0.8.1-1
  35. %if %{fedora} >= 18
  36. # Fedora >= 18 defaults to firewalld, which isn't supported nor needed by Qubes
  37. Requires: iptables-services
  38. Conflicts: firewalld
  39. %endif
  40. Requires: /usr/bin/mimeopen
  41. Requires: ethtool
  42. Requires: tinyproxy
  43. Requires: ntpdate
  44. Requires: net-tools
  45. Requires: nautilus-actions
  46. Requires: qubes-core-vm-kernel-placeholder
  47. Requires: qubes-qrexec-vm
  48. Provides: qubes-core-vm
  49. Obsoletes: qubes-core-commonvm
  50. Obsoletes: qubes-core-appvm
  51. Obsoletes: qubes-core-netvm
  52. Obsoletes: qubes-core-proxyvm
  53. Obsoletes: qubes-upgrade-vm < 2.0
  54. BuildRequires: xen-devel
  55. %define _builddir %(pwd)
  56. %define kde_service_dir /usr/share/kde4/services/ServiceMenus
  57. %description
  58. The Qubes core files for installation inside a Qubes VM.
  59. %prep
  60. # we operate on the current directory, so no need to unpack anything
  61. # symlink is to generate useful debuginfo packages
  62. rm -f %{name}-%{version}
  63. ln -sf . %{name}-%{version}
  64. %setup -T -D
  65. %build
  66. for dir in qubes-rpc misc; do
  67. (cd $dir; make)
  68. done
  69. %pre
  70. if [ "$1" != 1 ] ; then
  71. # do this whole %pre thing only when updating for the first time...
  72. exit 0
  73. fi
  74. mkdir -p /var/lib/qubes
  75. if [ -e /etc/fstab ] ; then
  76. mv /etc/fstab /var/lib/qubes/fstab.orig
  77. fi
  78. adduser --create-home user
  79. %install
  80. install -m 0644 -D misc/fstab $RPM_BUILD_ROOT/etc/fstab
  81. install -d $RPM_BUILD_ROOT/etc/init.d
  82. install vm-init.d/* $RPM_BUILD_ROOT/etc/init.d/
  83. install -d $RPM_BUILD_ROOT/lib/systemd/system $RPM_BUILD_ROOT/usr/lib/qubes/init
  84. install -m 0755 vm-systemd/*.sh $RPM_BUILD_ROOT/usr/lib/qubes/init/
  85. install -m 0644 vm-systemd/qubes-*.service $RPM_BUILD_ROOT/lib/systemd/system/
  86. install -m 0644 vm-systemd/qubes-*.timer $RPM_BUILD_ROOT/lib/systemd/system/
  87. install -m 0644 vm-systemd/NetworkManager.service $RPM_BUILD_ROOT/usr/lib/qubes/init/
  88. install -m 0644 vm-systemd/NetworkManager-wait-online.service $RPM_BUILD_ROOT/usr/lib/qubes/init/
  89. install -m 0644 vm-systemd/cups.service $RPM_BUILD_ROOT/usr/lib/qubes/init/
  90. install -m 0644 vm-systemd/ntpd.service $RPM_BUILD_ROOT/usr/lib/qubes/init/
  91. install -D -m 0440 misc/qubes.sudoers $RPM_BUILD_ROOT/etc/sudoers.d/qubes
  92. install -D -m 0644 misc/qubes.repo $RPM_BUILD_ROOT/etc/yum.repos.d/qubes.repo
  93. install -D -m 0644 misc/serial.conf $RPM_BUILD_ROOT/usr/lib/qubes/serial.conf
  94. install -D misc/qubes-serial-login $RPM_BUILD_ROOT/sbin/qubes-serial-login
  95. install -d $RPM_BUILD_ROOT/usr/share/glib-2.0/schemas/
  96. install -m 0644 misc/org.gnome.settings-daemon.plugins.updates.gschema.override $RPM_BUILD_ROOT/usr/share/glib-2.0/schemas/
  97. install -d $RPM_BUILD_ROOT/usr/lib/yum-plugins/
  98. install -m 0644 misc/yum-qubes-hooks.py* $RPM_BUILD_ROOT/usr/lib/yum-plugins/
  99. install -D -m 0644 misc/yum-qubes-hooks.conf $RPM_BUILD_ROOT/etc/yum/pluginconf.d/yum-qubes-hooks.conf
  100. install -d $RPM_BUILD_ROOT/var/lib/qubes
  101. install -d -m 755 $RPM_BUILD_ROOT/etc/pki/rpm-gpg
  102. install -m 644 misc/RPM-GPG-KEY-qubes* $RPM_BUILD_ROOT/etc/pki/rpm-gpg/
  103. install -D misc/xenstore-watch $RPM_BUILD_ROOT/usr/bin/xenstore-watch-qubes
  104. install -d $RPM_BUILD_ROOT/etc/udev/rules.d
  105. install -m 0644 misc/udev-qubes-misc.rules $RPM_BUILD_ROOT/etc/udev/rules.d/50-qubes-misc.rules
  106. install -m 0644 misc/udev-qubes-block.rules $RPM_BUILD_ROOT/etc/udev/rules.d/99-qubes-block.rules
  107. install -m 0644 misc/udev-qubes-usb.rules $RPM_BUILD_ROOT/etc/udev/rules.d/99-qubes-usb.rules
  108. install -d $RPM_BUILD_ROOT/usr/lib/qubes/
  109. install misc/qubes-download-dom0-updates.sh $RPM_BUILD_ROOT/usr/lib/qubes/
  110. install misc/udev-block-* $RPM_BUILD_ROOT/usr/lib/qubes/
  111. install misc/udev-usb-* $RPM_BUILD_ROOT/usr/lib/qubes/
  112. install misc/vusb-ctl.py $RPM_BUILD_ROOT/usr/lib/qubes/
  113. install misc/qubes-trigger-sync-appmenus.sh $RPM_BUILD_ROOT/usr/lib/qubes/
  114. install -D -m 0644 misc/qubes-trigger-sync-appmenus.action $RPM_BUILD_ROOT/etc/yum/post-actions/qubes-trigger-sync-appmenus.action
  115. install -D misc/polkit-1-qubes-allow-all.pkla $RPM_BUILD_ROOT/etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla
  116. install -D misc/polkit-1-qubes-allow-all.rules $RPM_BUILD_ROOT/etc/polkit-1/rules.d/00-qubes-allow-all.rules
  117. mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes
  118. if [ -r misc/dispvm-dotfiles.%{dist}.tbz ]; then
  119. install misc/dispvm-dotfiles.%{dist}.tbz $RPM_BUILD_ROOT/etc/dispvm-dotfiles.tbz
  120. else
  121. install misc/dispvm-dotfiles.tbz $RPM_BUILD_ROOT/etc/dispvm-dotfiles.tbz
  122. fi
  123. install misc/dispvm-prerun.sh $RPM_BUILD_ROOT/usr/lib/qubes/dispvm-prerun.sh
  124. install -D misc/qubes-core.modules $RPM_BUILD_ROOT/etc/sysconfig/modules/qubes-core.modules
  125. install -D misc/qubes-misc.modules $RPM_BUILD_ROOT/etc/sysconfig/modules/qubes-misc.modules
  126. install -m 0644 network/udev-qubes-network.rules $RPM_BUILD_ROOT/etc/udev/rules.d/99-qubes-network.rules
  127. install network/qubes-setup-dnat-to-ns $RPM_BUILD_ROOT/usr/lib/qubes
  128. install network/qubes-fix-nm-conf.sh $RPM_BUILD_ROOT/usr/lib/qubes
  129. install network/setup-ip $RPM_BUILD_ROOT/usr/lib/qubes/
  130. install network/network-manager-prepare-conf-dir $RPM_BUILD_ROOT/usr/lib/qubes/
  131. install -d $RPM_BUILD_ROOT/etc/dhclient.d
  132. ln -s /usr/lib/qubes/qubes-setup-dnat-to-ns $RPM_BUILD_ROOT/etc/dhclient.d/qubes-setup-dnat-to-ns.sh
  133. install -d $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/
  134. install network/{qubes-nmhook,30-qubes-external-ip} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/
  135. install -D network/vif-route-qubes $RPM_BUILD_ROOT/etc/xen/scripts/vif-route-qubes
  136. install -m 0400 -D network/iptables $RPM_BUILD_ROOT/etc/sysconfig/iptables
  137. install -m 0400 -D network/ip6tables $RPM_BUILD_ROOT/etc/sysconfig/ip6tables
  138. install -m 0644 -D network/tinyproxy-qubes-yum.conf $RPM_BUILD_ROOT/etc/tinyproxy/tinyproxy-qubes-yum.conf
  139. install -m 0644 -D network/filter-qubes-yum $RPM_BUILD_ROOT/etc/tinyproxy/filter-qubes-yum
  140. install -d $RPM_BUILD_ROOT/etc/yum.conf.d
  141. touch $RPM_BUILD_ROOT/etc/yum.conf.d/qubes-proxy.conf
  142. install -d $RPM_BUILD_ROOT/usr/sbin
  143. install network/qubes-firewall $RPM_BUILD_ROOT/usr/sbin/
  144. install network/qubes-netwatcher $RPM_BUILD_ROOT/usr/sbin/
  145. install -d $RPM_BUILD_ROOT/usr/bin
  146. install qubes-rpc/{qvm-open-in-dvm,qvm-open-in-vm,qvm-copy-to-vm,qvm-run,qvm-mru-entry} $RPM_BUILD_ROOT/usr/bin
  147. install qubes-rpc/wrap-in-html-if-url.sh $RPM_BUILD_ROOT/usr/lib/qubes
  148. install qubes-rpc/qvm-copy-to-vm.kde $RPM_BUILD_ROOT/usr/lib/qubes
  149. install qubes-rpc/qvm-copy-to-vm.gnome $RPM_BUILD_ROOT/usr/lib/qubes
  150. install qubes-rpc/{vm-file-editor,qfile-agent,qopen-in-vm,qfile-unpacker} $RPM_BUILD_ROOT/usr/lib/qubes
  151. install qubes-rpc/qrun-in-vm $RPM_BUILD_ROOT/usr/lib/qubes
  152. install qubes-rpc/sync-ntp-clock $RPM_BUILD_ROOT/usr/lib/qubes
  153. install qubes-rpc/prepare-suspend $RPM_BUILD_ROOT/usr/lib/qubes
  154. install -d $RPM_BUILD_ROOT/%{kde_service_dir}
  155. install -m 0644 qubes-rpc/{qvm-copy.desktop,qvm-dvm.desktop} $RPM_BUILD_ROOT/%{kde_service_dir}
  156. install -d $RPM_BUILD_ROOT/etc/qubes-rpc
  157. install -m 0644 qubes-rpc/{qubes.Filecopy,qubes.OpenInVM,qubes.VMShell,qubes.SyncNtpClock} $RPM_BUILD_ROOT/etc/qubes-rpc
  158. install -m 0644 qubes-rpc/{qubes.SuspendPre,qubes.SuspendPost,qubes.GetAppmenus} $RPM_BUILD_ROOT/etc/qubes-rpc
  159. install -m 0644 qubes-rpc/qubes.WaitForSession $RPM_BUILD_ROOT/etc/qubes-rpc
  160. install -d $RPM_BUILD_ROOT/usr/share/file-manager/actions
  161. install -m 0644 qubes-rpc/*-gnome.desktop $RPM_BUILD_ROOT/usr/share/file-manager/actions
  162. install -D misc/nautilus-actions.conf $RPM_BUILD_ROOT/etc/xdg/nautilus-actions/nautilus-actions.conf
  163. install misc/meminfo-writer $RPM_BUILD_ROOT/usr/lib/qubes
  164. install -d $RPM_BUILD_ROOT/mnt/removable
  165. install -d $RPM_BUILD_ROOT/var/lib/qubes/dom0-updates
  166. install -D -m 0644 misc/xorg-preload-apps.conf $RPM_BUILD_ROOT/etc/X11/xorg-preload-apps.conf
  167. install -d $RPM_BUILD_ROOT/var/run/qubes
  168. install -d $RPM_BUILD_ROOT/home_volatile/user
  169. %triggerin -- initscripts
  170. cp /usr/lib/qubes/serial.conf /etc/init/serial.conf
  171. %post
  172. # disable some Upstart services
  173. for F in plymouth-shutdown prefdm splash-manager start-ttys tty ; do
  174. if [ -e /etc/init/$F.conf ]; then
  175. mv -f /etc/init/$F.conf /etc/init/$F.conf.disabled
  176. fi
  177. done
  178. remove_ShowIn () {
  179. if [ -e /etc/xdg/autostart/$1.desktop ]; then
  180. sed -i '/^\(Not\|Only\)ShowIn/d' /etc/xdg/autostart/$1.desktop
  181. fi
  182. }
  183. # don't want it at all
  184. for F in abrt-applet deja-dup-monitor imsettings-start krb5-auth-dialog pulseaudio restorecond sealertauto gnome-power-manager gnome-sound-applet gnome-screensaver orca-autostart; do
  185. if [ -e /etc/xdg/autostart/$F.desktop ]; then
  186. remove_ShowIn $F
  187. echo 'NotShowIn=QUBES;' >> /etc/xdg/autostart/$F.desktop
  188. fi
  189. done
  190. # don't want it in DisposableVM
  191. for F in gcm-apply ; do
  192. if [ -e /etc/xdg/autostart/$F.desktop ]; then
  193. remove_ShowIn $F
  194. echo 'NotShowIn=DisposableVM;' >> /etc/xdg/autostart/$F.desktop
  195. fi
  196. done
  197. # want it in AppVM only
  198. for F in gnome-keyring-gpg gnome-keyring-pkcs11 gnome-keyring-secrets gnome-keyring-ssh gnome-settings-daemon user-dirs-update-gtk gsettings-data-convert ; do
  199. if [ -e /etc/xdg/autostart/$F.desktop ]; then
  200. remove_ShowIn $F
  201. echo 'OnlyShowIn=GNOME;AppVM;' >> /etc/xdg/autostart/$F.desktop
  202. fi
  203. done
  204. # remove existing rule to add own later
  205. for F in gpk-update-icon nm-applet ; do
  206. remove_ShowIn $F
  207. done
  208. echo 'OnlyShowIn=GNOME;UpdateableVM;' >> /etc/xdg/autostart/gpk-update-icon.desktop || :
  209. echo 'OnlyShowIn=GNOME;NetVM;' >> /etc/xdg/autostart/nm-applet.desktop || :
  210. usermod -p '' root
  211. usermod -L user
  212. # Create NetworkManager configuration if we do not have it
  213. if ! [ -e /etc/NetworkManager/NetworkManager.conf ]; then
  214. echo '[main]' > /etc/NetworkManager/NetworkManager.conf
  215. echo 'plugins = keyfile' >> /etc/NetworkManager/NetworkManager.conf
  216. echo '[keyfile]' >> /etc/NetworkManager/NetworkManager.conf
  217. fi
  218. /usr/lib/qubes/qubes-fix-nm-conf.sh
  219. # Remove ip_forward setting from sysctl, so NM will not reset it
  220. sed 's/^net.ipv4.ip_forward.*/#\0/' -i /etc/sysctl.conf
  221. # Install firmware link only on system which haven't it yet
  222. if ! [ -e /lib/firmware/updates ]; then
  223. ln -s /lib/modules/firmware /lib/firmware/updates
  224. fi
  225. if ! grep -q '/etc/yum\.conf\.d/qubes-proxy\.conf' /etc/yum.conf; then
  226. echo >> /etc/yum.conf
  227. echo '# Yum does not support inclusion of config dir...' >> /etc/yum.conf
  228. echo 'include=file:///etc/yum.conf.d/qubes-proxy.conf' >> /etc/yum.conf
  229. fi
  230. # Revert 'Prevent unnecessary updates in VMs':
  231. sed -i -e '/^exclude = kernel/d' /etc/yum.conf
  232. # qubes-core-vm has been broken for some time - it overrides /etc/hosts; restore original content
  233. if ! grep -q localhost /etc/hosts; then
  234. cat <<EOF > /etc/hosts
  235. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 `hostname`
  236. ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
  237. EOF
  238. fi
  239. if [ "$1" != 1 ] ; then
  240. # do the rest of %post thing only when updating for the first time...
  241. exit 0
  242. fi
  243. if [ -e /etc/init/serial.conf ] && ! [ -f /var/lib/qubes/serial.orig ] ; then
  244. cp /etc/init/serial.conf /var/lib/qubes/serial.orig
  245. fi
  246. #echo "--> Disabling SELinux..."
  247. sed -e s/^SELINUX=.*$/SELINUX=disabled/ </etc/selinux/config >/etc/selinux/config.processed
  248. mv /etc/selinux/config.processed /etc/selinux/config
  249. setenforce 0 2>/dev/null
  250. # Remove most of the udev scripts to speed up the VM boot time
  251. # Just leave the xen* scripts, that are needed if this VM was
  252. # ever used as a net backend (e.g. as a VPN domain in the future)
  253. #echo "--> Removing unnecessary udev scripts..."
  254. mkdir -p /var/lib/qubes/removed-udev-scripts
  255. for f in /etc/udev/rules.d/*
  256. do
  257. if [ $(basename $f) == "xen-backend.rules" ] ; then
  258. continue
  259. fi
  260. if [ $(basename $f) == "50-qubes-misc.rules" ] ; then
  261. continue
  262. fi
  263. if [ $(basename $f) == "99-qubes-network.rules" ] ; then
  264. continue
  265. fi
  266. if [ $(basename $f) == "99-qubes-block.rules" ] ; then
  267. continue
  268. fi
  269. if [ $(basename $f) == "99-qubes-usb.rules" ] ; then
  270. continue
  271. fi
  272. mv $f /var/lib/qubes/removed-udev-scripts/
  273. done
  274. mkdir -p /rw
  275. #rm -f /etc/mtab
  276. #echo "--> Removing HWADDR setting from /etc/sysconfig/network-scripts/ifcfg-eth0"
  277. #mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.orig
  278. #grep -v HWADDR /etc/sysconfig/network-scripts/ifcfg-eth0.orig > /etc/sysconfig/network-scripts/ifcfg-eth0
  279. %preun
  280. if [ "$1" = 0 ] ; then
  281. # no more packages left
  282. if [ -e /var/lib/qubes/fstab.orig ] ; then
  283. mv /var/lib/qubes/fstab.orig /etc/fstab
  284. fi
  285. mv /var/lib/qubes/removed-udev-scripts/* /etc/udev/rules.d/
  286. if [ -e /var/lib/qubes/serial.orig ] ; then
  287. mv /var/lib/qubes/serial.orig /etc/init/serial.conf
  288. fi
  289. fi
  290. %postun
  291. if [ $1 -eq 0 ] ; then
  292. /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
  293. if [ -l /lib/firmware/updates ]; then
  294. rm /lib/firmware/updates
  295. fi
  296. fi
  297. %posttrans
  298. /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
  299. %clean
  300. rm -rf $RPM_BUILD_ROOT
  301. rm -f %{name}-%{version}
  302. %files
  303. %defattr(-,root,root,-)
  304. %dir /var/lib/qubes
  305. %dir /var/run/qubes
  306. %dir %attr(0775,user,user) /var/lib/qubes/dom0-updates
  307. %{kde_service_dir}/qvm-copy.desktop
  308. %{kde_service_dir}/qvm-dvm.desktop
  309. /etc/NetworkManager/dispatcher.d/30-qubes-external-ip
  310. /etc/NetworkManager/dispatcher.d/qubes-nmhook
  311. /etc/X11/xorg-preload-apps.conf
  312. /etc/dispvm-dotfiles.tbz
  313. /etc/dhclient.d/qubes-setup-dnat-to-ns.sh
  314. /etc/fstab
  315. /etc/pki/rpm-gpg/RPM-GPG-KEY-qubes*
  316. /etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla
  317. /etc/polkit-1/rules.d/00-qubes-allow-all.rules
  318. /etc/qubes-rpc/qubes.Filecopy
  319. /etc/qubes-rpc/qubes.OpenInVM
  320. /etc/qubes-rpc/qubes.GetAppmenus
  321. /etc/qubes-rpc/qubes.VMShell
  322. /etc/qubes-rpc/qubes.SyncNtpClock
  323. /etc/qubes-rpc/qubes.SuspendPre
  324. /etc/qubes-rpc/qubes.SuspendPost
  325. /etc/qubes-rpc/qubes.WaitForSession
  326. /etc/sudoers.d/qubes
  327. %config(noreplace) /etc/sysconfig/iptables
  328. %config(noreplace) /etc/sysconfig/ip6tables
  329. /etc/sysconfig/modules/qubes-core.modules
  330. /etc/sysconfig/modules/qubes-misc.modules
  331. %config(noreplace) /etc/tinyproxy/filter-qubes-yum
  332. %config(noreplace) /etc/tinyproxy/tinyproxy-qubes-yum.conf
  333. /etc/udev/rules.d/50-qubes-misc.rules
  334. /etc/udev/rules.d/99-qubes-block.rules
  335. /etc/udev/rules.d/99-qubes-network.rules
  336. /etc/udev/rules.d/99-qubes-usb.rules
  337. /etc/xdg/nautilus-actions/nautilus-actions.conf
  338. /etc/xen/scripts/vif-route-qubes
  339. %config(noreplace) /etc/yum.conf.d/qubes-proxy.conf
  340. %config(noreplace) /etc/yum.repos.d/qubes.repo
  341. /etc/yum/pluginconf.d/yum-qubes-hooks.conf
  342. /etc/yum/post-actions/qubes-trigger-sync-appmenus.action
  343. /sbin/qubes-serial-login
  344. /usr/bin/qvm-copy-to-vm
  345. /usr/bin/qvm-open-in-dvm
  346. /usr/bin/qvm-open-in-vm
  347. /usr/bin/qvm-run
  348. /usr/bin/qvm-mru-entry
  349. /usr/bin/xenstore-watch-qubes
  350. %dir /usr/lib/qubes
  351. /usr/lib/qubes/udev-block-add-change
  352. /usr/lib/qubes/udev-block-cleanup
  353. /usr/lib/qubes/udev-block-remove
  354. /usr/lib/qubes/udev-usb-add-change
  355. /usr/lib/qubes/udev-usb-remove
  356. /usr/lib/qubes/vusb-ctl.py*
  357. /usr/lib/qubes/dispvm-prerun.sh
  358. /usr/lib/qubes/sync-ntp-clock
  359. /usr/lib/qubes/prepare-suspend
  360. /usr/lib/qubes/meminfo-writer
  361. /usr/lib/qubes/network-manager-prepare-conf-dir
  362. /usr/lib/qubes/qfile-agent
  363. %attr(4755,root,root) /usr/lib/qubes/qfile-unpacker
  364. /usr/lib/qubes/qopen-in-vm
  365. /usr/lib/qubes/qrun-in-vm
  366. /usr/lib/qubes/qubes-download-dom0-updates.sh
  367. /usr/lib/qubes/qubes-fix-nm-conf.sh
  368. /usr/lib/qubes/qubes-setup-dnat-to-ns
  369. /usr/lib/qubes/qubes-trigger-sync-appmenus.sh
  370. /usr/lib/qubes/qvm-copy-to-vm.gnome
  371. /usr/lib/qubes/qvm-copy-to-vm.kde
  372. /usr/lib/qubes/serial.conf
  373. /usr/lib/qubes/setup-ip
  374. /usr/lib/qubes/vm-file-editor
  375. /usr/lib/qubes/wrap-in-html-if-url.sh
  376. /usr/lib/yum-plugins/yum-qubes-hooks.py*
  377. /usr/sbin/qubes-firewall
  378. /usr/sbin/qubes-netwatcher
  379. /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override
  380. /usr/share/file-manager/actions/qvm-copy-gnome.desktop
  381. /usr/share/file-manager/actions/qvm-dvm-gnome.desktop
  382. %dir /home_volatile
  383. %attr(700,user,user) /home_volatile/user
  384. %dir /mnt/removable
  385. %package sysvinit
  386. Summary: Qubes unit files for SysV init style or upstart
  387. License: GPL v2 only
  388. Group: Qubes
  389. Requires: upstart
  390. Requires: qubes-core-vm
  391. Provides: qubes-core-vm-init-scripts
  392. Conflicts: qubes-core-vm-systemd
  393. %description sysvinit
  394. The Qubes core startup configuration for SysV init (or upstart).
  395. %files sysvinit
  396. /etc/init.d/qubes-core
  397. /etc/init.d/qubes-core-appvm
  398. /etc/init.d/qubes-core-netvm
  399. /etc/init.d/qubes-firewall
  400. /etc/init.d/qubes-netwatcher
  401. /etc/init.d/qubes-yum-proxy
  402. %post sysvinit
  403. #echo "--> Turning off unnecessary services..."
  404. # FIXME: perhaps there is more elegant way to do this?
  405. for f in /etc/init.d/*
  406. do
  407. srv=`basename $f`
  408. [ $srv = 'functions' ] && continue
  409. [ $srv = 'killall' ] && continue
  410. [ $srv = 'halt' ] && continue
  411. [ $srv = 'single' ] && continue
  412. [ $srv = 'reboot' ] && continue
  413. [ $srv = 'qubes-gui' ] && continue
  414. chkconfig $srv off
  415. done
  416. #echo "--> Enabling essential services..."
  417. chkconfig rsyslog on
  418. chkconfig haldaemon on
  419. chkconfig messagebus on
  420. chkconfig iptables on
  421. chkconfig ip6tables on
  422. chkconfig --add qubes-core || echo "WARNING: Cannot add service qubes-core!"
  423. chkconfig qubes-core on || echo "WARNING: Cannot enable service qubes-core!"
  424. chkconfig --add qubes-core-netvm || echo "WARNING: Cannot add service qubes-core-netvm!"
  425. chkconfig qubes-core-netvm on || echo "WARNING: Cannot enable service qubes-core-netvm!"
  426. chkconfig --add qubes-core-appvm || echo "WARNING: Cannot add service qubes-core-appvm!"
  427. chkconfig qubes-core-appvm on || echo "WARNING: Cannot enable service qubes-core-appvm!"
  428. chkconfig --add qubes-firewall || echo "WARNING: Cannot add service qubes-firewall!"
  429. chkconfig qubes-firewall on || echo "WARNING: Cannot enable service qubes-firewall!"
  430. chkconfig --add qubes-netwatcher || echo "WARNING: Cannot add service qubes-netwatcher!"
  431. chkconfig qubes-netwatcher on || echo "WARNING: Cannot enable service qubes-netwatcher!"
  432. chkconfig --add qubes-yum-proxy || echo "WARNING: Cannot add service qubes-yum-proxy!"
  433. chkconfig qubes-yum-proxy on || echo "WARNING: Cannot enable service qubes-yum-proxy!"
  434. # TODO: make this not display the silly message about security context...
  435. sed -i s/^id:.:initdefault:/id:3:initdefault:/ /etc/inittab
  436. %preun sysvinit
  437. if [ "$1" = 0 ] ; then
  438. # no more packages left
  439. chkconfig qubes-core off
  440. chkconfig qubes-core-netvm off
  441. chkconfig qubes-core-appvm off
  442. chkconfig qubes-firewall off
  443. chkconfig qubes-netwatcher off
  444. chkconfig qubes-yum-proxy off
  445. fi
  446. %package systemd
  447. Summary: Qubes unit files for SystemD init style
  448. License: GPL v2 only
  449. Group: Qubes
  450. Requires: systemd
  451. Requires(post): systemd-units
  452. Requires(preun): systemd-units
  453. Requires(postun): systemd-units
  454. Requires: qubes-core-vm
  455. Provides: qubes-core-vm-init-scripts
  456. Conflicts: qubes-core-vm-sysvinit
  457. %description systemd
  458. The Qubes core startup configuration for SystemD init.
  459. %files systemd
  460. %defattr(-,root,root,-)
  461. /lib/systemd/system/qubes-dvm.service
  462. /lib/systemd/system/qubes-meminfo-writer.service
  463. /lib/systemd/system/qubes-misc-post.service
  464. /lib/systemd/system/qubes-firewall.service
  465. /lib/systemd/system/qubes-netwatcher.service
  466. /lib/systemd/system/qubes-network.service
  467. /lib/systemd/system/qubes-sysinit.service
  468. /lib/systemd/system/qubes-update-check.service
  469. /lib/systemd/system/qubes-update-check.timer
  470. /lib/systemd/system/qubes-yum-proxy.service
  471. %dir /usr/lib/qubes/init
  472. /usr/lib/qubes/init/prepare-dvm.sh
  473. /usr/lib/qubes/init/network-proxy-setup.sh
  474. /usr/lib/qubes/init/misc-post.sh
  475. /usr/lib/qubes/init/misc-post-stop.sh
  476. /usr/lib/qubes/init/qubes-sysinit.sh
  477. /usr/lib/qubes/init/NetworkManager.service
  478. /usr/lib/qubes/init/NetworkManager-wait-online.service
  479. /usr/lib/qubes/init/cups.service
  480. /usr/lib/qubes/init/ntpd.service
  481. %ghost %attr(0644,root,root) /etc/systemd/system/NetworkManager.service
  482. %ghost %attr(0644,root,root) /etc/systemd/system/NetworkManager-wait-online.service
  483. %ghost %attr(0644,root,root) /etc/systemd/system/cups.service
  484. %post systemd
  485. for srv in qubes-dvm qubes-meminfo-writer qubes-sysinit qubes-misc-post qubes-netwatcher qubes-network qubes-firewall qubes-yum-proxy; do
  486. /bin/systemctl enable $srv.service 2> /dev/null
  487. done
  488. /bin/systemctl enable qubes-update-check.timer 2> /dev/null
  489. # Install overriden services only when original exists
  490. for srv in cups NetworkManager NetworkManager-wait-online ntpd; do
  491. if [ -f /lib/systemd/system/$srv.service ]; then
  492. cp /usr/lib/qubes/init/$srv.service /etc/systemd/system/$srv.service
  493. fi
  494. done
  495. # Set default "runlevel"
  496. rm -f /etc/systemd/system/default.target
  497. ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
  498. DISABLE_SERVICES="alsa-store alsa-restore auditd avahi avahi-daemon backuppc cpuspeed crond"
  499. DISABLE_SERVICES="$DISABLE_SERVICES fedora-autorelabel fedora-autorelabel-mark ipmi hwclock-load hwclock-save"
  500. DISABLE_SERVICES="$DISABLE_SERVICES mdmonitor multipathd openct rpcbind mcelog fedora-storage-init fedora-storage-init-late"
  501. DISABLE_SERVICES="$DISABLE_SERVICES plymouth-start plymouth-read-write plymouth-quit plymouth-quit-wait"
  502. DISABLE_SERVICES="$DISABLE_SERVICES sshd tcsd sm-client sendmail mdmonitor-takeover"
  503. for srv in $DISABLE_SERVICES; do
  504. if [ -f /lib/systemd/system/$srv.service ]; then
  505. if fgrep -q '[Install]' /lib/systemd/system/$srv.service; then
  506. /bin/systemctl disable $srv.service 2> /dev/null
  507. else
  508. # forcibly disable
  509. ln -sf /dev/null /etc/systemd/system/$srv.service
  510. fi
  511. fi
  512. done
  513. rm -f /etc/systemd/system/getty.target.wants/getty@tty*.service
  514. # Enable some services
  515. /bin/systemctl enable iptables.service 2> /dev/null
  516. /bin/systemctl enable ip6tables.service 2> /dev/null
  517. /bin/systemctl enable rsyslog.service 2> /dev/null
  518. /bin/systemctl enable ntpd.service 2> /dev/null
  519. # Disable original service to enable overriden one
  520. /bin/systemctl disable NetworkManager.service 2> /dev/null
  521. # Disable D-BUS activation of NetworkManager - in AppVm it causes problems (eg PackageKit timeouts)
  522. /bin/systemctl mask dbus-org.freedesktop.NetworkManager.service 2> /dev/null
  523. /bin/systemctl enable NetworkManager.service 2> /dev/null
  524. # Enable cups only when it is real SystemD service
  525. [ -e /lib/systemd/system/cups.service ] && /bin/systemctl enable cups.service 2> /dev/null
  526. exit 0
  527. %postun systemd
  528. #Do not run this part on upgrades
  529. if [ "$1" != 0 ] ; then
  530. exit 0
  531. fi
  532. for srv in qubes-dvm qubes-meminfo-writer qubes-sysinit qubes-misc-post qubes-netwatcher qubes-network; do
  533. /bin/systemctl disable $srv.service
  534. do