diff mbox series

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

Message ID 20240717-rm-alias-v1-1-58874caf343a@gmail.com (mailing list archive)
State New
Headers show
Series [kmod] kmod: remove .alias config files for modprobe.d | expand

Commit Message

Emil Velikov via B4 Relay July 17, 2024, 5:26 p.m. UTC
From: Emil Velikov <emil.l.velikov@gmail.com>

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@gmail.com>
---
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(-)


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

Best regards,

Comments

Lucas De Marchi July 19, 2024, 4:54 p.m. UTC | #1
On Wed, Jul 17, 2024 at 06:26:45PM GMT, Emil Velikov via B4 Relay wrote:
>From: Emil Velikov <emil.l.velikov@gmail.com>
>
>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@gmail.com>


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

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@gmail.com>
>
>
diff mbox series

Patch

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);