Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S273019AbTGaNNl (ORCPT ); Thu, 31 Jul 2003 09:13:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S273020AbTGaNNl (ORCPT ); Thu, 31 Jul 2003 09:13:41 -0400 Received: from [213.24.247.63] ([213.24.247.63]:49045 "EHLO mail.techsupp.relex.ru") by vger.kernel.org with ESMTP id S273019AbTGaNNi (ORCPT ); Thu, 31 Jul 2003 09:13:38 -0400 From: Yaroslav Rastrigin Organization: RELEX Inc. To: Nico Schottelius Subject: Re: fun or real: proc interface for module handling? Date: Thu, 31 Jul 2003 17:13:24 +0400 User-Agent: KMail/1.5.2 References: <20030731121248.GQ264@schottelius.org> In-Reply-To: <20030731121248.GQ264@schottelius.org> Cc: linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307311713.24788.yarick@relex.ru> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1454 Lines: 38 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// > > 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/