From 7415429ffff8727d664e3530319cc66a51b355d2 Mon Sep 17 00:00:00 2001 From: fossdd Date: Tue, 22 Jul 2025 11:09:23 +0200 Subject: [PATCH] Revert "Remove support for elogind" (e)logind is used by fwupd for poweroff/reboot and for the logind plugin, which "is used to ensure that the machine does not enter a low power mode when updates are being performed". Upstream removed support for elogind, but I think it is still useful and important downstream. This reverts commit bbda9dec06674757da55ce6a241953c37553aaf9. Signed-off-by: fossdd --- meson.build | 6 ++++++ meson_options.txt | 4 ++++ plugins/logind/meson.build | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 6a3425f46..bf76fa1e4 100644 --- a/meson.build +++ b/meson.build @@ -523,6 +523,11 @@ if libsystemd.found() endif endif +elogind = dependency('systemd', 'libelogind', required: get_option('elogind')) +if elogind.found() + conf.set('HAVE_LOGIND' , '1') +endif + supported_build = get_option('supported_build').disable_auto_if(not tag).allowed() if supported_build conf.set('SUPPORTED_BUILD', '1') @@ -712,6 +717,7 @@ summary({ 'dbus_socket_address': get_option('dbus_socket_address'), 'vendor_ids_dir': vendor_ids_dir, 'docs': build_docs, + 'elogind': elogind, 'gnutls': gnutls, 'introspection': introspection.allowed(), 'libblkid': libblkid, diff --git a/meson_options.txt b/meson_options.txt index 40103c03e..bf8e96433 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -39,6 +39,10 @@ option('efi_os_dir', type: 'string', description: 'the hardcoded name of OS directory in ESP, e.g. fedora', ) +option('elogind', + type: 'feature', + description: 'elogind support', +) option('firmware-packager', type: 'boolean', value: true, diff --git a/plugins/logind/meson.build b/plugins/logind/meson.build index bd66fabbc..7fe59f594 100644 --- a/plugins/logind/meson.build +++ b/plugins/logind/meson.build @@ -1,4 +1,4 @@ -libsystemd.found() or subdir_done() +libsystemd.found() or elogind.found() or subdir_done() cargs = ['-DG_LOG_DOMAIN="FuPluginLogind"'] plugins += {meson.current_source_dir().split('/')[-1]: true} -- 2.50.1