Skip to content
Merged
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
17 changes: 17 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
udevrulesdir = join_paths(prefixdir, get_option('udevrulesdir'))
dracutrulesdir = join_paths(prefixdir, get_option('dracutrulesdir'))
systemddir = join_paths(prefixdir, get_option('systemddir'))
nmdispatchdir = join_paths(prefixdir, get_option('nmdispatchdir'))
rundir = join_paths(prefixdir, get_option('rundir'))

std_prefix = prefixdir == '/usr' or prefixdir == '/usr/local'
Expand Down Expand Up @@ -571,6 +572,21 @@ if want_nvme
)
endforeach

nm_dispatcher_files = [
'80-nvmf-connect-nbft.sh'
]

foreach file : nm_dispatcher_files
configure_file(
input: 'nvmf-autoconnect/nm-dispatcher/' + file + '.in',
output: file,
configuration: substs,
install: true,
install_mode: 'rwxr-xr-x',
install_dir: nmdispatchdir
)
endforeach

install_data(
'completions/bash-nvme-completion.sh',
rename: 'nvme',
Expand All @@ -596,6 +612,7 @@ path_dict = {
'dracutrulesdir': dracutrulesdir,
'rundir': rundir,
'systemddir': systemddir,
'nmdispatchdir': nmdispatchdir,
'build location': meson.current_build_dir(),
}
summary(path_dict, section: 'Paths')
Expand Down
6 changes: 6 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ option(
value : 'lib/udev/rules.d',
description : 'directory for udev rules files'
)
option(
'nmdispatchdir',
type : 'string',
value : 'lib/NetworkManager/dispatcher.d',
description : 'directory for NetworkManager dispatcher scripts'
)
option(
'version-tag',
type : 'string',
Expand Down
27 changes: 27 additions & 0 deletions nvmf-autoconnect/nm-dispatcher/80-nvmf-connect-nbft.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# If an interface is brought up that is configured in the NVMeoF
# Boot Firmware Table (NBFT), try to establish possibly missing
# NVMe connections from the NBFT.
# This can happen if an interface couldn't be brought up during
# initramfs processing, but is activated later on.

start_nvmf=

if [ "$2" = up ]; then
case $1 in
nbft*)
start_nvmf=yes
;;
esac
case $CONNECTION_ID in
"NBFT connection HFI"*)
start_nvmf=yes
;;
esac
fi

if [ "$start_nvmf" ]; then
@SYSTEMCTL@ --no-block start nvmf-connect-nbft.service || true
fi