[Bash-completion-devel] Bug#733815: Modules completion takes a very long time

Linda Walsh bash at tlinx.org
Wed Jan 1 09:15:11 UTC 2014



auil at usp.br wrote:
> Thanks for  your message.
> 
>>  I find it useful
>>  to have modprobe default to listing only modules that are NOT loaded
>>  yet.
> 
> For the default use, when loading a module, this is the case.

Another issue is that some filenames have '-' in them, but the module
names have '_' in them.  Does the current solution filter out
duplicates due to the modulename and filename not being the same
(i.e. '-' vs. '_')?


>   The
> command modprobe has also an "-r" option to unload the module,
> and in this case it would complete to the already loaded modules.
----
Yeah... I never use that case, so didn't code it up, but that's fairly
easy just using the output of lsmod.  To get the ones not loaded,
you have subtract the ones loaded (that you'd find w/lsmod) from the
full list -- AND filter out the ones where the names don't exactly
correspond (due to _/-).


> In my system I have 2542 modules:
> 
> $ _clean_n_sort_mods  |  wc -l
> 2543
---
Wow... ?!  (Note -- I boot directly from my HD w/no ram disk,
so anything I *know* I need, is linked in w/my base kernel).

The extra ones are only ones that I might need that would be
pertinent to my setup (i.e. only for hardware I have).

If I needed to have that many, I might have optimized my functions
more... ;-)  Good catches on that, BTW.

So sounds like using a modified function based on the function
I used and your optimizations would "ignore" the problem of the
extra links?

Thanks for the timings....don't have nearly so many modules
as it's tuned for my hw & setup...



More information about the Bash-completion-devel mailing list