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