From 559f52ee3f5993c8dc88b7ea57a62e56f62da636 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 1 Jul 2026 19:51:51 +0200 Subject: [PATCH] units: add unit that can auto-enables all suggested component/features if enabled it will plug itself before systemd-sysupdate-update.service and enable every component + feature that is suggested. --- man/rules/meson.build | 3 ++- man/systemd-sysupdate.xml | 7 +++++++ units/meson.build | 4 ++++ units/systemd-sysupdate-auto-enable.service | 21 +++++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 units/systemd-sysupdate-auto-enable.service diff --git a/man/rules/meson.build b/man/rules/meson.build index 486f565815..3dafcc13de 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -1277,7 +1277,8 @@ manpages = [ ''], ['systemd-sysupdate', '8', - ['systemd-sysupdate-reboot.service', + ['systemd-sysupdate-auto-enable.service', + 'systemd-sysupdate-reboot.service', 'systemd-sysupdate-reboot.timer', 'systemd-sysupdate-update.service', 'systemd-sysupdate-update.timer', diff --git a/man/systemd-sysupdate.xml b/man/systemd-sysupdate.xml index 2855c650c8..0491b7118f 100644 --- a/man/systemd-sysupdate.xml +++ b/man/systemd-sysupdate.xml @@ -22,6 +22,7 @@ systemd-sysupdate-update.timer systemd-sysupdate-reboot.service systemd-sysupdate-reboot.timer + systemd-sysupdate-auto-enable.service systemd-sysupdate.service @@ -87,6 +88,12 @@ appropriate time (i.e. typically at night). The two sets of service/timer units may be enabled separately. + The systemd-sysupdate-auto-enable.service system service automatically enables all + suggested components and all features of the enabled components before each update. It is ordered before and + pulled in by systemd-sysupdate-update.service, and is not enabled by default. Enable it + if newly suggested components and features shall be picked up automatically as they become available, rather + than requiring manual enable-component/enable-feature invocations. + For details about transfer files and examples see sysupdate.d5. diff --git a/units/meson.build b/units/meson.build index c07e5712b0..a4b0dc61cc 100644 --- a/units/meson.build +++ b/units/meson.build @@ -872,6 +872,10 @@ units = [ 'file' : 'systemd-sysinstall@.service', 'conditions' : ['ENABLE_SYSINSTALL'], }, + { + 'file' : 'systemd-sysupdate-auto-enable.service', + 'conditions' : ['ENABLE_SYSUPDATE'], + }, { 'file' : 'systemd-sysupdate-reboot.service', 'conditions' : ['ENABLE_SYSUPDATE'], diff --git a/units/systemd-sysupdate-auto-enable.service b/units/systemd-sysupdate-auto-enable.service new file mode 100644 index 0000000000..d2f4a22e1f --- /dev/null +++ b/units/systemd-sysupdate-auto-enable.service @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Automatically Enable All Suggested Components & Features for System Updates +Documentation=man:systemd-sysupdate-auto-enable.service(8) +Before=systemd-sysupdate-update.service + +[Service] +Type=oneshot +ExecStart=systemd-sysupdate enable-component --component-suggested +ExecStart=systemd-sysupdate enable-feature --component-all --feature-all + +[Install] +WantedBy=systemd-sysupdate-update.service