From: Emil Velikov Date: Wed, 9 Oct 2024 10:39:52 +0000 (+0100) Subject: man/rmmod: document (how) we handle list of modules X-Git-Tag: v34~240 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8feccfc21ddccd507daf45c899eefe55f0148190;p=thirdparty%2Fkmod.git man/rmmod: document (how) we handle list of modules Mention in the help and docs that rmmod operates on list of modules, alongside its current mode of operation. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/177 Signed-off-by: Lucas De Marchi --- diff --git a/man/rmmod.8.scd b/man/rmmod.8.scd index f5085036..7aa4e0e6 100644 --- a/man/rmmod.8.scd +++ b/man/rmmod.8.scd @@ -6,13 +6,19 @@ rmmod - Simple program to remove a module from the Linux Kernel # SYNOPSIS -*rmmod* [_OPTIONS_] [_modulename_] +*rmmod* [_OPTIONS_] [_list of modulenames_] # DESCRIPTION -*rmmod* is a trivial program to remove a module (when module unloading support -is provided) from the kernel. Most users will want to use *modprobe*(8) with the -*-r* option instead since it removes unused dependent modules as well. +*rmmod* is a trivial program to remove a module or a list of modules from the +kernel (when module unloading support is provided). Most users will want to use +*modprobe*(8) with the *-r* option instead since it removes unused dependent +modules as well. + +When a list of modules is provided, the program will process them one at a time. +If a module is not found, *rmmod* will immediately exit with an error code. +Should the module removal fail, the program will log an error AND continue with +the next module. This behaviour is NOT controlled by the *--force* option. # OPTIONS diff --git a/tools/rmmod.c b/tools/rmmod.c index 5dd7aa3a..1315eda2 100644 --- a/tools/rmmod.c +++ b/tools/rmmod.c @@ -35,7 +35,7 @@ static const struct option cmdopts[] = { static void help(void) { printf("Usage:\n" - "\t%s [options] modulename ...\n" + "\t%s [options] [list of modulenames]\n" "Options:\n" "\t-f, --force DANGEROUS: forces a module unload and may\n" "\t crash your machine\n"