From: Lucas De Marchi Date: Fri, 13 Jun 2025 18:57:08 +0000 (-0500) Subject: tools/modprobe: Fix odd --remove-holders behavior X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=15edeed38680c7ab5cfa2717b1721e3e51e41e33;p=thirdparty%2Fkmod.git tools/modprobe: Fix odd --remove-holders behavior --remove-holders was not implying --remove, which means that if the user called `modprobe --remove-holders xe` it would actually try to insert the xe module. Fix it and spell it out in the man page about one option implying the other. Considering i915 is not currently loaded: Before: kmod $ ./build/modprobe -v --dry-run --remove-holders i915 insmod /lib/modules/6.14.11-1-MANJARO/kernel/drivers/char/agp/intel-gtt.ko.zst insmod /lib/modules/6.14.11-1-MANJARO/kernel/drivers/gpu/drm/i915/i915.ko.zst kmod $ After: kmod $ ./build/modprobe -v --dry-run --remove-holders i915 kmod $ Signed-off-by: Lucas De Marchi Link: https://github.com/kmod-project/kmod/pull/372 --- diff --git a/man/modprobe.8.scd b/man/modprobe.8.scd index 509d4456..aaf04c34 100644 --- a/man/modprobe.8.scd +++ b/man/modprobe.8.scd @@ -169,6 +169,7 @@ database. *--remove-holders* This option causes *modprobe* to remove the mentioned module(s), alongside other modules that depend on it/them - aka the reverse dependency list. + This options implies --remove. For compatibility reasons *--remove-dependencies* is also accepted for this option but will be removed after kmod 36. diff --git a/tools/modprobe.c b/tools/modprobe.c index 81b19606..fa9757e2 100644 --- a/tools/modprobe.c +++ b/tools/modprobe.c @@ -827,6 +827,7 @@ static int do_modprobe(int argc, char **orig_argv) /* fall through */ case 5: remove_holders = 1; + do_remove = 1; break; case 'w': { char *endptr = NULL;