Re: fun or real: proc interface for module handling?

From: Yaroslav Rastrigin (yarick@relex.ru)
Date: Thu Jul 31 2003 - 08:13:24 EST


Hi !
On Thursday 31 July 2003 16:12, Nico Schottelius wrote:
> Hello!
>
> I was just joking around here, but what do you think about this idea:
>
> A proc interface for module handling:
> /proc/mods/
> /proc/mods/<module-name>/<link-to-the-modules-use-us>
>
> So we could try to load a module with
> mkdir /proc/mods/ipv6
> and remove it and every module which uses us with
> rm -r /proc/mods/ipv6
>

Well, this idea itsel is quite neat, and could sometimes save lots of time
(esp. when dealing with serious modules' deps). I would like to propose
slightly different appropach:
cp /lib/modules/2.6.0-test2/kernel/drivers/somedriver.ko /proc/modtree
is equivalent to insmod somedriver.ko (or modprobe ?). (How one could pass
module params in the former case ?).
Then, if no other module depends on it, then this entry (under /proc/modtree)
is a file, otherwise its a directory, with all depending modules also either
files or dirs. So, module removal would be as simple as
[ -f /proc/modtree/somedriver ] && rm /proc/modtree/somedriver || \
[ -d /proc/modtree/somedriver ] && rm -rf /proc/modtree/somedriver/* ; \
rm /proc/modtree/somedriver

-- 
With all the best, yarick at relex dot ru.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:49 EST