From: Michal Suchanek <hidden> Date: 2021-01-12 16:03:08
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.
Cc: Marcus Rückert <redacted>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Dominique Leuenberger <redacted>
Signed-off-by: Michal Suchanek <redacted>
---
Makefile.am | 1 +
libkmod/libkmod.c | 1 +
man/modprobe.d.xml | 1 +
3 files changed, 3 insertions(+)
From: Lucas De Marchi <hidden> Date: 2021-01-12 21:42:43
On Tue, Jan 12, 2021 at 8:06 AM Michal Suchanek [off-list ref] wrote:
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
From: Dmitry V. Levin <hidden> Date: 2021-01-12 22:30:18
On Tue, Jan 12, 2021 at 12:56:05PM -0800, Lucas De Marchi wrote:
On Tue, Jan 12, 2021 at 8:06 AM Michal Suchanek [off-list ref] wrote:
quoted
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.
From: Lucas De Marchi <hidden> Date: 2021-01-13 14:09:37
On Tue, Jan 12, 2021 at 2:22 PM Dmitry V. Levin [off-list ref] wrote:
On Tue, Jan 12, 2021 at 12:56:05PM -0800, Lucas De Marchi wrote:
quoted
On Tue, Jan 12, 2021 at 8:06 AM Michal Suchanek [off-list ref] wrote:
quoted
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.
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
From: Michal Suchánek <hidden> Date: 2021-01-14 09:55:36
Hello,
On Wed, Jan 13, 2021 at 06:08:41AM -0800, Lucas De Marchi wrote:
On Tue, Jan 12, 2021 at 2:22 PM Dmitry V. Levin [off-list ref] wrote:
quoted
On Tue, Jan 12, 2021 at 12:56:05PM -0800, Lucas De Marchi wrote:
quoted
On Tue, Jan 12, 2021 at 8:06 AM Michal Suchanek [off-list ref] wrote:
quoted
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.
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.
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
From: Michal Suchánek <hidden> Date: 2021-05-30 09:39:35
On Tue, Jan 12, 2021 at 12:56:05PM -0800, Lucas De Marchi wrote:
On Tue, Jan 12, 2021 at 8:06 AM Michal Suchanek [off-list ref] wrote:
quoted
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.
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