diff --git a/99-nvme-nbft-connect.sh b/99-nvme-nbft-connect.sh new file mode 100644 index 0000000000000000000000000000000000000000..1dc03243d0636802caafd1fccc2e5b8b41f39dc4 --- /dev/null +++ b/99-nvme-nbft-connect.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +if [[ "$1" == nbft* ]] && [[ "$2" == "up" ]]; then + systemctl start nvmf-connect-nbft.service +fi diff --git a/99-nvme-nbft-no-ignore-carrier.conf b/99-nvme-nbft-no-ignore-carrier.conf new file mode 100644 index 0000000000000000000000000000000000000000..4f1951589ea7f5cfcd0b6d3ca6ee929d00813be4 --- /dev/null +++ b/99-nvme-nbft-no-ignore-carrier.conf @@ -0,0 +1,15 @@ +# Boot from NVMe over TCP (NBFT) +# +# For NVMe/TCP connections that provide namespaces containing rootfs +# it is crucial to react on carrier events and reconnect any missing +# NVMe/TCP connections as defined in the ACPI NBFT table. A custom +# /usr/lib/NetworkManager/dispatcher.d/99-nvme-nbft-connect.sh hook +# will respawn nvmf-connect-nbft.service on such occasion. + +[device-nbft-no-ignore-carrier] + +# only affects nbft0, nbft1, ... interfaces +match-device=interface-name:nbft* + +# react on link up/down events +ignore-carrier=no diff --git a/nvme-cli.spec b/nvme-cli.spec index 81058c5c43d558b58b502e60cc6b5280ee1351e4..b8e393bfda93a6b7fc5f454d5c56a86791bfe3a3 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,20 +1,22 @@ Name: nvme-cli -Version: 2.9.1 +Version: 2.13 Release: 1 Summary: NVMe management command line interface -License: GPLv2+ +License: GPL-2.0-only URL: https://github.com/linux-nvme/nvme-cli Source0: https://github.com/linux-nvme/%{name}/archive/v%{version}.tar.gz - -Requires: libnvme - -BuildRequires: gcc-g++ -BuildRequires: libnvme-devel >= 1.9 -BuildRequires: make -BuildRequires: meson -BuildRequires: systemd -BuildRequires: zlib-devel +Source1: 99-nvme-nbft-connect.sh +Source2: 99-nvme-nbft-no-ignore-carrier.conf + +BuildRequires: gcc make +BuildRequires: meson >= 0.50.0 +BuildRequires: pkgconfig(json-c) >= 0.13 +BuildRequires: pkgconfig(libnvme) >= 1.13 +BuildRequires: pkgconfig(libnvme-mi) +BuildRequires: rpm_macro(_unitdir) +BuildRequires: rpm_macro(_udevrulesdir) +%{?systemd_requires} %description nvme-cli provides NVM-Express user space tooling for Linux. @@ -31,6 +33,11 @@ nvme-cli provides NVM-Express user space tooling for Linux. %install %meson_install +mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/NetworkManager/dispatcher.d +mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/NetworkManager/conf.d +%{__install} -pm 755 %{S:1} $RPM_BUILD_ROOT%{_prefix}/lib/NetworkManager/dispatcher.d/ +%{__install} -pm 644 %{S:2} $RPM_BUILD_ROOT%{_prefix}/lib/NetworkManager/conf.d/ + # hostid and hostnqn are supposed to be unique per machine. We obviously # can't package them. rm -f %{buildroot}%{_sysconfdir}/nvme/hostid @@ -39,6 +46,28 @@ rm -f %{buildroot}%{_sysconfdir}/nvme/hostnqn # Do not install the dracut rule yet. See rhbz 1742764 rm -f %{buildroot}/usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf +%post +%systemd_post nvmefc-boot-connections.service +%systemd_post nvmf-autoconnect.service +%systemd_post nvmf-connect@.service +%systemd_post nvmf-connect-nbft.service +if [ -S /run/udev/control ]; then + udevadm control --reload + udevadm trigger +fi + +%preun +%systemd_preun nvmefc-boot-connections.service +%systemd_preun nvmf-autoconnect.service +%systemd_preun nvmf-connect@.service +%systemd_preun nvmf-connect-nbft.service + +%postun +%systemd_postun nvmefc-boot-connections.service +%systemd_postun nvmf-autoconnect.service +%systemd_postun nvmf-connect@.service +%systemd_postun nvmf-connect-nbft.service + %files %license LICENSE %{_sbindir}/nvme @@ -52,14 +81,20 @@ rm -f %{buildroot}/usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf %{_unitdir}/nvmf-connect@.service %{_unitdir}/nvmf-connect-nbft.service %{_udevrulesdir}/70-nvmf-autoconnect.rules +%{_udevrulesdir}/70-nvmf-keys.rules %{_udevrulesdir}/71-nvmf-netapp.rules %{_udevrulesdir}/65-persistent-net-nbft.rules +%{_prefix}/lib/NetworkManager/dispatcher.d/99-nvme-nbft-connect.sh +%{_prefix}/lib/NetworkManager/conf.d/99-nvme-nbft-no-ignore-carrier.conf %files help %doc README.md -%{_mandir}/man1/nvme*.gz +%{_mandir}/man1/nvme* %changelog +* Sat Apr 12 2025 Funda Wang - 2.13-1 +- update to version 2.13 + * Sat May 11 2024 tenglei - 2.9.1-1 - Update package to version 2.9.1 - There a lot of small fixes and improvements all over the place diff --git a/nvme-cli.yaml b/nvme-cli.yaml index dd3d5d21924c3bf7ce8affb2a9588ad03733ee0d..b6d28fccb53c0d562bf0207aea9d9b4affc7d8f5 100644 --- a/nvme-cli.yaml +++ b/nvme-cli.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: linux-nvme/nvme-cli tag_prefix: ^v -seperator: . +separator: . diff --git a/v2.13.tar.gz b/v2.13.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..108526dea377855ab6a8f3d517369c55d0ccafe4 Binary files /dev/null and b/v2.13.tar.gz differ diff --git a/v2.9.1.tar.gz b/v2.9.1.tar.gz deleted file mode 100644 index 34849850ecab4da4034bc1bc85b6d46038ec8190..0000000000000000000000000000000000000000 Binary files a/v2.9.1.tar.gz and /dev/null differ