From: "Alexander E. Patrakov" Date: Fri, 12 Mar 2004 15:03:00 +0000 Subject: Non-hardware devices like loop: another idea Message-Id: <200403122003.00557.patrakov@ums.usu.ru> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Recently I stated that I am working on solution to the "chicken-and-egg" problem related to devices like /dev/loop*, /dev/nbd*, /dev/ppp and so on, which require no hardware and therefore are not detectable by the hotplug scripts. My (bad) idea was to include the sysfs entries that would appear after loading the module in the module itself by means of the MODULE_INFO macro, and then modify depmod to populate /lib/modules//sys and use it to populate /dev with the corresponding entries (the UDEV_TEST environment variable already allows us to override the location of the sysfs directory). Then the char-major magic will load these modules on demand. I have a proof-of-concept implementation (will mail it here if there is any demand). The list of files altered: module-init-tools-3.0-pre5/depmod.c linux-2.6.4/include/linux/module.h linux-2.6.4/drivers/block/loop.c linux-2.6.4/drivers/char/rtc.c linux-2.6.4/drivers/net/ppp_generic.c ...and my udev initscript This is not a real, but a proof-of-concept implementation because there are much more such non-hardware modules. This works, --- BUT! --- I found my implementation rather clumsy and while implementing it I decided that it would be better to just mark such modules and modprobe tham all, and make the hotplug script modprobe other stuff. I decided to start implementing such mark... and found that it has already been done, so actually no patches are needed except for the udev initscript! I am talking about /lib/modules//modules.alias. The simple idea is to grep this file (and probably /etc/modprobe.conf also) for lines containing char-major and block-major. The list pretty much coincides with the list of non-hardware-related modules that nevertheless provide devices. Does anyone care to include this into the future release of udev? -- Alexander E. Patrakov ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel