[Toybox] [PATCH 2/2] modprobe: handle module lists correctly.

enh enh at google.com
Sat Sep 11 11:35:23 PDT 2021


The while loop for -a or -r was forgetting that argv is a char**.

Also:

* sort the options in the help.
* remove DBASE_SIZE and the comment about keeping it up to date, since
  we can just use ARRAY_LEN instead (though I wonder whether anyone has
  enough modules to benefit from a hash table rather than just a list?).
* fix the comment explaining why read_line() exists.
* fix a typo 'aliase' for 'alias'.
* fix bad intentation in depmode_read_entry().
* simplify rm_mod() since no-one was relying on the return value being
  errno, the O_EXCL flag is irrelevant (but ignored by the kernel), and
  all callers want the same flags.
* simplify ins_mod() because even CentOS 7.2 has finit_module(2), and
  unlike insmod(1) -- which I've touched in a separate patch -- modprobe
  doesn't need to handle loading a module from stdin.
---
 toys/pending/modprobe.c | 75 ++++++++++++-----------------------------
 1 file changed, 22 insertions(+), 53 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210911/2d61df8e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-modprobe-handle-module-lists-correctly.patch
Type: text/x-patch
Size: 7208 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210911/2d61df8e/attachment.bin>


More information about the Toybox mailing list