Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
option('user', type: 'string', value: 'clevis', description: 'Unprivileged user for secure clevis operations')
option('group', type: 'string', value: 'clevis', description: 'Unprivileged group for secure clevis operations')
option('tpm1', type: 'feature', value: 'auto', description: 'Enable TPM 1.2 pin support')
option('dracut', type: 'feature', value: 'auto', description: 'Enable dracut support for clevis')
option('udisks', type: 'feature', value: 'auto', description: 'Enable udisks2 support for clevis')
option('bashcompdir', type: 'string', value: '', description: 'Directory for bash completion files')
option('initramfs_tools', type: 'feature', value: 'auto', description: 'Enable initramfs-tools support in clevis')
8 changes: 6 additions & 2 deletions src/bash/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
bashcomp = dependency('bash-completion', required: false)

if bashcomp.found()
bashcompdir = bashcomp.get_pkgconfig_variable('completionsdir')
if get_option('bashcompdir') != '' or bashcomp.found()
if get_option('bashcompdir') != ''
bashcompdir = get_option('bashcompdir')
else
bashcompdir = bashcomp.get_variable(pkgconfig: 'completionsdir')
endif
install_data('clevis', install_dir: bashcompdir)
else
warning('Will not install bash completion due to missing dependencies!')
Expand Down
4 changes: 2 additions & 2 deletions src/initramfs-tools/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
initramfs_tools = find_program('update-initramfs', required: false)
initramfs_tools = find_program('update-initramfs', required: get_option('initramfs_tools'))

if initramfs_tools.found()
initramfstools_dir = '/usr/share/initramfs-tools'
Expand All @@ -11,6 +11,6 @@ if initramfs_tools.found()
initramfs_data.set('libdir', libdir)
subdir('hooks')
subdir('scripts')
else
elif get_option('initramfs_tools').auto()
warning('Will not install initramfs-tools module due to missing dependencies!')
endif
2 changes: 1 addition & 1 deletion src/luks/dracut/clevis-pin-null/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ if dracut.found()
install_dir: dracutdir,
configuration: data,
)
else
elif get_option('dracut').auto()
warning('Will not install dracut module clevis-pin-null due to missing dependencies!')
endif
2 changes: 1 addition & 1 deletion src/luks/dracut/clevis-pin-pkcs11/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ if dracut.found()
)
install_data('clevis-pkcs11-prehook.sh', install_dir: dracutdir)

else
elif get_option('dracut').auto()
warning('Will not install dracut module clevis-pin-pkcs11 due to missing dependencies!')
endif
2 changes: 1 addition & 1 deletion src/luks/dracut/clevis-pin-sss/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ if dracut.found()
install_dir: dracutdir,
configuration: data,
)
else
elif get_option('dracut').auto()
warning('Will not install dracut module clevis-pin-sss due to missing dependencies!')
endif
2 changes: 1 addition & 1 deletion src/luks/dracut/clevis-pin-tang/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ if dracut.found()
install_dir: dracutdir,
configuration: data,
)
else
elif get_option('dracut').auto()
warning('Will not install dracut module clevis-pin-tang due to missing dependencies!')
endif
2 changes: 1 addition & 1 deletion src/luks/dracut/clevis-pin-tpm1/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ if dracut.found()
install_dir: dracutdir,
configuration: data,
)
else
elif get_option('dracut').auto()
warning('Will not install dracut module clevis-pin-tpm1 due to missing dependencies!')
endif
2 changes: 1 addition & 1 deletion src/luks/dracut/clevis-pin-tpm2/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ if dracut.found()
install_dir: dracutdir,
configuration: data,
)
else
elif get_option('dracut').auto()
warning('Will not install dracut module clevis-pin-tpm2 due to missing dependencies!')
endif
2 changes: 1 addition & 1 deletion src/luks/dracut/clevis/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ if dracut.found()
install_data('clevis-cleanup-hook.sh', install_dir: dracutdir)
install_data('clevis-password-unlocker-hook.sh', install_dir: dracutdir)
install_data('clevis-online-hook.sh', install_dir: dracutdir)
else
elif get_option('dracut').auto()
warning('Will not install dracut module due to missing dependencies!')
endif
19 changes: 11 additions & 8 deletions src/luks/dracut/meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
subdir('clevis')
subdir('clevis-pin-tang')
if not get_option('tpm1').disabled()
subdir('clevis-pin-tpm1')
dracut = dependency('dracut', required: get_option('dracut'))
if dracut.found()
subdir('clevis')
subdir('clevis-pin-tang')
if not get_option('tpm1').disabled()
subdir('clevis-pin-tpm1')
endif
subdir('clevis-pin-tpm2')
subdir('clevis-pin-sss')
subdir('clevis-pin-null')
subdir('clevis-pin-pkcs11')
endif
subdir('clevis-pin-tpm2')
subdir('clevis-pin-sss')
subdir('clevis-pin-null')
subdir('clevis-pin-pkcs11')
8 changes: 4 additions & 4 deletions src/luks/udisks2/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
audit = dependency('audit', version: '>=2.7.8', required: false)
udisks2 = dependency('udisks2', required: false)
gio = dependency('gio-2.0', required: false)
udisks2 = dependency('udisks2', required: get_option('udisks'))
audit = dependency('audit', version: '>=2.7.8', required: get_option('udisks'))
gio = dependency('gio-2.0', required: get_option('udisks'))

if udisks2.found() and audit.found() and gio.found()
autostartdir = join_paths(sysconfdir, 'xdg', 'autostart')
Expand All @@ -18,7 +18,7 @@ if udisks2.found() and audit.found() and gio.found()
install_dir: libexecdir,
install: true,
)
else
elif get_option('udisks').auto()
warning('Will not build udisks2 support due to missing dependencies!')
endif

Expand Down
4 changes: 2 additions & 2 deletions src/pins/file/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if dracut.found()
install_dir: dracutdir,
configuration: data,
)
else
elif get_option('dracut').auto()
warning('Will not install dracut module clevis-pin-file due to missing dependencies!')
endif

Expand All @@ -41,6 +41,6 @@ if initramfs_tools.found()
install_dir: initramfs_hooks_dir,
configuration: initramfs_data,
)
else
elif get_option('initramfs_tools').auto()
warning('Will not install initramfs module clevis-pin-file due to missing dependencies!')
endif
6 changes: 3 additions & 3 deletions src/pins/template/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if curl.found()

#%# Run the test.
test('pin-@pin@', find_program('./pin-@pin@'), env: env)
else
elif get_option('dracut').auto()
warning('Will not install @pin@ pin due to missing dependencies!')
endif

Expand All @@ -44,7 +44,7 @@ if dracut.found()
install_dir: dracutdir,
configuration: data,
)
else
elif get_option('initramfs_tools').auto()
warning('Will not install dracut module clevis-pin-@pin@ due to missing dependencies!')
endif

Expand All @@ -61,6 +61,6 @@ if initramfs_tools.found()
install_dir: initramfs_hooks_dir,
configuration: initramfs_data,
)
else
elif get_option('initramfs_tools').auto()
warning('Will not install initramfs module clevis-pin-@pin@ due to missing dependencies!')
endif