diff --git a/nbd.changes b/nbd.changes index d76ff72..60ac445 100644 --- a/nbd.changes +++ b/nbd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Feb 8 13:20:09 UTC 2016 - dmueller@suse.com + +- autoload nbd module + ------------------------------------------------------------------- Fri Feb 5 17:11:09 UTC 2016 - dmueller@suse.com diff --git a/nbd.spec b/nbd.spec index a830400..24a1db6 100644 --- a/nbd.spec +++ b/nbd.spec @@ -38,6 +38,7 @@ Requires(pre): coreutils Suggests: nbd-doc BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} >= 1210 +BuildRequires: systemd BuildRequires: systemd-rpm-macros %systemd_requires %else @@ -107,6 +108,12 @@ install %{SOURCE2} %{buildroot}%{_initddir}/nbd-server ln -s ../..%{_initddir}/nbd-server %{buildroot}%{_sbindir}/rc%{name}-server %endif +%if 0%{?suse_version} >= 1210 +# autoload nbd module +install -d -m 750 %{buildroot}/etc/modules-load.d/ +echo "nbd" > %{buildroot}/etc/modules-load.d/%name.conf +%endif + #echo "#Port file options" > $RPM_BUILD_ROOT/etc/nbd-server.conf mkdir -p %{buildroot}%{_sysconfdir}/nbd-server touch %{buildroot}%{_sysconfdir}/nbd-server/config @@ -134,6 +141,9 @@ install -D -m 0644 %{SOURCE4} %{buildroot}%{_localstatedir}/adm/fillup-templates %ghost %config(noreplace) %{_sysconfdir}/nbd-server/config %ghost %config(noreplace) %{_sysconfdir}/nbd-server/allow %config %{_sysconfdir}/nbd-server/config.example +%if 0%{?suse_version} >= 1210 +%{_sysconfdir}/modules-load.d/%name.conf +%endif %{_localstatedir}/adm/fillup-templates/sysconfig.%{name}-server %files doc