]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/insmod: add --force longopt and document it
authorEmil Velikov <emil.l.velikov@gmail.com>
Wed, 18 Sep 2024 15:49:08 +0000 (16:49 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Sat, 21 Sep 2024 15:53:12 +0000 (10:53 -0500)
As of the initial import to git, the option was silently ignored.
Shortly afterwards, functionality was reinstated lacking a longopt and
any documentation.

As per insmod(8) for most use-cases you'd want to use modprobe(8).
Although since the option is available and we have an equivalent in
rmmod(8) having it documented and consistent triumphs.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/138
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
man/insmod.8.scd
tools/insmod.c

index 4c6d1f7a95e95e2448128234f8261cc138061294..5c304aff0a1833fbc31a14b3be5ac829389dcd2a 100644 (file)
@@ -20,6 +20,12 @@ information about errors.
 
 # OPTIONS
 
+*-f*
+*--force*
+       This option can be extremely dangerous: it tells the kernel to ignore
+       the module version and vermagic fields when loading. With this option,
+       you can load modules build locally or by third parties, although this
+       can lead to memory corruption, system crashes and data loss.
 *-s*
 *--syslog*
        Send errors to syslog instead of standard error.
index 7c8b385eb5c5dae4a98804d020da13a2ffd249e1..0f58f42e2bc19b26ba196d3f1c858b1cbb7b6216 100644 (file)
@@ -18,6 +18,7 @@
 static const char cmdopts_s[] = "fsvVh";
 static const struct option cmdopts[] = {
        // clang-format off
+       { "force", no_argument, 0, 'f' },
        { "syslog", no_argument, 0, 's' },
        { "verbose", no_argument, 0, 'v' },
        { "version", no_argument, 0, 'V' },
@@ -31,6 +32,8 @@ static void help(void)
        printf("Usage:\n"
                "\t%s [options] filename [args]\n"
                "Options:\n"
+               "\t-f, --force       DANGEROUS: forces a module load, may cause\n"
+               "\t                  data corruption and crash your machine\n"
                "\t-s, --syslog      print to syslog, not stderr\n"
                "\t-v, --verbose     enables more messages\n"
                "\t-V, --version     show version\n"