Merge branch 'sys-usb'

This commit is contained in:
unman 2021-02-02 04:45:51 +00:00
commit 0da0a45ffd
No known key found for this signature in database
GPG Key ID: FDD1B8244731B36C
6 changed files with 119 additions and 0 deletions

9
sys-usb/clone.sls Normal file
View File

@ -0,0 +1,9 @@
include:
- template-debian-10-minimal
qvm-clone-id:
qvm.clone:
- require:
- sls: template-debian-10-minimal
- name: template-sys-usb
- source: debian-10-minimal

4
sys-usb/clone.top Normal file
View File

@ -0,0 +1,4 @@
base:
dom0:
- match: nodegroup
- sys-usb.clone

72
sys-usb/create.sls Normal file
View File

@ -0,0 +1,72 @@
include:
- sys-usb.clone
remove:
qvm.absent:
- names:
- sys-usb
- sys-usb-dock
- sys-usb-left
- sys-usb-dvm
sys-usb-dvm:
qvm.present:
- name: sys-usb-dvm
- template: template-sys-usb
- label: red
qvm-prefs-id:
qvm.prefs:
- name: sys-usb-dvm
- netvm: none
- memory: 300
- vcpus: 2
- virt_mode: hvm
- autostart: False
- template_for_dispvms: True
- include_in_backups: false
{% set usbs = ['sys-usb','sys-usb-dock','sys-usb-left'] %}
{% for usb in usbs %}
{{usb}}:
qvm.present:
- name:
- {{usb}}
- template: sys-usb-dvm
- class: DispVM
- label: red
{{usb}}-prefs:
qvm.prefs:
- name: {{usb}}
- autostart: false
- include_in_backups: false
- pci_strictreset: False
{% if usb == 'sys-usb' %}
- pcidevs: [ '00:1a.0' ]
{% elif usb == 'sys-usb-left' %}
- pcidevs: [ '00:14.0' ]
{% elif usb == 'sys-usb-dock' %}
- pcidevs: [ '00:1d.0' ]
{% endif %}
{{usb}}-features:
qvm.features:
- name: {{usb}}
- disable:
- service.cups
- service.cups-browsed
- service.meminfo-writer
- service.cups-browsed
- service.qubes-updates-proxy
{% endfor%}
update_file:
file.prepend:
- names:
- /etc/qubes-rpc/policy/qubes.InputMouse
- /etc/qubes-rpc/policy/qubes.InputKeyboard
- text: sys-usb dom0 allow,user=root
- text: sys-usb-dock dom0 allow,user=root

4
sys-usb/create.top Normal file
View File

@ -0,0 +1,4 @@
base:
dom0:
- match: nodegroup
- sys-usb.create

25
sys-usb/install.sls Normal file
View File

@ -0,0 +1,25 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
/etc/apt/sources.list:
file.replace:
- pattern: 'https:'
- repl: 'http://HTTPS/'
- flags: [ 'IGNORECASE', 'MULTILINE' ]
/etc/apt/sources.list.d/qubes-r4.list:
file.replace:
- pattern: 'https:'
- repl: 'http://HTTPS/'
- flags: [ 'IGNORECASE', 'MULTILINE' ]
allow-testing:
file.uncomment:
- name: /etc/apt/sources.list.d/qubes-r4.list
- regex: ^deb\s.*qubes-os.org.*-testing
- backup: false
installed:
pkg.installed:
- pkgs:
- qubes-input-proxy-sender
- qubes-usb-proxy

5
sys-usb/install.top Normal file
View File

@ -0,0 +1,5 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
base:
template-sys-usb:
- sys-usb.install