Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to fedora-33 for sys-* VMs #695

Merged
merged 2 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ When developing on the Workstation, make sure to edit files in `sd-dev`, then co

The staging environment is intended to provide an experience closer to a production environment. For example, it will alter power management settings on your laptop to prevent suspending it to disk, and make other changes that may not be desired during day-to-day development in Qubes.

#### Update `dom0`, `fedora-32`, `whonix-gw-15` and `whonix-ws-15` templates
#### Update `dom0`, `fedora-33`, `whonix-gw-15` and `whonix-ws-15` templates

Updates to these VMs will be provided by the installer and updater, but to ensure they are up to date prior to install, it will be easier to debug, should something go wrong.

Expand Down
2 changes: 1 addition & 1 deletion dom0/sd-clean-all.sls
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set-fedora-as-default-dispvm:
cmd.run:
- name: qvm-check fedora-32-dvm && qubes-prefs default_dispvm fedora-32-dvm || qubes-prefs default_dispvm ''
- name: qvm-check fedora-33-dvm && qubes-prefs default_dispvm fedora-33-dvm || qubes-prefs default_dispvm ''

{% set gui_user = salt['cmd.shell']('groupmems -l -g qubes') %}

Expand Down
2 changes: 1 addition & 1 deletion dom0/sd-clean-default-dispvm.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

set-fedora-as-default-dispvm:
cmd.run:
- name: qvm-check fedora-32-dvm && qubes-prefs default_dispvm fedora-32-dvm || qubes-prefs default_dispvm ''
- name: qvm-check fedora-33-dvm && qubes-prefs default_dispvm fedora-33-dvm || qubes-prefs default_dispvm ''
17 changes: 15 additions & 2 deletions dom0/sd-sys-vms.sls
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,32 @@ include:
# DispVM is created
- qvm.default-dispvm

{% set sd_supported_fedora_version = 'fedora-32' %}
{% set sd_supported_fedora_version = 'fedora-33' %}

# Install latest templates required for SDW VMs.
dom0-install-fedora-template:
pkg.installed:
- pkgs:
- qubes-template-{{ sd_supported_fedora_version }}

# Update the mgmt VM before updating the new Fedora VM. The order is required
# and listed in the release notes for F32 & F33.
set-fedora-template-as-default-mgmt-dvm:
cmd.run:
- name: >
qvm-shutdown --wait default-mgmt-dvm &&
qvm-prefs default-mgmt-dvm template {{ sd_supported_fedora_version }}
- require:
- pkg: dom0-install-fedora-template

# If the VM has just been installed via package manager, update it immediately
update-fedora-template-if-new:
cmd.wait:
- name: sudo qubesctl --skip-dom0 --targets {{ sd_supported_fedora_version }} state.sls update.qubes-vm
- require:
- pkg: dom0-install-fedora-template
# Update the mgmt-dvm setting first, to avoid problems during first update
- cmd: set-fedora-template-as-default-mgmt-dvm
- watch:
- pkg: dom0-install-fedora-template
# qvm.default-dispvm is not strictly required here, but we want it to be
Expand All @@ -35,7 +47,8 @@ set-fedora-default-template-version:
- pkg: dom0-install-fedora-template
- sls: qvm.default-dispvm

{% for sys_vm in ['sys-usb', 'sys-net', 'sys-firewall', 'default-mgmt-dvm'] %}
# Now proceed with rebooting all the sys-* VMs, since the new template is up to date.
{% for sys_vm in ['sys-usb', 'sys-net', 'sys-firewall'] %}
{% if salt['cmd.shell']('qvm-prefs '+sys_vm+' template') != sd_supported_fedora_version %}
sd-{{ sys_vm }}-fedora-version-halt:
qvm.kill:
Expand Down
2 changes: 1 addition & 1 deletion launcher/sdw_updater_gui/Updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# as well as their associated TemplateVMs.
# In the future, we could use qvm-prefs to extract this information.
current_vms = {
"fedora": "fedora-32",
"fedora": "fedora-33",
"sd-viewer": "sd-large-buster-template",
"sd-app": "sd-small-buster-template",
"sd-log": "sd-small-buster-template",
Expand Down
4 changes: 2 additions & 2 deletions launcher/tests/test_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def test_shutdown_and_start_vms(
call("sys-usb"),
]
template_vm_calls = [
call("fedora-32"),
call("fedora-33"),
call("sd-large-buster-template"),
call("sd-small-buster-template"),
call("whonix-gw-15"),
Expand Down Expand Up @@ -548,7 +548,7 @@ def test_shutdown_and_start_vms_sysvm_fail(
call("sd-log"),
]
template_vm_calls = [
call("fedora-32"),
call("fedora-33"),
call("sd-large-buster-template"),
call("sd-small-buster-template"),
call("whonix-gw-15"),
Expand Down
6 changes: 3 additions & 3 deletions scripts/build-dom0-rpm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# Builds RPMs for installation in dom0. RPMs are fully reproducible.
# Targets F25 & F32 for Qubes 4.0 and 4.1 support.
# Targets fedora-25 & fedora-32 for Qubes 4.0 and 4.1 support.
set -e
set -u
set -o pipefail
Expand Down Expand Up @@ -28,9 +28,9 @@ export SOURCE_DATE_EPOCH
cp dist/*.tar.gz rpm-build/SOURCES/

# Build for Qubes 4.0.x and 4.1.x, for which dom0 is based on
# F25 and F32, respectively.
# fedora-25 and fedora-32, respectively.
for i in 25 32; do
# dom0 defaults to python3.5 in F25
# dom0 defaults to python3.5 in fedora-25
python_version="python3.5"
if [[ $i = 32 ]]; then
python_version="python3.8"
Expand Down
2 changes: 1 addition & 1 deletion scripts/prep-dev
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dom0_dev_dir="$HOME/securedrop-workstation"

function find_latest_rpm() {
# Look up which version of dom0 we're using.
# Qubes 4.0 is fc25, Qubes 4.1 will be fc32.
# Qubes 4.0 is fedora-25, Qubes 4.1 will be fedora-32.
fedora_version="$(rpm --eval '%{fedora}')"
find "${dom0_dev_dir}/rpm-build/RPMS/" -type f -iname "*fc${fedora_version}.noarch.rpm" -print0 | xargs -0 ls -t | head -n 1
}
Expand Down
2 changes: 1 addition & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Reusable constant for DRY import across tests
WANTED_VMS = ["sd-gpg", "sd-log", "sd-proxy", "sd-app", "sd-viewer", "sd-whonix", "sd-devices"]
CURRENT_FEDORA_VERSION = "32"
CURRENT_FEDORA_VERSION = "33"
CURRENT_FEDORA_TEMPLATE = "fedora-" + CURRENT_FEDORA_VERSION
CURRENT_WHONIX_VERSION = "15"

Expand Down