config.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 library is free software; you can redistribute it and/or
  8. # modify it under the terms of the GNU Lesser General Public
  9. # License as published by the Free Software Foundation; either
  10. # version 2.1 of the License, or (at your option) any later version.
  11. #
  12. # This library 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 GNU
  15. # Lesser General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Lesser General Public
  18. # License along with this library; if not, see <https://www.gnu.org/licenses/>.
  19. #
  20. #
  21. # THIS FILE SHOULD BE CONFIGURED PER PRODUCT
  22. # or better, once first custom product arrives,
  23. # make a real /etc/qubes/master.conf or whatever
  24. #
  25. '''Constants which can be configured in one place'''
  26. import os.path
  27. qubes_base_dir = "/var/lib/qubes"
  28. system_path = {
  29. 'qubes_guid_path': '/usr/bin/qubes-guid',
  30. 'qrexec_daemon_path': '/usr/sbin/qrexec-daemon',
  31. 'qrexec_client_path': '/usr/bin/qrexec-client',
  32. 'qrexec_rpc_multiplexer': '/usr/lib/qubes/qubes-rpc-multiplexer',
  33. 'qubesdb_daemon_path': '/usr/sbin/qubesdb-daemon',
  34. # Relative to qubes_base_dir
  35. 'qubes_appvms_dir': 'appvms',
  36. 'qubes_templates_dir': 'vm-templates',
  37. 'qubes_servicevms_dir': 'servicevms',
  38. 'qubes_store_filename': 'qubes.xml',
  39. 'qubes_kernels_base_dir': 'vm-kernels',
  40. # qubes_icon_dir is obsolete
  41. # use QIcon.fromTheme() where applicable
  42. 'qubes_icon_dir': '/usr/share/icons/hicolor/128x128/devices',
  43. 'qrexec_policy_dir': '/etc/qubes-rpc/policy',
  44. 'config_template_pv': '/usr/share/qubes/vm-template.xml',
  45. }
  46. vm_files = {
  47. 'root_img': 'root.img',
  48. 'rootcow_img': 'root-cow.img',
  49. 'volatile_img': 'volatile.img',
  50. 'clean_volatile_img': 'clean-volatile.img.tar',
  51. 'private_img': 'private.img',
  52. 'kernels_subdir': 'kernels',
  53. 'firewall_conf': 'firewall.xml',
  54. 'whitelisted_appmenus': 'whitelisted-appmenus.list',
  55. 'updates_stat_file': 'updates.stat',
  56. }
  57. defaults = {
  58. 'libvirt_uri': 'xen:///',
  59. 'memory': 400,
  60. 'hvm_memory': 400,
  61. 'kernelopts': "nopat",
  62. 'kernelopts_pcidevs': "nopat iommu=soft swiotlb=8192",
  63. 'kernelopts_common': ('root=/dev/mapper/dmroot ro nomodeset console=hvc0 '
  64. 'rd_NO_PLYMOUTH rd.plymouth.enable=0 plymouth.enable=0 '),
  65. 'dom0_update_check_interval': 6*3600,
  66. 'private_img_size': 2*1024*1024*1024,
  67. 'root_img_size': 10*1024*1024*1024,
  68. 'pool_configs': {
  69. # create file(-reflink) pool even when the default one is LVM
  70. 'varlibqubes': {'dir_path': qubes_base_dir,
  71. 'name': 'varlibqubes'},
  72. 'linux-kernel': {
  73. 'dir_path': os.path.join(qubes_base_dir,
  74. system_path['qubes_kernels_base_dir']),
  75. 'driver': 'linux-kernel',
  76. 'name': 'linux-kernel'
  77. }
  78. },
  79. # how long (in sec) to wait for VMs to shutdown,
  80. # before killing them (when used qvm-run with --wait option),
  81. 'shutdown_counter_max': 60,
  82. 'vm_default_netmask': "255.255.255.0",
  83. 'appvm_label': 'red',
  84. 'template_label': 'black',
  85. 'servicevm_label': 'red',
  86. }
  87. max_qid = 254
  88. max_dispid = 10000
  89. #: built-in standard labels, if creating new one, allocate them above this
  90. # number, at least until label index is removed from API
  91. max_default_label = 8
  92. #: profiles for admin.backup.* calls
  93. backup_profile_dir = '/etc/qubes/backup'
  94. #: site-local prefix for all VMs
  95. qubes_ipv6_prefix = 'fd09:24ef:4179:0000'