From: Barrie Stott <G.B.Stott@bolton.ac.uk>
To: linux-hotplug@vger.kernel.org
Subject: Re: Help wanted with parallel port rule
Date: Thu, 29 Nov 2007 14:49:38 +0000 [thread overview]
Message-ID: <20071129144938.GA6024@etch1> (raw)
In-Reply-To: <20071129084807.GA3912@etch1>
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 <G.B.Stott@bolton.ac.uk> 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
next prev parent reply other threads:[~2007-11-29 14:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 8:48 Help wanted with parallel port rule Barrie Stott
2007-11-29 11:09 ` Kay Sievers
2007-11-29 14:49 ` Barrie Stott [this message]
2007-11-29 18:18 ` Bryan Kadzban
2007-11-29 21:06 ` Barrie Stott
2007-11-29 23:32 ` Bryan Kadzban
2007-11-30 4:45 ` Alexander E. Patrakov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071129144938.GA6024@etch1 \
--to=g.b.stott@bolton.ac.uk \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).