![](https://seccdn.libravatar.org/avatar/f0b862ee805990499445d7d2b8834647.jpg?s=120&d=mm&r=g)
Historically, modprobe configuration files have been installed in /etc/modprobe.d on openSUSE. This has a number of disadvantages. - packages should generally avoid shipping files under /etc - customization requires %config or %config(noreplace), with the well-known issues this may cause on upgrades. The more "modern" style to enable user customization is to place distribution-shipped configuration files under /lib/modprobe.d or /usr/lib/modprobe.d, and let users override them by files of the same name under /etc/modprobe.d if they desire. This technique has been supported by kmod for years, and is well established these days by systemd, udev, dracut, etc., which use the same scheme. I've started an effort to move all modprobe configuration files shipped by packages into /usr/lib/modprobe.d on Factory, and /lib/modprobe.d on Leap. The %config or %config(noreplace) file attributes for the distribution-shipped defaults are removed. If the user has modified some of the distro-shipped %config files, they'll be renamed to .rpmsave by rpm when the update package moves the config file out of /etc. This would undo user customizations, which is undesirable. To avoid it, code is added to the spec files of affected packages, which looks like this (example from "bluez"): %global modprobe_d_files 50-bluetooth.conf %pre # Avoid restoring pre-existing .rpmsave files in %posttrans later by renaming them for _f in %{?modprobe_d_files}; do [ ! -f "%{_sysconfdir}/modprobe.d/${_f}.rpmsave" ] || \ mv -f "%{_sysconfdir}/modprobe.d/${_f}.rpmsave" "%{_sysconfdir}/modprobe.d/${_f}.rpmsave.%{name}-%{VERSION}-%{RELEASE}" || : done %posttrans # Modified config files are renamed to .rpmsave by rpm when moved to /usr/lib. # Restore the user's customizations. for _f in %{?modprobe_d_files}; do [ ! -f "%{_sysconfdir}/modprobe.d/${_f}.rpmsave" ] || \ mv -fv "%{_sysconfdir}/modprobe.d/${_f}.rpmsave" "%{_sysconfdir}/modprobe.d/${_f}" || : done The current status can be seen on OBS in the home:mwilck:modprobe.d project (currently WIP). There has been some confusion about the correct path (/usr/lib/modprobe.d vs. /lib/modprobe.d). Here's a short summary of the discussion: - upstream kmod does supports /lib/modprobe.d only. - SUSE's kmod is currently patched to support both /lib/modprobe.d and /usr/lib/modprobe.d. - On usr-merged Factory, /lib/modprobe.d is an alias for /usr/lib/modprobe.d, thus they can be used interchangeably. For correctness and to avoid filename clashes, we use /usr/lib. - on non-usr-merged distros, we keep the upstream path /lib/modprobe.d. Scripts and "consumers" of modprobe.d files can safely look them up under /lib/modprobe.d, which will "work" on both usr-merged and non- usr-merged variants. In the future, %_modprobedir should be used by packages. Currently though, %_modprobedir is (wrongly) set to /usr/lib/modprobe.d in the systemd-rpm-macros package on SLE/Leap up to 15.3. Likewise, the filesystem package on Leap currently contains /usr/lib/modprobe.d but not /lib/modprobe.d. This will be fixed sooner or later, but spec files currently need to work around this issue with a conditional. packages that install into %_modprobedir should add a "%dir %{_modprobedir}" line to the %files list to avoid build errors. Furthermore, discussion is ongoing whether the definition of %_modprobedir should be moved to a different package, and which. Regards Martin PS: @maintainers of affected packages: I've sent a bunch of OBS requests on Friday and revoked them, because I hadn't added the code for restoring user modifications yet and I figured I should rather do that first.