From: "Alexander E. Patrakov" Date: Wed, 03 Mar 2004 15:49:40 +0000 Subject: Re: [ANNOUNCE] udev 021 release Message-Id: <200403032049.40737.patrakov@ums.usu.ru> List-Id: References: <20040303000957.GA11755@kroah.com> In-Reply-To: <20040303000957.GA11755@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wednesday 03 March 2004 17:22, Ed Tomlinson wrote: > On March 03, 2004 04:56 am, Michael Weiser wrote: > > Normally with static /dev one has a /dev/dsp device for example. As soon > > as an application tries to open it the kernel would try to load a module > > "sound" or "char-major-something" if sound support isn't compiled into > > it. Now with udev I'll never get /dev/dsp in the first place and there's > > no mechanism like devfs's file open monitoring and subsequent device > > file creation. So my idea is to initialise /dev with some static files, > > for hardware I know is there but hasn't had a driver loaded yet. My > > question is: Is there a nicer and more elegant way than just unpacking a > > tarball into /dev before starting udevd? A tarball would also break a > > (theoretical) use of dynamic major/minor numbers by the kernel. > > Would it be possible to have something in the module itself? i.e. We > create a new macro to add info that a script can use. This info could live > in a new file in lib/modules or in the actual module. This could be used > to create the static setup dynamicly. Actually, I am now busy implementing this (if you want, race with me - I am a very slow coder). My implementation, however, uses a directory: /lib/modules/2.6.3/sys. The entries are supposed to be in sysfs format, and defined in modules themseves, like: MODULE_INFO(syshint, "block/loop0/dev=7:0"); Of course, a change to the depmod program is needed to create this hierarchy based on such "syshint" information. Already found a bad thing with my approach: the loop module accepts a parameter max_loop:Maximum number of loop devices (1-256), and we should create the same (dynamic!) number of sysfs entries. The mismatch can lead to races e.g.: 1) Suppose that we create only one such syshint 2) The initscript creates only one /dev/loop0 device 3) An app wants to open /dev/loop0 4) The kernel modprobes block-major-7-0, i.e. loop 5) Udev is run in order to create all other loop devices, but it runs slowly. 6) An app wants to open /dev/loop1, but udev hasn't created this yet 7) Slow udev finally creates /dev/loop1 -- Alexander E. Patrakov ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&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