aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/modprobe.c
AgeCommit message (Collapse)Author
2021-05-15modprobe: don't stop on empty lines.Elliott Hughes
I don't _think_ that can happen with the .dep files since they're machine-generated, but the config files can and do contain empty lines to aid readability. (Not found on Android, so I haven't tested this, but the code already even contained a special case for empty lines. I haven't touched the /proc/modules loop because the kernel definitely isn't going to insert empty lines, and that code _would_ need to be modified to cope with empty lines, and since I can't test this, that would be not just pointless but also irresponsible!)
2021-02-03Cleanup pass on modprobe.Rob Landley
I need to set up a test environment for this...
2019-01-22Whitespace: remove tabs from indentation.Elliott Hughes
I accidentally added a tab in xargs.c, so as penance I'll clean up all the tabs.
2019-01-08modprobe: don't return failure just because we didn't find global config.Elliott Hughes
Without this change, a successful modprobe on Android exits with status 1 because Android doesn't have /etc/modprobe.conf or /etc/modprobe.d/ --- neither of which seem to be required on desktop Linux either.
2019-01-07modprobe: reset errno before ins_mod.Elliott Hughes
Otherwise in verbose mode we output bogus errors instead of `Success`.
2018-08-04Fix modprobe error handling.Elliott Hughes
modprobe was failing if you `modprobe a.ko`, then `modprobe b.ko` where b.ko depends on a.ko --- b.ko will fail to load because a.ko is already loaded. The code to handle this was incorrectly checking `rc` rather than `errno` against EEXIST. (We should pull the insmod.c equivalent of `ins_mod` out into lib/ and reuse it in modprobe.c, but I didn't want to get bogged down.) Bug: https://issuetracker.google.com/112069618 Reported-by: Wen Xie <xiewen3@motorola.com>
2017-01-28modprobe: Small cleanup pass, described on the list.Rob Landley
2017-01-28modprobe: use finit_module when possibleSteve Muckle
The finit_module() system call, introduced in Linux 3.8, reads the module from a supplied file descriptor. This allows the kernel to do security checks based on the file's location.
2017-01-28modprobe: add -d option to specify module directory path(s)Steve Muckle
While most systems have their kernel modules, modules.dep etc located at /lib/modules/`uname -r` this is not always the case. The -d option may be used to specify a nonstandard path for these files. It may be used more than once to specify multiple directories where these files may be found.
2016-12-28Stop lying to the compiler in modprobe's read_line.Elliott Hughes
sizeof(int) != sizeof(size_t) for LP64, leading to hilarity^Wcrashes.
2016-08-04Make xopen() skip stdin/stdout/stderr, add xopen_stdio() if you want stdout,Rob Landley
add xopenro() that takes one argument and understands "-" means stdin, and switch over lots of users.
2016-04-08Redefining basename_r to mean something random seems popular (bionic and freebsdRob Landley
both did it) so use getbasename instead.
2015-09-11Replace toys.exithelp with help_exit() in lib.Rob Landley
2015-08-08modprobe: use -q to silenceIsaac Dunham
2015-08-08modprobe: use basename_r()Isaac Dunham
2015-08-08modprobe: delete perror_exit() that makes no senseIsaac Dunham
Given modprobe -a, it's important to not exit early for a failure to load a module; additionally, the rest of the code presumes that this can fail without exiting.
2014-10-20More static analysis fixes from Ashwini Sharma.Rob Landley
2014-08-12Patches to commands for issues reported from static analysis tool.Ashwini Sharma
portability.h.patch - it is for O_CLOEXEC, as compiler complained of it. Makefile.patch - for cleaning generated/*.o files and libopts.dat file [Fixup to uniq.c from Rob.]
2014-07-06minor cleanup: move a global variable into GLOBALS(), inline strchr_null(), ↵Rob Landley
some whitespace and bracket cleanups.
2014-04-09modprobe: cleanup, incorporate Ashwini's fix for alias loadingIsaac Dunham
Move <fnmatch.h> to toys.h, since it's POSIX. Avoid duplicating code in an if/else block. Terser error messages, spelling. Don't always print the state.
2014-04-09Modprobe from Madhur Verma and Kyungwan Han.Rob Landley