aruu

[MIRROR] Actual replacement for Busybox | suckless
git clone https://git.daat.foo/aruu.git
Log | Files | Refs | README | LICENSE

commit 90a15a1d33a86fd90a7f7a5614cf27211be7094c
parent ea1ff22cec6490b8ca2eea56dc38999b73735735
Author: Anto <anto@xplshn.com.ar>
Date:   Thu,  5 Nov 2026 07:34:55 -0300

Merge pull request #7 from cowmonk/modprobe

modprobe: add '-S' argument
Diffstat:
Mcmd/linux/modprobe.c | 16++++++++++++----
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); }