commit 59b0f80206526781f236dfb46e2f35f1fc37d67e
parent ea1ff22cec6490b8ca2eea56dc38999b73735735
Author: cowmonk <cowmonk@based.pt>
Date: Wed, 4 Nov 2026 22:21:56 -0700
add -S arg modprobe
Very simple patch, this allows support for illiliti's tinyramfs which
depends on this arg.
Diffstat:
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/cmd/linux/modprobe.c b/cmd/linux/modprobe.c
@@ -535,7 +535,7 @@ usage(void)
#if FEATURE_MODPROBE_SYSLOG
"s"
#endif
- "] "
+ "] [-S version] "
#if FEATURE_MODPROBE_DIR_OVERRIDE
"[-d dir] "
#endif
@@ -558,6 +558,7 @@ main(int argc, char *argv[])
struct utsname uts;
struct StrNode *pn;
char path[PATH_MAX];
+ char *version = NULL;
int i, ret = 0;
ARGBEGIN
@@ -583,6 +584,10 @@ main(int argc, char *argv[])
// ?man -l: List available modules matching the optional _pattern_ (a fnmatch(3) glob)
lflag = 1;
break;
+ case 'S':
+ // ?man -S:version: Use version instead of the running kernel release
+ version = EARGF(usage());
+ break;
#if FEATURE_MODPROBE_SHOW_DEPENDS
case 'D':
// ?man -D: Print the sequence of insmod commands that would be used to load the module,
@@ -622,9 +627,12 @@ main(int argc, char *argv[])
#endif
if (!moddirs) {
- if (uname(&uts) < 0)
- eprintf("uname:");
- snprintf(path, sizeof(path), "/lib/modules/%s", uts.release);
+ if (!version) {
+ if (uname(&uts) < 0)
+ eprintf("uname:");
+ version = uts.release;
+ }
+ snprintf(path, sizeof(path), "/lib/modules/%s", version);
strlist_append(&moddirs, path);
}