From 7795f9c66da93de8acfdf89bc6949f2f76be77fa Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 24 Oct 2026 10:39:51 +0100 Subject: [PATCH] meson: add feature flag for veritysetup veritysetup builds and installs binaries, docs, units, etc. Add a feature flag to make it easier to avoid shipping it. --- man/rules/meson.build | 6 +++--- man/systemd-veritysetup-generator.xml | 2 +- man/systemd-veritysetup@.service.xml | 2 +- man/veritytab.xml | 2 +- meson.build | 6 ++++++ meson_options.txt | 2 ++ src/gpt-auto-generator/gpt-auto-generator.c | 4 ++-- src/veritysetup/meson.build | 2 +- units/meson.build | 8 ++++---- 9 files changed, 21 insertions(+), 13 deletions(-) diff --git a/man/rules/meson.build b/man/rules/meson.build index a5c3db09b99..e4459c9a2c9 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -1381,11 +1381,11 @@ manpages = [ '8', ['systemd-vconsole-setup'], 'ENABLE_VCONSOLE'], - ['systemd-veritysetup-generator', '8', [], 'HAVE_LIBCRYPTSETUP'], + ['systemd-veritysetup-generator', '8', [], 'ENABLE_VERITYSETUP'], ['systemd-veritysetup@.service', '8', ['systemd-veritysetup'], - 'HAVE_LIBCRYPTSETUP'], + 'ENABLE_VERITYSETUP'], ['systemd-vmspawn', '1', [], 'ENABLE_VMSPAWN'], ['systemd-volatile-root.service', '8', ['systemd-volatile-root'], ''], ['systemd-vpick', '1', [], ''], @@ -1531,6 +1531,6 @@ manpages = [ ['userdbctl', '1', [], 'ENABLE_USERDB'], ['varlinkctl', '1', [], ''], ['vconsole.conf', '5', [], 'ENABLE_VCONSOLE'], - ['veritytab', '5', [], 'HAVE_LIBCRYPTSETUP'] + ['veritytab', '5', [], 'ENABLE_VERITYSETUP'] ] # Really, do not edit. diff --git a/man/systemd-veritysetup-generator.xml b/man/systemd-veritysetup-generator.xml index ca133eb506e..92d3306dc0e 100644 --- a/man/systemd-veritysetup-generator.xml +++ b/man/systemd-veritysetup-generator.xml @@ -3,7 +3,7 @@ - diff --git a/man/systemd-veritysetup@.service.xml b/man/systemd-veritysetup@.service.xml index a976a062dea..18e9eefdb8c 100644 --- a/man/systemd-veritysetup@.service.xml +++ b/man/systemd-veritysetup@.service.xml @@ -3,7 +3,7 @@ - diff --git a/man/veritytab.xml b/man/veritytab.xml index 913acad9a2d..69019399ea7 100644 --- a/man/veritytab.xml +++ b/man/veritytab.xml @@ -8,7 +8,7 @@ This is based on crypttab(5). --> - + veritytab diff --git a/meson.build b/meson.build index 7c06d55273a..4bb3bb8047f 100644 --- a/meson.build +++ b/meson.build @@ -1804,6 +1804,11 @@ have = get_option('integritysetup').require( error_message : 'libcryptsetup required for systemd-integritysetup').allowed() conf.set10('ENABLE_INTEGRITYSETUP', have) +have = get_option('veritysetup').require( + conf.get('HAVE_LIBCRYPTSETUP') == 1, + error_message : 'libcryptsetup required for systemd-veritysetup').allowed() +conf.set10('ENABLE_VERITYSETUP', have) + have = get_option('validatefs').require( conf.get('HAVE_BLKID') == 1, error_message : 'blkid required for systemd-validatefs').allowed() @@ -3506,6 +3511,7 @@ foreach tuple : [ ['userdb'], ['validatefs'], ['vconsole'], + ['veritysetup'], ['vmspawn'], ['xdg-autostart'], diff --git a/meson_options.txt b/meson_options.txt index 8aae81eeef4..39aaf00396b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -288,6 +288,8 @@ option('varlink-monitord', type : 'boolean', description : 'install the systemd-varlink-monitord daemon') option('vconsole', type : 'boolean', description : 'support for vconsole configuration') +option('veritysetup', type : 'feature', + description : 'install systemd-veritysetup and associated files') option('vmspawn', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' }, description : 'install the systemd-vmspawn tool') option('xdg-autostart', type : 'boolean', diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index 76fb6c96c0c..028c23cfbf1 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -205,7 +205,7 @@ static int add_veritysetup( const char *mount_opts, MountPointFlags flags) { -#if HAVE_LIBCRYPTSETUP +#if ENABLE_VERITYSETUP int r; assert(id); @@ -305,7 +305,7 @@ static int add_veritysetup( return 0; #else - log_warning("Compiled without libcryptsetup support, skipping verity setup for '%s'.", id); + log_warning("Compiled without systemd-veritysetup support, skipping verity setup for '%s'.", id); return 0; #endif } diff --git a/src/veritysetup/meson.build b/src/veritysetup/meson.build index 08634869ce2..3ede6c91807 100644 --- a/src/veritysetup/meson.build +++ b/src/veritysetup/meson.build @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -if conf.get('HAVE_LIBCRYPTSETUP') != 1 +if conf.get('ENABLE_VERITYSETUP') != 1 subdir_done() endif diff --git a/units/meson.build b/units/meson.build index 379e590bc7a..6cdb101a397 100644 --- a/units/meson.build +++ b/units/meson.build @@ -205,7 +205,7 @@ units = [ }, { 'file' : 'remote-veritysetup.target', - 'conditions' : ['HAVE_LIBCRYPTSETUP'], + 'conditions' : ['ENABLE_VERITYSETUP'], 'symlinks' : ['initrd-root-device.target.wants/'], }, { 'file' : 'rescue.service.in' }, @@ -263,7 +263,7 @@ units = [ { 'file' : 'system-systemd-veritysetup.slice', 'name' : 'system-systemd\\x2dveritysetup.slice', - 'conditions' : ['HAVE_LIBCRYPTSETUP'], + 'conditions' : ['ENABLE_VERITYSETUP'], }, { 'file' : 'system-update-cleanup.service' }, { 'file' : 'system-update-pre.target' }, @@ -1196,11 +1196,11 @@ units = [ }, { 'file' : 'veritysetup-pre.target', - 'conditions' : ['HAVE_LIBCRYPTSETUP'], + 'conditions' : ['ENABLE_VERITYSETUP'], }, { 'file' : 'veritysetup.target', - 'conditions' : ['HAVE_LIBCRYPTSETUP'], + 'conditions' : ['ENABLE_VERITYSETUP'], 'symlinks' : ['sysinit.target.wants/'], }, ]