From mboxrd@z Thu Jan 1 00:00:00 1970 From: Barrie Stott Date: Thu, 29 Nov 2007 14:49:38 +0000 Subject: Re: Help wanted with parallel port rule Message-Id: <20071129144938.GA6024@etch1> List-Id: References: <20071129084807.GA3912@etch1> In-Reply-To: <20071129084807.GA3912@etch1> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Many thanks, Kay, for the reply. On Thu, Nov 29, 2007 at 12:09:18PM +0100, Kay Sievers wrote: > On Nov 29, 2007 9:48 AM, Barrie Stott wrote: > > I have a Laserjet 4l printer on my parallel port and am having trouble > > creating a udev rule that will deal with it. Below I give my reasons > > for what I have done in the hope that someone can tell me where I am > > going wrong. My main source of information is `Writing udev rules' by > > Daniel Drake and am using a GNU/Linux system running Debian Lenny. > > > > 1. I knew that I had modules parport and parport_pc by looking as the > > output from lsmod so I ran: > > > > ls -lR /sys | grep 'parport:\|parport_pc:' > > > > The complicated grep parameter merely restricts the output to desired > > directories and gave as result: > > > > /sys/bus/pci/drivers/parport_pc: > > /sys/bus/platform/drivers/parport_pc: > > /sys/bus/pnp/drivers/parport_pc: > > /sys/module/parport: > > /sys/module/parport_pc: > > > > 2. I chose the smallest of these as simplest to type and ran: > > > > udevinfo -a -p /sys/module/parport > > > > `Writing udev rules' says that there should be no initial `/sys' but I > > get the same result with and without it. The essential result from > > running udevinfo was: > > > > looking at device '/module/parport': > > KERNEL="parport" > > SUBSYSTEM="module" > > DRIVER="" > > ATTR{refcnt}="1" > > ATTR{initstate}="live" > > This is just the kernel module, not a device you can access from userspace. I've reread the Writing Udev Rules document and you're right. His emphasis like yours is on `device' and he searches sysfs only for directories containing a dev file. Unfortunately, I took that to be an example rather than a rule. > > 3. I created the following udev rule from this: > > > > KERNEL="parport", SUBSYSTEM="module", DRIVER="", ATTR{refcnt}="1", \ > > ATTR{initstate}="live", SYMLINK+="ljet4l" > > But again, where should the symlink you request point to? There is no > device node. I was hoping that udev would give me the default name as the WUR paper says under Basic Rules: `Note that we did not specify a device node name, so udev uses the default.'. > Udevtrigger handles only devices, modules will not be coldplugged. I'd not realised that. Would switching on the printer trigger udev? Is there any way to mimic/achieve coldplugging apart from a reboot? Could a udev restart or reload? > I guess, you are looking for a device like /dev/lp0? Yes. My initial attempts were to get udev to create it but without any success. I did find a file, links.conf, that I modified to allow /dev/lp0 to be made but I found no way to get /dev/lp0 using rules. My main problem here is that I don't know what, in /sys corresponds to lp0 in /dev and udev would need that information. > You probably don't > need any rule or custom symlink for it. I don't *need* a rule; I can use links.conf. However, with an initial comment in links.conf saying `This file doesn't exist', I get the feeling it's a back door: something we'd rather not talk about. I would love to know how to create /dev/lp0 without using links.conf. Thanks again, Kay. Barrie. ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 _______________________________________________ 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