Re: [PATCH kmod] kmod: remove .alias config files for modprobe.d

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 17, 2024 at 06:26:45PM GMT, Emil Velikov via B4 Relay wrote:
From: Emil Velikov <emil.l.velikov@xxxxxxxxx>

The use of .alias (alongside .conf) was added for compatibility with the
original module-init-tools project and has been living in kmod ever
since.

In practise, all the linux distributions that I can see are using .conf
files alone, as instructed by modprobe.d(5) and the only instance of an
.alias file is the modules.alias as shipped in the kernel.

The latter is already handled by other parts of the kmod project, so
let's enforce what our documentation says.

Signed-off-by: Emil Velikov <emil.l.velikov@xxxxxxxxx>


Reviewed-by: Lucas De Marchi <lucas.demarchi@xxxxxxxxx>

thanks
Lucas De Marchi

---
As suggested in https://lore.kernel.org/linux-modules/q6dutb2b5ztkuwjkq7a7ddnsbfneoq66bafaaxwppelepflcc5@us5n2ll5syja/T/#m84a542f8d4e2f4d31b2a7ee82aaf3d0bcf211aec

I have tested this on my Arch box, alongside a normal make
check/distcheck and it's working as expected. Other distributions have
not been tested, although I don't anticipate any to be using .alias
configuration files.

The section in the README will be removed shortly via unrelated patch.
---
libkmod/libkmod-config.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index a571b6b..fb28ed9 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -940,8 +940,7 @@ static bool conf_files_filter_out(struct kmod_ctx *ctx, DIR *d,
	if (fn[0] == '.')
		return true;

-	if (len < 6 || (!streq(&fn[len - 5], ".conf")
-				&& !streq(&fn[len - 6], ".alias")))
+	if (len < 6 || !streq(&fn[len - 5], ".conf"))
		return true;

	fstatat(dirfd(d), fn, &st, 0);

---
base-commit: fa715f8c8b78a09f47701ce1cf46e9b67a49b8d0
change-id: 20240708-rm-alias-288013f86456

Best regards,
--
Emil Velikov <emil.l.velikov@xxxxxxxxx>






[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux