]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: add separate option for sysupdated, disable in release builds 34832/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 30 Oct 2024 13:21:09 +0000 (14:21 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 31 Oct 2024 21:08:08 +0000 (21:08 +0000)
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
man/rules/meson.build
man/systemd-sysupdated.service.xml
man/updatectl.xml
meson.build
meson_options.txt
src/sysupdate/meson.build
units/meson.build

index 61c5847b1d0bc09ace720afae24a3bb6b8442868..aa4a30e07996506fe8acd26a6fd94bff246e0660 100644 (file)
@@ -3,7 +3,7 @@
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
 
-<refentry id="org.freedesktop.sysupdate1" conditional='ENABLE_SYSUPDATE'
+<refentry id="org.freedesktop.sysupdate1" conditional='ENABLE_SYSUPDATED'
     xmlns:xi="http://www.w3.org/2001/XInclude">
   <refentryinfo>
     <title>org.freedesktop.sysupdate1</title>
index 5f69f01cc48dc50964a8a2afe3adfcebcb2039da..eb4300386d7c7352aef2bcf3d345d7f689db7d1e 100644 (file)
@@ -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'],
index f28cc6c97f5ebe4f1b0528679c660c0d2a904385..30a9bd8d6967df92070812a6a92d57c97b63fef2 100644 (file)
@@ -3,7 +3,7 @@
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
 
-<refentry id="systemd-sysupdated.service" conditional='ENABLE_SYSUPDATE'>
+<refentry id="systemd-sysupdated.service" conditional='ENABLE_SYSUPDATED'>
 
   <refentryinfo>
     <title>systemd-sysupdated.service</title>
index 9fece4f779dba25cafb660280887428821a81a2d..c7b0dbd3096c00e24e8138c29b8c8ac0629b42fd 100644 (file)
@@ -3,7 +3,7 @@
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
 
-<refentry id="updatectl" conditional='ENABLE_SYSUPDATE'
+<refentry id="updatectl" conditional='ENABLE_SYSUPDATED'
     xmlns:xi="http://www.w3.org/2001/XInclude">
 
   <refentryinfo>
index d8003bce10a919d6045e23051e3a80505166521a..bf78ff3bbb94549dd5448518cf8176952326478e 100644 (file)
@@ -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'],
index ec3688ab33c9a9d9504e22eaa53660436a457c22..78ec25bfa3c4b57b33135b84e3a1f04bc5279faa 100644 (file)
@@ -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',
index 0c7c469a6207244fc7d432e6907adabcbec3c1cd..baf3e93a8d330ff65115f84e91ca27bc03c44c3b 100644 (file)
@@ -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',
index 004c5f92d4558a7f21d4edf2f4eaa88bbdd13263..96f48527419e2fe11dd4b08b723919a777cdc753 100644 (file)
@@ -641,13 +641,13 @@ units = [
           'conditions' : ['ENABLE_SYSUPDATE'],
         },
         {
-          'file' : 'systemd-sysupdated.service.in',
+          'file' : 'systemd-sysupdate.timer',
           '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',