modprobe.d: load from /usr/lib.
PATCH 1/1 modprobe.d: load from /usr/lib.
There is an ongoing effort to limit use of files outside of /usr (or $prefix on general). Currently all modprobe.d paths are hardcoded to outside of $prefix. Teach kmod to load modprobe.d from $prefix/lib.
--- Makefile.am | 1 + libkmod/libkmod.c | 1 + man/modprobe.d.xml | 1 + 3 files changed, 3 insertions(+)
Makefile.am +1 -0
@@ -19,6 +19,7 @@ AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -I$(top_srcdir) \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ + -DPREFIX=\""$(prefix)"\" \ ${zlib_CFLAGS} AM_CFLAGS = $(OUR_CFLAGS)
libkmod/libkmod.c +1 -0
@@ -65,6 +65,7 @@ static const char *default_config_paths[] = {SYSCONFDIR "/modprobe.d" ,"/run/modprobe.d" ,"/lib/modprobe.d" , +PREFIX "/lib/modprobe.d" , NULL };
man/modprobe.d.xml +1 -0
@@ -40,6 +40,7 @@ </refnamediv> <refsynopsisdiv> + <para><filename>/usr/lib/modprobe.d/*.conf</filename></para> <para><filename>/lib/modprobe.d/*.conf</filename></para> <para><filename>/etc/modprobe.d/*.conf</filename></para> <para><filename>/run/modprobe.d/*.conf</filename></para>
Signature · 1 line
2.26.2
Quoted 4 lines · Michal Suchanek
There is an ongoing effort to limit use of files outside of /usr (or $prefix on general). Currently all modprobe.d paths are hardcoded to outside of $prefix. Teach kmod to load modprobe.d from $prefix/lib.
/lib came from module-init-tools and we kept it for compatibility. It became a non-issue when distros
decided to just merge them and do a symlink /lib -> /usr/lib following
https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
what distros didn't do that?
I also fear the solution you want here is not so simple since now the configs will be added twice
if there is the symlink. And if we just drop /lib and start using /usr/lib we break compatibility.
Lucas De Marchi
Quoted 50 lines
Cc Marcus Rückert <[email protected]>Cc Takashi Iwai <[email protected]>Cc Dominique Leuenberger <[email protected]>Signed-off-by Michal Suchanek <[email protected]>--- Makefile.am | 1 + libkmod/libkmod.c | 1 + man/modprobe.d.xml | 1 + 3 files changed, 3 insertions(+)Makefile.am +1
-0@@ -19,6 +19,7 @@ AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -I$(top_srcdir) \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ + -DPREFIX=\""$(prefix)"\" \ ${zlib_CFLAGS} AM_CFLAGS = $(OUR_CFLAGS)libkmod/libkmod.c +1
-0@@ -65,6 +65,7 @@ static const char *default_config_paths[] = {SYSCONFDIR "/modprobe.d" ,"/run/modprobe.d" ,"/lib/modprobe.d" , +PREFIX "/lib/modprobe.d" , NULL };man/modprobe.d.xml +1
-1@@ -40,6 +40,7 @@ </refnamediv> <refsynopsisdiv> + <para><filename>/usr/lib/modprobe.d/*.conf</filename></para> <para><filename>/lib/modprobe.d/*.conf</filename></para> <para><filename>/etc/modprobe.d/*.conf</filename></para> <para><filename>/run/modprobe.d/*.conf</filename></para> --2.26.2
Quoted 6 lines · Lucas De Marchi
Quoted 4 lines · Michal Suchanek
There is an ongoing effort to limit use of files outside of /usr (or $prefix on general). Currently all modprobe.d paths are hardcoded to outside of $prefix. Teach kmod to load modprobe.d from $prefix/lib.
Quoted 6 lines
/lib came from module-init-tools and we kept it for compatibility. It became a non-issue when distros
decided to just merge them and do a symlink /lib ->/usr/libfollowing
https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/what distros didn't do that?
FWiW, we decided not to do TheUsrMerge at all.
Signature · 1 line
ldv
Quoted 8 lines · Dmitry V. Levin
Quoted 6 lines · Lucas De Marchi
Quoted 4 lines · Michal Suchanek
There is an ongoing effort to limit use of files outside of /usr (or $prefix on general). Currently all modprobe.d paths are hardcoded to outside of $prefix. Teach kmod to load modprobe.d from $prefix/lib.
Quoted 8 lines
Quoted 6 lines
/lib came from module-init-tools and we kept it for compatibility. It became a non-issue when distros
decided to just merge them and do a symlink /lib ->/usr/libfollowing
https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/what distros didn't do that?
FWiW, we decided not to do TheUsrMerge at all.
It looks like we will need to put this behind a compilation option
then: --enable-split-usr.
Then we only add the additional dir if split-usr is being used.
If it's not used, we may actually change the path and corresponding docs to move it to /usr,
but that is another separate change.
thanks
Lucas De Marchi
Quoted 4 lines
--
ldv
Hello,
Quoted 14 lines · Lucas De Marchi
Quoted 13 lines · Dmitry V. Levin
Quoted 11 lines · Lucas De Marchi
Quoted 4 lines · Michal Suchanek
There is an ongoing effort to limit use of files outside of /usr (or $prefix on general). Currently all modprobe.d paths are hardcoded to outside of $prefix. Teach kmod to load modprobe.d from $prefix/lib.
/lib came from module-init-tools and we kept it for compatibility. It became a non-issue when distros
decided to just merge them and do a symlink /lib ->/usr/libfollowing
https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
what distros didn't do that?
FWiW, we decided not to do TheUsrMerge at all.
It looks like we will need to put this behind a compilation option
then: --enable-split-usr.
Then we only add the additional dir if split-usr is being used.
We could also stat the directories and skip the current one if it's the same as the last one.
Quoted 4 lines
If it's not used, we may actually change the path and corresponding docs to move it to /usr,
but that is another separate change.
Yes, the man page uses hardcoded paths rather than the actual paths. There is no support for expanding configure variables in it at the moment.
Thanks
Michal
Quoted 11 lines · Lucas De Marchi
Quoted 4 lines · Michal Suchanek
There is an ongoing effort to limit use of files outside of /usr (or $prefix on general). Currently all modprobe.d paths are hardcoded to outside of $prefix. Teach kmod to load modprobe.d from $prefix/lib.
/lib came from module-init-tools and we kept it for compatibility. It became a non-issue when distros
decided to just merge them and do a symlink /lib ->/usr/libfollowing
https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
Quoted 6 lines
what distros didn't do that?
I also fear the solution you want here is not so simple since now the configs will be added twice
if there is the symlink. And if we just drop /lib and start using/usr/libwe break compatibility.
Ins't there already a mechanism in place that loads only one file with the same name (so that files in /etc can override files in /lib)?
Then even if the same directory is seached twice because of symlinks it has no effect, right?
Also there is depmod.d which is documented as /lib but is actually searched in /usr/lib.
Thanks
Michal
Quoted 53 lines
Lucas De Marchi
Quoted 50 lines
Cc Marcus Rückert <[email protected]>Cc Takashi Iwai <[email protected]>Cc Dominique Leuenberger <[email protected]>Signed-off-by Michal Suchanek <[email protected]>--- Makefile.am | 1 + libkmod/libkmod.c | 1 + man/modprobe.d.xml | 1 + 3 files changed, 3 insertions(+)Makefile.am +1
-0@@ -19,6 +19,7 @@ AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -I$(top_srcdir) \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ + -DPREFIX=\""$(prefix)"\" \ ${zlib_CFLAGS} AM_CFLAGS = $(OUR_CFLAGS)libkmod/libkmod.c +1
-0@@ -65,6 +65,7 @@ static const char *default_config_paths[] = {SYSCONFDIR "/modprobe.d" ,"/run/modprobe.d" ,"/lib/modprobe.d" , +PREFIX "/lib/modprobe.d" , NULL };man/modprobe.d.xml +1
-1@@ -40,6 +40,7 @@ </refnamediv> <refsynopsisdiv> + <para><filename>/usr/lib/modprobe.d/*.conf</filename></para> <para><filename>/lib/modprobe.d/*.conf</filename></para> <para><filename>/etc/modprobe.d/*.conf</filename></para> <para><filename>/run/modprobe.d/*.conf</filename></para> --2.26.2