From 243b63d8a6797cf9de37b309575d9ec0cb04c041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 30 Oct 2024 14:21:09 +0100 Subject: [PATCH] meson: add separate option for sysupdated, disable in release builds This commit introduces a build-time option to enable/disable sysupdated separately from sysupdate. 'auto' translated to enabled by default in developer builds. --- man/org.freedesktop.sysupdate1.xml | 2 +- man/rules/meson.build | 6 +++--- man/systemd-sysupdated.service.xml | 2 +- man/updatectl.xml | 2 +- meson.build | 15 +++++++++++++++ meson_options.txt | 4 ++++ src/sysupdate/meson.build | 6 +++--- units/meson.build | 10 +++++----- 8 files changed, 33 insertions(+), 14 deletions(-) diff --git a/man/org.freedesktop.sysupdate1.xml b/man/org.freedesktop.sysupdate1.xml index 61c5847b1d0..aa4a30e0799 100644 --- a/man/org.freedesktop.sysupdate1.xml +++ b/man/org.freedesktop.sysupdate1.xml @@ -3,7 +3,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" > - org.freedesktop.sysupdate1 diff --git a/man/rules/meson.build b/man/rules/meson.build index 5f69f01cc48..eb4300386d7 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -65,7 +65,7 @@ manpages = [ ['org.freedesktop.portable1', '5', [], 'ENABLE_PORTABLED'], ['org.freedesktop.resolve1', '5', [], 'ENABLE_RESOLVE'], ['org.freedesktop.systemd1', '5', [], ''], - ['org.freedesktop.sysupdate1', '5', [], 'ENABLE_SYSUPDATE'], + ['org.freedesktop.sysupdate1', '5', [], 'ENABLE_SYSUPDATED'], ['org.freedesktop.timedate1', '5', [], 'ENABLE_TIMEDATED'], ['org.freedesktop.timesync1', '5', [], 'ENABLE_TIMESYNCD'], ['os-release', '5', ['extension-release', 'initrd-release'], ''], @@ -1107,7 +1107,7 @@ manpages = [ ['systemd-sysupdated.service', '8', ['systemd-sysupdated'], - 'ENABLE_SYSUPDATE'], + 'ENABLE_SYSUPDATED'], ['systemd-sysusers', '8', ['systemd-sysusers.service'], ''], ['systemd-sysv-generator', '8', [], 'HAVE_SYSV_COMPAT'], ['systemd-time-wait-sync.service', @@ -1286,7 +1286,7 @@ manpages = [ ['udev_new', '3', ['udev_ref', 'udev_unref'], ''], ['udevadm', '8', [], ''], ['ukify', '1', [], 'ENABLE_UKIFY'], - ['updatectl', '1', [], 'ENABLE_SYSUPDATE'], + ['updatectl', '1', [], 'ENABLE_SYSUPDATED'], ['user@.service', '5', ['systemd-user-runtime-dir', 'user-runtime-dir@.service'], diff --git a/man/systemd-sysupdated.service.xml b/man/systemd-sysupdated.service.xml index f28cc6c97f5..30a9bd8d696 100644 --- a/man/systemd-sysupdated.service.xml +++ b/man/systemd-sysupdated.service.xml @@ -3,7 +3,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - + systemd-sysupdated.service diff --git a/man/updatectl.xml b/man/updatectl.xml index 9fece4f779d..c7b0dbd3096 100644 --- a/man/updatectl.xml +++ b/man/updatectl.xml @@ -3,7 +3,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - diff --git a/meson.build b/meson.build index d8003bce10a..bf78ff3bbb9 100644 --- a/meson.build +++ b/meson.build @@ -1609,6 +1609,20 @@ have = get_option('sysupdate').require( error_message : 'fdisk and openssl required').allowed() conf.set10('ENABLE_SYSUPDATE', have) +have2 = get_option('sysupdated') +if have2 == 'enabled' + if have + have2 = true + else + error('sysupdated requires sysupdate to be enabled') + endif +elif have2 == 'auto' + have2 = have and conf.get('BUILD_MODE_DEVELOPER') == 1 +else + have2 = false +endif +conf.set10('ENABLE_SYSUPDATED', have2) + conf.set10('ENABLE_STORAGETM', get_option('storagetm')) have = get_option('importd').require( @@ -3071,6 +3085,7 @@ foreach tuple : [ ['sysext'], ['systemd-analyze', conf.get('ENABLE_ANALYZE') == 1], ['sysupdate'], + ['sysupdated'], ['sysusers'], ['storagetm'], ['timedated'], diff --git a/meson_options.txt b/meson_options.txt index ec3688ab33c..78ec25bfa3c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -108,6 +108,10 @@ option('repart', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : description : 'install the systemd-repart tool') option('sysupdate', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' }, description : 'install the systemd-sysupdate tool') +option('sysupdated', type: 'combo', value : 'auto', + choices : ['auto', 'enabled', 'disabled'], + description : 'install the systemd-sysupdated service') + option('coredump', type : 'boolean', description : 'install the coredump handler') option('pstore', type : 'boolean', diff --git a/src/sysupdate/meson.build b/src/sysupdate/meson.build index 0c7c469a620..baf3e93a8d3 100644 --- a/src/sysupdate/meson.build +++ b/src/sysupdate/meson.build @@ -40,7 +40,7 @@ executables += [ libexec_template + { 'name' : 'systemd-sysupdated', 'dbus' : true, - 'conditions' : ['ENABLE_SYSUPDATE'], + 'conditions' : ['ENABLE_SYSUPDATED'], 'sources' : files('sysupdated.c'), 'dependencies' : threads, }, @@ -48,11 +48,11 @@ executables += [ 'name' : 'updatectl', 'public' : true, 'sources' : systemd_updatectl_sources, - 'conditions' : ['ENABLE_SYSUPDATE'], + 'conditions' : ['ENABLE_SYSUPDATED'], }, ] -if conf.get('ENABLE_SYSUPDATE') == 1 +if conf.get('ENABLE_SYSUPDATED') == 1 install_data('org.freedesktop.sysupdate1.conf', install_dir : dbuspolicydir) install_data('org.freedesktop.sysupdate1.service', diff --git a/units/meson.build b/units/meson.build index 004c5f92d45..96f48527419 100644 --- a/units/meson.build +++ b/units/meson.build @@ -640,15 +640,15 @@ units = [ 'file' : 'systemd-sysupdate.service.in', 'conditions' : ['ENABLE_SYSUPDATE'], }, - { - 'file' : 'systemd-sysupdated.service.in', - 'conditions' : ['ENABLE_SYSUPDATE'], - 'symlinks' : ['dbus-org.freedesktop.sysupdate1.service'], - }, { 'file' : 'systemd-sysupdate.timer', 'conditions' : ['ENABLE_SYSUPDATE'], }, + { + 'file' : 'systemd-sysupdated.service.in', + 'conditions' : ['ENABLE_SYSUPDATED'], + 'symlinks' : ['dbus-org.freedesktop.sysupdate1.service'], + }, { 'file' : 'systemd-sysusers.service', 'conditions' : ['ENABLE_SYSUSERS'],