From c03fbecb4eb017ac2ddd98e500dddd5b9aa1cda1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 2 Nov 2018 02:28:58 +0100 Subject: [PATCH] dom0-updates: use qvm-service for disabling dom0 updates check Use the same mechanism as VMs - first it's compatible with Admin API (in contrary to flag files); second it ease handling it. Migrate old setting on package upgrade. --- dom0-updates/qubes-dom0-updates.cron | 4 +--- rpm_spec/core-dom0-linux.spec.in | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dom0-updates/qubes-dom0-updates.cron b/dom0-updates/qubes-dom0-updates.cron index 4871e35..e074740 100755 --- a/dom0-updates/qubes-dom0-updates.cron +++ b/dom0-updates/qubes-dom0-updates.cron @@ -1,8 +1,6 @@ #!/bin/bash -UPDATES_DISABLE_FLAG=/var/lib/qubes/updates/disable-updates - -if [ -f "$UPDATES_DISABLE_FLAG" ]; then +if [ "$(qvm-features dom0 service.qubes-update-check || echo 1)" != 1 ]; then exit 0 fi diff --git a/rpm_spec/core-dom0-linux.spec.in b/rpm_spec/core-dom0-linux.spec.in index 7d4769f..1885fb7 100644 --- a/rpm_spec/core-dom0-linux.spec.in +++ b/rpm_spec/core-dom0-linux.spec.in @@ -165,6 +165,14 @@ fi systemctl enable qubes-suspend.service >/dev/null 2>&1 +# migrate dom0-updates check disable flag +if [ $1 -ge 2 ]; then + if [ -e /var/lib/qubes/updates/disable-updates ]; then + qvm-features dom0 service.qubes-update-check '' + rm -f /var/lib/qubes/updates/disable-updates + fi +fi + %preun if [ "$1" = 0 ] ; then # no more packages left