From f8e3840fd6e8df241face04cb7a6ed08afcc76db Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Sat, 22 Jan 2022 14:23:05 +0100
Subject: [PATCH] fix(system-upgrades): Workaround potential script failures

Currently various scriptlets fail as part of `dnf upgrade -y` due to
SELinux transitions conflicting with `spc_t`. Which also prevented a
proper kernel update.

Therefore this solution just triggers the right systemd job, that should
take care of the update, before checking if we need to reboot the
machine.

References:
https://danwalsh.livejournal.com/74754.html
---
 infrastructure/system-upgrades/fedora.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/infrastructure/system-upgrades/fedora.yaml b/infrastructure/system-upgrades/fedora.yaml
index bc18855c2..0dd065a08 100644
--- a/infrastructure/system-upgrades/fedora.yaml
+++ b/infrastructure/system-upgrades/fedora.yaml
@@ -10,8 +10,9 @@ stringData:
     #!/bin/sh
     set -e
     set -x
-    dnf install -y dnf-utils
-    dnf upgrade -y --best
+    dnf install -y dnf-automatic
+    systemctl enable --now dnf-automatic.timer
+    systemctl start --wait dnf-automatic-install.service
     if ! dnf needs-restarting --reboothint; then
       systemctl reboot
     fi
-- 
GitLab