From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Coding problem with sysfs
Date: Sat, 05 Jun 2004 15:40:52 +0000 [thread overview]
Message-ID: <20040605154052.GB12335@kroah.com> (raw)
In-Reply-To: <002c01c44883$2717bfc0$0600a8c0@blackbox>
On Sat, Jun 05, 2004 at 02:30:33AM +0200, Christian Gmeiner wrote:
> Hi Greg,
>
> > On Wed, Jun 02, 2004 at 11:21:53AM +0200, Christian Gmeiner wrote:
> > > /sys/class/dvb/adapter0:
> > > demux0 dvr0 frontend frontend0 name net0
> >
> > The 'dev' file needs to be here. That's the problem.
> Oh i forgot something - my fault:
>
> vdr root # ls -Rl /sys/class/dvb
> /sys/class/dvb:
> total 0
> drwxr-xr-x 5 root root 0 Jun 5 02:22 adapter0
>
> /sys/class/dvb/adapter0:
> total 0
> drwxr-xr-x 2 root root 0 Jun 5 02:22 demux0
> drwxr-xr-x 2 root root 0 Jun 5 02:22 dvr0
> -r--r--r-- 1 root root 4096 Jun 5 02:22 frontend
> -r--r--r-- 1 root root 4096 Jun 5 02:22 name
> drwxr-xr-x 2 root root 0 Jun 5 02:22 net0
>
> /sys/class/dvb/adapter0/demux0:
> total 0
> -r--r--r-- 1 root root 4096 Jun 5 02:22 adap
> -r--r--r-- 1 root root 4096 Jun 5 02:22 dev
>
> /sys/class/dvb/adapter0/dvr0:
> total 0
> -r--r--r-- 1 root root 4096 Jun 5 02:22 adap
> -r--r--r-- 1 root root 4096 Jun 5 02:22 dev
>
> /sys/class/dvb/adapter0/net0:
> total 0
> -r--r--r-- 1 root root 4096 Jun 5 02:22 adap
> -r--r--r-- 1 root root 4096 Jun 5 02:22 dev
>
Hm, how about using 'tree' instead, it's much easier to show the
heirchey with it :)
Anyway, how are you putting struct class_device structures into such a
tree? We don't currently allow parents of them in the kernel. Are you
using basic kobjects here?
What hotplug events get generated when you create your "demux0" and
others devices?
The solution is for you to put everything under the /sys/class/dvb/
directory, and not go one level deeper.
Care to post your code?
> > What happens if you run
> > udevtest /sys/class/dvb/adapter0
>
> vdr root # udevtest /sys/class/dvb/adapter0
> version 025
> looking at '/class/dvb/adapter0'
> configured rule in '/etc/udev/rules.d//10-myrule.rules' at line 2 applied,
> 'adapter0' becomes 'dvb/adapter%n/%k'
> creating device node '/dev/dvb/adapter0/adapter0', major = '250', minor > '7', mode = '020660', uid = '0', gid = '27'
Ok, so that works :)
> >
>
> This is my udev rule:
> # dvb devices
> SYSFS{adap}="adapter[0-9]*", NAME="dvb/adapter%n/%k"
>
> And this is the result in /dev:
>
> vdr root # ls -Rl /dev/dvb
> /dev/dvb:
> total 0
> drwxr-xr-x 2 root root 0 Jun 5 02:22 adapter0
>
> /dev/dvb/adapter0:
> total 0
> crw-rw---- 1 root video 250, 7 Jun 5 02:22 adapter0
> crw-rw---- 1 root video 250, 4 Jun 5 02:22 demux0
> crw-rw---- 1 root video 250, 5 Jun 5 02:22 dvr0
> crw-rw---- 1 root video 250, 7 Jun 5 02:22 net0
>
>
> And here is the problem:
> vdr root # ls /dev/dvb/adapter0/demux0
> /dev/dvb/adapter0/demux0
> vdr root # cat /dev/dvb/adapter0/demux0
> cat: /dev/dvb/adapter0/demux0: No such device or address
Ok, that's your kernel driver problem, not a udev issue :)
Are you sure 250:4 is the proper major:minor assigned to your kernel
object?
Again, code would help here.
Good luck,
greg k-h
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
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:[~2004-06-05 15:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-02 9:21 Coding problem with sysfs Christian Gmeiner
2004-06-04 21:05 ` Greg KH
2004-06-05 0:30 ` Christian Gmeiner
2004-06-05 15:40 ` Greg KH [this message]
2004-06-05 16:23 ` Christian Gmeiner
2004-06-07 23:38 ` Greg KH
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=20040605154052.GB12335@kroah.com \
--to=greg@kroah.com \
--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).