[ltp] Re: can not open /dev/thinkpad

Michael Hagemann linux-thinkpad@linux-thinkpad.org
Thu, 17 Oct 2002 19:25:43 +0200


On Thu, 17 Oct 2002 07:42:03 -0700 Rob Walker wrote:

> On Thu, 2002-10-17 at 01:43, Michael Hagemann wrote:
>
> > Rob probably just has it unintentionally configured in his new kernel!?
> 
> I have whatever debian has sent to me.  :-)
> 
> tp600x:~# cat /boot/config-2.4.18-686 | grep -i devfs
> CONFIG_DEVFS_FS=y
> # CONFIG_DEVFS_MOUNT is not set
> # CONFIG_DEVFS_DEBUG is not set

So they did it for you.

> I would agree with you, except for the strace of tpctl which shows that
> it is trying to open /dev/thinkpad.  Is strace lying, or is the open()
> call joking?  :-)

No, it really tries to open /dev/thinkpad.  It shouldn't.  The whole
problem is a little tricky...  A program that wants to access a device
needs to know whether devfs is configured in the kernel, mounted (and
mounted at the right place).  Unfortunately there are inbetweens, that
make things difficult.   We, for example, have it configured, but not
mounted under /dev.

Now tpctl looks for a file "/dev/.devfs" as a sign for a properly
installed devfs.

thinkpad.o (the module) just checks for devfs to be configured in the 
kernel.  If it is, thinkpad.o registers a devfs device file 
"$(devfs_root)/thinkpad/thinkpad".

This doesn't work, obviously.

So at least in this utility suite, we need a consistent setup.  I'm not
sure yet how this done in the best way.  I'll try to make thinkpad.o
complain if devfs is configured but not mounted under "/dev".  This
would have given the both of us the right clue...


regs,
michael