mirror of
https://gitlab.com/fedora/bootc/base-images.git
synced 2026-11-03 03:26:11 +00:00
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] e7d868de85/modules/ROOT/pages/manual-rollbacks.adoc
This commit is contained in:
parent
bbea58e7db
commit
08747c33d0
4 changed files with 31 additions and 9 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
14
standard/systemd-presets.yaml
Normal file
14
standard/systemd-presets.yaml
Normal file
|
|
@ -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 <<EOF > usr/lib/systemd/system-preset/86-bootc-standard.preset
|
||||
# Enable automatic updates by default
|
||||
enable bootc-fetch-apply-updates.timer
|
||||
EOF
|
||||
16
tests/rootfs/cases/bootc-fetch-apply-updates
Executable file
16
tests/rootfs/cases/bootc-fetch-apply-updates
Executable file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue