config.py 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #
  2. # The Qubes OS Project, https://www.qubes-os.org/
  3. #
  4. # Copyright (C) 2010-2015 Joanna Rutkowska <joanna@invisiblethingslab.com>
  5. # Copyright (C) 2014-2015 Wojtek Porczyk <woju@invisiblethingslab.com>
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (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 along
  18. # with this program; if not, write to the Free Software Foundation, Inc.,
  19. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. #
  21. #
  22. # THIS FILE SHOULD BE CONFIGURED PER PRODUCT
  23. # or better, once first custom product arrives,
  24. # make a real /etc/qubes/master.conf or whatever
  25. #
  26. '''Constants which can be configured in one place'''
  27. import os.path
  28. qubes_base_dir = "/var/lib/qubes"
  29. system_path = {
  30. 'qubes_guid_path': '/usr/bin/qubes-guid',
  31. 'qrexec_daemon_path': '/usr/lib/qubes/qrexec-daemon',
  32. 'qrexec_client_path': '/usr/lib/qubes/qrexec-client',
  33. 'qubesdb_daemon_path': '/usr/sbin/qubesdb-daemon',
  34. 'qubes_base_dir': qubes_base_dir,
  35. # Relative to qubes_base_dir
  36. 'qubes_appvms_dir': 'appvms',
  37. 'qubes_templates_dir': 'vm-templates',
  38. 'qubes_servicevms_dir': 'servicevms',
  39. 'qubes_store_filename': 'qubes.xml',
  40. 'qubes_kernels_base_dir': 'vm-kernels',
  41. # qubes_icon_dir is obsolete
  42. # use QIcon.fromTheme() where applicable
  43. 'qubes_icon_dir': '/usr/share/icons/hicolor/128x128/devices',
  44. 'qrexec_policy_dir': '/etc/qubes-rpc/policy',
  45. 'config_template_pv': '/usr/share/qubes/vm-template.xml',
  46. 'qubes_pciback_cmd': '/usr/lib/qubes/unbind-pci-device.sh',
  47. 'prepare_volatile_img_cmd': '/usr/lib/qubes/prepare-volatile-img.sh',
  48. 'monitor_layout_notify_cmd': '/usr/bin/qubes-monitor-layout-notify',
  49. }
  50. vm_files = {
  51. 'root_img': 'root.img',
  52. 'rootcow_img': 'root-cow.img',
  53. 'volatile_img': 'volatile.img',
  54. 'clean_volatile_img': 'clean-volatile.img.tar',
  55. 'private_img': 'private.img',
  56. 'kernels_subdir': 'kernels',
  57. 'firewall_conf': 'firewall.xml',
  58. 'whitelisted_appmenus': 'whitelisted-appmenus.list',
  59. 'updates_stat_file': 'updates.stat',
  60. }
  61. defaults = {
  62. 'libvirt_uri': 'xen:///',
  63. 'memory': 400,
  64. 'hvm_memory': 512,
  65. 'kernelopts': "nopat",
  66. 'kernelopts_pcidevs': "nopat iommu=soft swiotlb=8192",
  67. 'dom0_update_check_interval': 6*3600,
  68. 'private_img_size': 2*1024*1024*1024,
  69. 'root_img_size': 10*1024*1024*1024,
  70. 'pool_configs': {
  71. # create file pool even when the default one is LVM
  72. 'varlibqubes': {'dir_path': qubes_base_dir,
  73. 'driver': 'file',
  74. 'name': 'varlibqubes'},
  75. 'linux-kernel': {
  76. 'dir_path': os.path.join(qubes_base_dir,
  77. system_path['qubes_kernels_base_dir']),
  78. 'driver': 'linux-kernel',
  79. 'name': 'linux-kernel'
  80. }
  81. },
  82. # how long (in sec) to wait for VMs to shutdown,
  83. # before killing them (when used qvm-run with --wait option),
  84. 'shutdown_counter_max': 60,
  85. 'vm_default_netmask': "255.255.255.0",
  86. 'appvm_label': 'red',
  87. 'template_label': 'black',
  88. 'servicevm_label': 'red',
  89. }
  90. max_qid = 254
  91. max_netid = 254
  92. max_dispid = 10000