From 08747c33d0ff9f2e1c1b231d85fca9b37c316ae7 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Tue, 29 Sep 2026 12:43:05 -0400 Subject: [PATCH] standard: convert apply updates enablement to a preset The way it was done before with a symlink in /usr/lib/systemd/system/default.target.wants/bootc-fetch-apply-updates.timer meant that users (or derivative builds) can't easily disable this service without masking it. The docs at [1] would work for the current boot because of the `--now` but the next boot the timer would be running again. [1] https://forge.fedoraproject.org/atomic/docs/src/commit/e7d868de852681f887ed380658650a6bfef48f71/modules/ROOT/pages/manual-rollbacks.adoc --- standard/autoupdates.yaml | 8 -------- standard/manifest.yaml | 2 +- standard/systemd-presets.yaml | 14 ++++++++++++++ tests/rootfs/cases/bootc-fetch-apply-updates | 16 ++++++++++++++++ 4 files changed, 31 insertions(+), 9 deletions(-) delete mode 100644 standard/autoupdates.yaml create mode 100644 standard/systemd-presets.yaml create mode 100755 tests/rootfs/cases/bootc-fetch-apply-updates diff --git a/standard/autoupdates.yaml b/standard/autoupdates.yaml deleted file mode 100644 index 04b35f37..00000000 --- a/standard/autoupdates.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Enable automatic updates by default -postprocess: - - | - #!/usr/bin/env bash - set -xeuo pipefail - target=/usr/lib/systemd/system/default.target.wants - mkdir -p $target - ln -s ../bootc-fetch-apply-updates.timer $target diff --git a/standard/manifest.yaml b/standard/manifest.yaml index 3cea76cd..51820946 100644 --- a/standard/manifest.yaml +++ b/standard/manifest.yaml @@ -9,13 +9,13 @@ recommends: true include: - ../minimal-plus/manifest.yaml - - autoupdates.yaml - networking-tools.yaml - system-configuration.yaml - coreos-user-experience.yaml - persistent-journal.yaml - initramfs-full.yaml - generic-growfs.yaml + - systemd-presets.yaml packages: # Include and set the default editor diff --git a/standard/systemd-presets.yaml b/standard/systemd-presets.yaml new file mode 100644 index 00000000..6ab01ee0 --- /dev/null +++ b/standard/systemd-presets.yaml @@ -0,0 +1,14 @@ +# Postprocessing relating to systemd presets on the system. +# +# Note this relies on the `systemctl preset-all` run from +# minimal/systemd-presets.yaml running after this postprocess. +postprocess: + # Enable automatic updates by default + - | + #!/bin/bash + set -xeuo pipefail + # Enable automatic updates by default + cat < usr/lib/systemd/system-preset/86-bootc-standard.preset + # Enable automatic updates by default + enable bootc-fetch-apply-updates.timer + EOF diff --git a/tests/rootfs/cases/bootc-fetch-apply-updates b/tests/rootfs/cases/bootc-fetch-apply-updates new file mode 100755 index 00000000..0cf8882c --- /dev/null +++ b/tests/rootfs/cases/bootc-fetch-apply-updates @@ -0,0 +1,16 @@ +#!/bin/bash +set -xeuo pipefail + +# Right now the `systemctl preset-all` runs via a postprocess in +# minimal/systemd-presets.yaml but the preset for the timer is only +# set up in a postprocess in standard/systemd-presets.yaml. +# +# This test ensures that the ordering works out such that the preset +# from standard got applied. +# +# Verify if the preset file exists (only on standard) that the timer +# is enabled. Right now the `s +if [ -f /usr/lib/systemd/system-preset/86-bootc-standard.preset ]; then + # Will return success (0) if enabled or failure (1) if not + systemctl is-enabled bootc-fetch-apply-updates.timer +fi