From e48d1ee5980643f56165a9ee1687ff64f864aeb6 Mon Sep 17 00:00:00 2001 From: Vlad Bespalov Date: Fri, 8 Jun 2018 21:13:00 +0000 Subject: [PATCH 6/6] modprobe: print status of "allow_unsupported_modules" variable In SLES11 modprobe printed everything referenced in /etc/modprobe.d in SLES12 config parsing changed to explicitly find and print specific groups of modprobe options, which did not print the status of "allow_unsupported_modules" option when running modprobe -c The proposed patch fixes this deficiency Patch-mainline: never --- libkmod/libkmod-config.c | 13 +++++++++++++ libkmod/libkmod.h | 1 + tools/modprobe.c | 5 +++++ 3 files changed, 19 insertions(+) Index: kmod-34/libkmod/libkmod-config.c =================================================================== --- kmod-34.orig/libkmod/libkmod-config.c +++ kmod-34/libkmod/libkmod-config.c @@ -1204,6 +1204,19 @@ static struct kmod_config_iter *kmod_con return iter; } +/* + * kmod_config_unsupported_allowed: + * @ctx: kmod library context + * + * Retrieve status of unsupported modules + */ +KMOD_EXPORT bool kmod_config_unsupported_allowed(const struct kmod_ctx *ctx) +{ + struct kmod_config *config = (struct kmod_config *)kmod_get_config(ctx); + + return !config->block_unsupported; +} + KMOD_EXPORT struct kmod_config_iter *kmod_config_get_blacklists(const struct kmod_ctx *ctx) { if (ctx == NULL) Index: kmod-34/libkmod/libkmod.h =================================================================== --- kmod-34.orig/libkmod/libkmod.h +++ kmod-34/libkmod/libkmod.h @@ -530,6 +530,7 @@ bool kmod_config_iter_next(struct kmod_c * Since: 4 */ void kmod_config_iter_free_iter(struct kmod_config_iter *iter); +bool kmod_config_unsupported_allowed(const struct kmod_ctx *ctx); /** * SECTION:libkmod-module Index: kmod-34/tools/modprobe.c =================================================================== --- kmod-34.orig/tools/modprobe.c +++ kmod-34/tools/modprobe.c @@ -198,6 +198,11 @@ static int show_config(struct kmod_ctx * kmod_config_iter_free_iter(iter); } + // SUSE specific option: + if (!kmod_config_unsupported_allowed(ctx)) { + puts("allow_unsupported_modules 0\n"); + } + puts("\n# End of configuration files. Dumping indexes now:\n"); fflush(stdout);