meson: add feature flag for battery-check

battery-check builds and installs binaries, docs, units, etc. Add a
feature flag to make it easier to avoid shipping it.
This commit is contained in:
Luca Boccassi authored and Yu Watanabe committed 2026-10-25 09:34:00 +09:00
1 parent a48a1f286d
commit 0bc7a465e7
7 files changed
+18 -3

No files matched your search

+4 -1
View File
@@ -1030,7 +1030,10 @@ manpages = [
''],
['systemd-ask-password', '1', [], ''],
['systemd-backlight@.service', '8', ['systemd-backlight'], 'ENABLE_BACKLIGHT'],
['systemd-battery-check.service', '8', ['systemd-battery-check'], ''],
['systemd-battery-check.service',
'8',
['systemd-battery-check'],
'ENABLE_BATTERY_CHECK'],
['systemd-binfmt.service', '8', ['systemd-binfmt'], 'ENABLE_BINFMT'],
['systemd-bless-boot-generator', '8', [], 'ENABLE_BOOTLOADER'],
['systemd-bless-boot.service',
+2 -1
View File
@@ -3,7 +3,8 @@
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
<refentry id="systemd-battery-check.service" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentry id="systemd-battery-check.service" conditional="ENABLE_BATTERY_CHECK"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>systemd-battery-check</title>
+3
View File
@@ -1793,6 +1793,8 @@ conf.set10('ENABLE_NSPAWN', feature.allowed())
conf.set10('DEFAULT_MOUNTFSD_TRUSTED_DIRECTORIES', get_option('default-mountfsd-trusted-directories'))
conf.set10('ENABLE_BATTERY_CHECK', get_option('battery-check').allowed())
foreach tuple : [
['analyze'],
['backlight'],
@@ -3434,6 +3436,7 @@ foreach tuple : [
# components
['backlight'],
['battery-check'],
['binfmt'],
['bootloader'],
['bpf-framework', conf.get('BPF_FRAMEWORK') == 1],
+2
View File
@@ -163,6 +163,8 @@ option('analyze', type: 'boolean', value: true,
description : 'install systemd-analyze')
option('backlight', type : 'boolean',
description : 'install systemd-backlight')
option('battery-check', type : 'feature',
description : 'install systemd-battery-check and associated files')
option('binfmt', type : 'boolean',
description : 'support for custom binary formats')
option('coredump', type : 'boolean',
+1
View File
@@ -3,6 +3,7 @@
executables += [
libexec_template + {
'name' : 'systemd-battery-check',
'conditions' : ['ENABLE_BATTERY_CHECK'],
'sources' : files('battery-check.c'),
},
]
@@ -3,6 +3,11 @@
set -eux
set -o pipefail
if [[ ! -x /usr/lib/systemd/systemd-battery-check ]]; then
echo "systemd-battery-check is not installed, skipping test."
exit 77
fi
/usr/lib/systemd/systemd-battery-check --help
/usr/lib/systemd/systemd-battery-check --version
+1 -1
View File
@@ -65,7 +65,7 @@ units = [
},
{
'file' : 'systemd-battery-check.service.in',
'conditions' : ['ENABLE_INITRD'],
'conditions' : ['ENABLE_BATTERY_CHECK', 'ENABLE_INITRD'],
'symlinks' : ['initrd.target.wants/'],
},
{